public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] linux-patches r1689 - genpatches-2.6/trunk/2.6.32
@ 2010-04-01 12:10 Mike Pagano (mpagano)
  0 siblings, 0 replies; only message in thread
From: Mike Pagano (mpagano) @ 2010-04-01 12:10 UTC (permalink / raw
  To: gentoo-commits

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=UTF-8, Size: 286677 bytes --]

Author: mpagano
Date: 2010-04-01 12:10:00 +0000 (Thu, 01 Apr 2010)
New Revision: 1689

Added:
   genpatches-2.6/trunk/2.6.32/1009_linux-2.6.32.10.patch
Modified:
   genpatches-2.6/trunk/2.6.32/0000_README
Log:
Linux patch version 2.6.32.10

Modified: genpatches-2.6/trunk/2.6.32/0000_README
===================================================================
--- genpatches-2.6/trunk/2.6.32/0000_README	2010-03-15 19:55:50 UTC (rev 1688)
+++ genpatches-2.6/trunk/2.6.32/0000_README	2010-04-01 12:10:00 UTC (rev 1689)
@@ -75,6 +75,10 @@
 From:   http://www.kernel.org
 Desc:   Linux 2.6.32.9
 
+Patch:  1009_linux-2.6.32.10.patch
+From:   http://www.kernel.org
+Desc:   Linux 2.6.32.10
+
 Patch:  2400_5906-transmit-hang-fix.patch
 From:   http://bugs.gentoo.org/show_bug.cgi?id=304625
 Desc:	tg3: Fix 5906 transmit hangs

Added: genpatches-2.6/trunk/2.6.32/1009_linux-2.6.32.10.patch
===================================================================
--- genpatches-2.6/trunk/2.6.32/1009_linux-2.6.32.10.patch	                        (rev 0)
+++ genpatches-2.6/trunk/2.6.32/1009_linux-2.6.32.10.patch	2010-04-01 12:10:00 UTC (rev 1689)
@@ -0,0 +1,7932 @@
+diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
+index 5bc4eaa..345c399 100644
+--- a/Documentation/kernel-parameters.txt
++++ b/Documentation/kernel-parameters.txt
+@@ -2668,6 +2668,13 @@ and is between 256 and 4096 characters. It is defined in the file
+ 					medium is write-protected).
+ 			Example: quirks=0419:aaf5:rl,0421:0433:rc
+ 
++	userpte=
++			[X86] Flags controlling user PTE allocations.
++
++				nohigh = do not allocate PTE pages in
++					HIGHMEM regardless of setting
++					of CONFIG_HIGHPTE.
++
+ 	vdso=		[X86,SH]
+ 			vdso=2: enable compat VDSO (default with COMPAT_VDSO)
+ 			vdso=1: enable VDSO (default)
+diff --git a/arch/Kconfig b/arch/Kconfig
+index 7f418bb..90934b9 100644
+--- a/arch/Kconfig
++++ b/arch/Kconfig
+@@ -6,8 +6,6 @@ config OPROFILE
+ 	tristate "OProfile system profiling (EXPERIMENTAL)"
+ 	depends on PROFILING
+ 	depends on HAVE_OPROFILE
+-	depends on TRACING_SUPPORT
+-	select TRACING
+ 	select RING_BUFFER
+ 	select RING_BUFFER_ALLOW_SWAP
+ 	help
+diff --git a/arch/ia64/include/asm/acpi.h b/arch/ia64/include/asm/acpi.h
+index 91df968..8a20b58 100644
+--- a/arch/ia64/include/asm/acpi.h
++++ b/arch/ia64/include/asm/acpi.h
+@@ -94,6 +94,7 @@ ia64_acpi_release_global_lock (unsigned int *lock)
+ #define acpi_noirq 0	/* ACPI always enabled on IA64 */
+ #define acpi_pci_disabled 0 /* ACPI PCI always enabled on IA64 */
+ #define acpi_strict 1	/* no ACPI spec workarounds on IA64 */
++#define acpi_ht 0	/* no HT-only mode on IA64 */
+ #endif
+ #define acpi_processor_cstate_check(x) (x) /* no idle limits on IA64 :) */
+ static inline void disable_acpi(void) { }
+diff --git a/arch/sparc/include/asm/io_32.h b/arch/sparc/include/asm/io_32.h
+index 93fe21e..679c750 100644
+--- a/arch/sparc/include/asm/io_32.h
++++ b/arch/sparc/include/asm/io_32.h
+@@ -8,7 +8,7 @@
+ #include <asm/page.h>      /* IO address mapping routines need this */
+ #include <asm/system.h>
+ 
+-#define page_to_phys(page)	(((page) - mem_map) << PAGE_SHIFT)
++#define page_to_phys(page)	(page_to_pfn(page) << PAGE_SHIFT)
+ 
+ static inline u32 flip_dword (u32 l)
+ {
+diff --git a/arch/sparc/include/asm/page_32.h b/arch/sparc/include/asm/page_32.h
+index f72080b..156707b 100644
+--- a/arch/sparc/include/asm/page_32.h
++++ b/arch/sparc/include/asm/page_32.h
+@@ -143,7 +143,7 @@ extern unsigned long pfn_base;
+ #define phys_to_virt		__va
+ 
+ #define ARCH_PFN_OFFSET		(pfn_base)
+-#define virt_to_page(kaddr)	(mem_map + ((((unsigned long)(kaddr)-PAGE_OFFSET)>>PAGE_SHIFT)))
++#define virt_to_page(kaddr)	pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
+ 
+ #define pfn_valid(pfn)		(((pfn) >= (pfn_base)) && (((pfn)-(pfn_base)) < max_mapnr))
+ #define virt_addr_valid(kaddr)	((((unsigned long)(kaddr)-PAGE_OFFSET)>>PAGE_SHIFT) < max_mapnr)
+diff --git a/arch/sparc/include/asm/stat.h b/arch/sparc/include/asm/stat.h
+index 55db5ec..39327d6 100644
+--- a/arch/sparc/include/asm/stat.h
++++ b/arch/sparc/include/asm/stat.h
+@@ -53,8 +53,8 @@ struct stat {
+ 	ino_t		st_ino;
+ 	mode_t		st_mode;
+ 	short		st_nlink;
+-	uid_t		st_uid;
+-	gid_t		st_gid;
++	uid16_t		st_uid;
++	gid16_t		st_gid;
+ 	unsigned short	st_rdev;
+ 	off_t		st_size;
+ 	time_t		st_atime;
+diff --git a/arch/sparc/kernel/central.c b/arch/sparc/kernel/central.c
+index f3b5466..4589ca3 100644
+--- a/arch/sparc/kernel/central.c
++++ b/arch/sparc/kernel/central.c
+@@ -99,7 +99,7 @@ static int __devinit clock_board_probe(struct of_device *op,
+ 
+ 	p->leds_resource.start = (unsigned long)
+ 		(p->clock_regs + CLOCK_CTRL);
+-	p->leds_resource.end = p->leds_resource.end;
++	p->leds_resource.end = p->leds_resource.start;
+ 	p->leds_resource.name = "leds";
+ 
+ 	p->leds_pdev.name = "sunfire-clockboard-leds";
+@@ -194,7 +194,7 @@ static int __devinit fhc_probe(struct of_device *op,
+ 	if (!p->central) {
+ 		p->leds_resource.start = (unsigned long)
+ 			(p->pregs + FHC_PREGS_CTRL);
+-		p->leds_resource.end = p->leds_resource.end;
++		p->leds_resource.end = p->leds_resource.start;
+ 		p->leds_resource.name = "leds";
+ 
+ 		p->leds_pdev.name = "sunfire-fhc-leds";
+diff --git a/arch/sparc/kernel/process_32.c b/arch/sparc/kernel/process_32.c
+index 2830b41..c49865b 100644
+--- a/arch/sparc/kernel/process_32.c
++++ b/arch/sparc/kernel/process_32.c
+@@ -526,7 +526,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
+ 			 * Set some valid stack frames to give to the child.
+ 			 */
+ 			childstack = (struct sparc_stackf __user *)
+-				(sp & ~0x7UL);
++				(sp & ~0xfUL);
+ 			parentstack = (struct sparc_stackf __user *)
+ 				regs->u_regs[UREG_FP];
+ 
+diff --git a/arch/sparc/kernel/process_64.c b/arch/sparc/kernel/process_64.c
+index c3f1cce..cb70476 100644
+--- a/arch/sparc/kernel/process_64.c
++++ b/arch/sparc/kernel/process_64.c
+@@ -398,11 +398,11 @@ static unsigned long clone_stackframe(unsigned long csp, unsigned long psp)
+ 	} else
+ 		__get_user(fp, &(((struct reg_window32 __user *)psp)->ins[6]));
+ 
+-	/* Now 8-byte align the stack as this is mandatory in the
+-	 * Sparc ABI due to how register windows work.  This hides
+-	 * the restriction from thread libraries etc.  -DaveM
++	/* Now align the stack as this is mandatory in the Sparc ABI
++	 * due to how register windows work.  This hides the
++	 * restriction from thread libraries etc.
+ 	 */
+-	csp &= ~7UL;
++	csp &= ~15UL;
+ 
+ 	distance = fp - psp;
+ 	rval = (csp - distance);
+diff --git a/arch/sparc/kernel/signal32.c b/arch/sparc/kernel/signal32.c
+index ba5b09a..ea22cd3 100644
+--- a/arch/sparc/kernel/signal32.c
++++ b/arch/sparc/kernel/signal32.c
+@@ -120,8 +120,8 @@ struct rt_signal_frame32 {
+ };
+ 
+ /* Align macros */
+-#define SF_ALIGNEDSZ  (((sizeof(struct signal_frame32) + 7) & (~7)))
+-#define RT_ALIGNEDSZ  (((sizeof(struct rt_signal_frame32) + 7) & (~7)))
++#define SF_ALIGNEDSZ  (((sizeof(struct signal_frame32) + 15) & (~15)))
++#define RT_ALIGNEDSZ  (((sizeof(struct rt_signal_frame32) + 15) & (~15)))
+ 
+ int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from)
+ {
+@@ -420,15 +420,17 @@ static void __user *get_sigframe(struct sigaction *sa, struct pt_regs *regs, uns
+ 			sp = current->sas_ss_sp + current->sas_ss_size;
+ 	}
+ 
++	sp -= framesize;
++
+ 	/* Always align the stack frame.  This handles two cases.  First,
+ 	 * sigaltstack need not be mindful of platform specific stack
+ 	 * alignment.  Second, if we took this signal because the stack
+ 	 * is not aligned properly, we'd like to take the signal cleanly
+ 	 * and report that.
+ 	 */
+-	sp &= ~7UL;
++	sp &= ~15UL;
+ 
+-	return (void __user *)(sp - framesize);
++	return (void __user *) sp;
+ }
+ 
+ static int save_fpu_state32(struct pt_regs *regs, __siginfo_fpu_t __user *fpu)
+diff --git a/arch/sparc/kernel/signal_32.c b/arch/sparc/kernel/signal_32.c
+index 7ce1a10..9882df9 100644
+--- a/arch/sparc/kernel/signal_32.c
++++ b/arch/sparc/kernel/signal_32.c
+@@ -267,15 +267,17 @@ static inline void __user *get_sigframe(struct sigaction *sa, struct pt_regs *re
+ 			sp = current->sas_ss_sp + current->sas_ss_size;
+ 	}
+ 
++	sp -= framesize;
++
+ 	/* Always align the stack frame.  This handles two cases.  First,
+ 	 * sigaltstack need not be mindful of platform specific stack
+ 	 * alignment.  Second, if we took this signal because the stack
+ 	 * is not aligned properly, we'd like to take the signal cleanly
+ 	 * and report that.
+ 	 */
+-	sp &= ~7UL;
++	sp &= ~15UL;
+ 
+-	return (void __user *)(sp - framesize);
++	return (void __user *) sp;
+ }
+ 
+ static inline int
+diff --git a/arch/sparc/kernel/signal_64.c b/arch/sparc/kernel/signal_64.c
+index 647afbd..9fa48c3 100644
+--- a/arch/sparc/kernel/signal_64.c
++++ b/arch/sparc/kernel/signal_64.c
+@@ -353,7 +353,7 @@ segv:
+ /* Checks if the fp is valid */
+ static int invalid_frame_pointer(void __user *fp, int fplen)
+ {
+-	if (((unsigned long) fp) & 7)
++	if (((unsigned long) fp) & 15)
+ 		return 1;
+ 	return 0;
+ }
+@@ -396,15 +396,17 @@ static inline void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs *
+ 			sp = current->sas_ss_sp + current->sas_ss_size;
+ 	}
+ 
++	sp -= framesize;
++
+ 	/* Always align the stack frame.  This handles two cases.  First,
+ 	 * sigaltstack need not be mindful of platform specific stack
+ 	 * alignment.  Second, if we took this signal because the stack
+ 	 * is not aligned properly, we'd like to take the signal cleanly
+ 	 * and report that.
+ 	 */
+-	sp &= ~7UL;
++	sp &= ~15UL;
+ 
+-	return (void __user *)(sp - framesize);
++	return (void __user *) sp;
+ }
+ 
+ static inline void
+diff --git a/arch/sparc/kernel/tsb.S b/arch/sparc/kernel/tsb.S
+index 8c91d9b..db15d12 100644
+--- a/arch/sparc/kernel/tsb.S
++++ b/arch/sparc/kernel/tsb.S
+@@ -191,10 +191,12 @@ tsb_dtlb_load:
+ 
+ tsb_itlb_load:
+ 	/* Executable bit must be set.  */
+-661:	andcc		%g5, _PAGE_EXEC_4U, %g0
+-	.section	.sun4v_1insn_patch, "ax"
++661:	sethi		%hi(_PAGE_EXEC_4U), %g4
++	andcc		%g5, %g4, %g0
++	.section	.sun4v_2insn_patch, "ax"
+ 	.word		661b
+ 	andcc		%g5, _PAGE_EXEC_4V, %g0
++	nop
+ 	.previous
+ 
+ 	be,pn		%xcc, tsb_do_fault
+diff --git a/arch/x86/ia32/ia32_aout.c b/arch/x86/ia32/ia32_aout.c
+index f9f4724..14531ab 100644
+--- a/arch/x86/ia32/ia32_aout.c
++++ b/arch/x86/ia32/ia32_aout.c
+@@ -327,7 +327,6 @@ static int load_aout_binary(struct linux_binprm *bprm, struct pt_regs *regs)
+ 	current->mm->free_area_cache = TASK_UNMAPPED_BASE;
+ 	current->mm->cached_hole_size = 0;
+ 
+-	current->mm->mmap = NULL;
+ 	install_exec_creds(bprm);
+ 	current->flags &= ~PF_FORKNOEXEC;
+ 
+diff --git a/arch/x86/include/asm/io_apic.h b/arch/x86/include/asm/io_apic.h
+index 7c7c16c..5f61f6e 100644
+--- a/arch/x86/include/asm/io_apic.h
++++ b/arch/x86/include/asm/io_apic.h
+@@ -160,6 +160,7 @@ extern int io_apic_get_redir_entries(int ioapic);
+ struct io_apic_irq_attr;
+ extern int io_apic_set_pci_routing(struct device *dev, int irq,
+ 		 struct io_apic_irq_attr *irq_attr);
++void setup_IO_APIC_irq_extra(u32 gsi);
+ extern int (*ioapic_renumber_irq)(int ioapic, int irq);
+ extern void ioapic_init_mappings(void);
+ extern void ioapic_insert_resources(void);
+diff --git a/arch/x86/include/asm/pgalloc.h b/arch/x86/include/asm/pgalloc.h
+index 0e8c2a0..271de94 100644
+--- a/arch/x86/include/asm/pgalloc.h
++++ b/arch/x86/include/asm/pgalloc.h
+@@ -23,6 +23,11 @@ static inline void paravirt_release_pud(unsigned long pfn) {}
+ #endif
+ 
+ /*
++ * Flags to use when allocating a user page table page.
++ */
++extern gfp_t __userpte_alloc_gfp;
++
++/*
+  * Allocate and free page tables.
+  */
+ extern pgd_t *pgd_alloc(struct mm_struct *);
+diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
+index 67e929b..195e4b7 100644
+--- a/arch/x86/kernel/acpi/boot.c
++++ b/arch/x86/kernel/acpi/boot.c
+@@ -446,6 +446,12 @@ void __init acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger)
+ int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
+ {
+ 	*irq = gsi;
++
++#ifdef CONFIG_X86_IO_APIC
++	if (acpi_irq_model == ACPI_IRQ_MODEL_IOAPIC)
++		setup_IO_APIC_irq_extra(gsi);
++#endif
++
+ 	return 0;
+ }
+ 
+@@ -473,7 +479,8 @@ int acpi_register_gsi(struct device *dev, u32 gsi, int trigger, int polarity)
+ 		plat_gsi = mp_register_gsi(dev, gsi, trigger, polarity);
+ 	}
+ #endif
+-	acpi_gsi_to_irq(plat_gsi, &irq);
++	irq = plat_gsi;
++
+ 	return irq;
+ }
+ 
+@@ -1348,14 +1355,6 @@ static struct dmi_system_id __initdata acpi_dmi_table[] = {
+ 	 },
+ 	{
+ 	 .callback = force_acpi_ht,
+-	 .ident = "ASUS P2B-DS",
+-	 .matches = {
+-		     DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
+-		     DMI_MATCH(DMI_BOARD_NAME, "P2B-DS"),
+-		     },
+-	 },
+-	{
+-	 .callback = force_acpi_ht,
+ 	 .ident = "ASUS CUR-DLS",
+ 	 .matches = {
+ 		     DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
+diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
+index c107e83..dc4f486 100644
+--- a/arch/x86/kernel/apic/io_apic.c
++++ b/arch/x86/kernel/apic/io_apic.c
+@@ -1550,6 +1550,56 @@ static void __init setup_IO_APIC_irqs(void)
+ }
+ 
+ /*
++ * for the gsit that is not in first ioapic
++ * but could not use acpi_register_gsi()
++ * like some special sci in IBM x3330
++ */
++void setup_IO_APIC_irq_extra(u32 gsi)
++{
++	int apic_id = 0, pin, idx, irq;
++	int node = cpu_to_node(boot_cpu_id);
++	struct irq_desc *desc;
++	struct irq_cfg *cfg;
++
++	/*
++	 * Convert 'gsi' to 'ioapic.pin'.
++	 */
++	apic_id = mp_find_ioapic(gsi);
++	if (apic_id < 0)
++		return;
++
++	pin = mp_find_ioapic_pin(apic_id, gsi);
++	idx = find_irq_entry(apic_id, pin, mp_INT);
++	if (idx == -1)
++		return;
++
++	irq = pin_2_irq(idx, apic_id, pin);
++#ifdef CONFIG_SPARSE_IRQ
++	desc = irq_to_desc(irq);
++	if (desc)
++		return;
++#endif
++	desc = irq_to_desc_alloc_node(irq, node);
++	if (!desc) {
++		printk(KERN_INFO "can not get irq_desc for %d\n", irq);
++		return;
++	}
++
++	cfg = desc->chip_data;
++	add_pin_to_irq_node(cfg, node, apic_id, pin);
++
++	if (test_bit(pin, mp_ioapic_routing[apic_id].pin_programmed)) {
++		pr_debug("Pin %d-%d already programmed\n",
++			 mp_ioapics[apic_id].apicid, pin);
++		return;
++	}
++	set_bit(pin, mp_ioapic_routing[apic_id].pin_programmed);
++
++	setup_IO_APIC_irq(apic_id, pin, irq, desc,
++			irq_trigger(idx), irq_polarity(idx));
++}
++
++/*
+  * Set up the timer pin, possibly with the 8259A-master behind.
+  */
+ static void __init setup_timer_IRQ0_pin(unsigned int apic_id, unsigned int pin,
+@@ -3165,12 +3215,9 @@ unsigned int create_irq_nr(unsigned int irq_want, int node)
+ 	}
+ 	spin_unlock_irqrestore(&vector_lock, flags);
+ 
+-	if (irq > 0) {
+-		dynamic_irq_init(irq);
+-		/* restore it, in case dynamic_irq_init clear it */
+-		if (desc_new)
+-			desc_new->chip_data = cfg_new;
+-	}
++	if (irq > 0)
++		dynamic_irq_init_keep_chip_data(irq);
++
+ 	return irq;
+ }
+ 
+@@ -3193,17 +3240,12 @@ void destroy_irq(unsigned int irq)
+ {
+ 	unsigned long flags;
+ 	struct irq_cfg *cfg;
+-	struct irq_desc *desc;
+ 
+-	/* store it, in case dynamic_irq_cleanup clear it */
+-	desc = irq_to_desc(irq);
+-	cfg = desc->chip_data;
+-	dynamic_irq_cleanup(irq);
+-	/* connect back irq_cfg */
+-	desc->chip_data = cfg;
++	dynamic_irq_cleanup_keep_chip_data(irq);
+ 
+ 	free_irte(irq);
+ 	spin_lock_irqsave(&vector_lock, flags);
++	cfg = irq_to_desc(irq)->chip_data;
+ 	__clear_irq_vector(irq, cfg);
+ 	spin_unlock_irqrestore(&vector_lock, flags);
+ }
+diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
+index bff34d6..269c2a3 100644
+--- a/arch/x86/kernel/reboot.c
++++ b/arch/x86/kernel/reboot.c
+@@ -461,6 +461,14 @@ static struct dmi_system_id __initdata pci_reboot_dmi_table[] = {
+ 			DMI_MATCH(DMI_PRODUCT_NAME, "Macmini3,1"),
+ 		},
+ 	},
++	{	/* Handle problems with rebooting on the iMac9,1. */
++		.callback = set_pci_reboot,
++		.ident = "Apple iMac9,1",
++		.matches = {
++			DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
++			DMI_MATCH(DMI_PRODUCT_NAME, "iMac9,1"),
++		},
++	},
+ 	{ }
+ };
+ 
+diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
+index e02dbb6..7371e65 100644
+--- a/arch/x86/kvm/emulate.c
++++ b/arch/x86/kvm/emulate.c
+@@ -75,6 +75,7 @@
+ #define Group       (1<<14)     /* Bits 3:5 of modrm byte extend opcode */
+ #define GroupDual   (1<<15)     /* Alternate decoding of mod == 3 */
+ #define GroupMask   0xff        /* Group number stored in bits 0:7 */
++#define Priv        (1<<27) /* instruction generates #GP if current CPL != 0 */
+ /* Source 2 operand type */
+ #define Src2None    (0<<29)
+ #define Src2CL      (1<<29)
+@@ -86,6 +87,7 @@
+ enum {
+ 	Group1_80, Group1_81, Group1_82, Group1_83,
+ 	Group1A, Group3_Byte, Group3, Group4, Group5, Group7,
++	Group8, Group9,
+ };
+ 
+ static u32 opcode_table[256] = {
+@@ -203,7 +205,7 @@ static u32 opcode_table[256] = {
+ 	SrcNone | ByteOp | ImplicitOps, SrcNone | ImplicitOps,
+ 	/* 0xF0 - 0xF7 */
+ 	0, 0, 0, 0,
+-	ImplicitOps, ImplicitOps, Group | Group3_Byte, Group | Group3,
++	ImplicitOps | Priv, ImplicitOps, Group | Group3_Byte, Group | Group3,
+ 	/* 0xF8 - 0xFF */
+ 	ImplicitOps, 0, ImplicitOps, ImplicitOps,
+ 	ImplicitOps, ImplicitOps, Group | Group4, Group | Group5,
+@@ -211,16 +213,20 @@ static u32 opcode_table[256] = {
+ 
+ static u32 twobyte_table[256] = {
+ 	/* 0x00 - 0x0F */
+-	0, Group | GroupDual | Group7, 0, 0, 0, ImplicitOps, ImplicitOps, 0,
+-	ImplicitOps, ImplicitOps, 0, 0, 0, ImplicitOps | ModRM, 0, 0,
++	0, Group | GroupDual | Group7, 0, 0,
++	0, ImplicitOps, ImplicitOps | Priv, 0,
++	ImplicitOps | Priv, ImplicitOps | Priv, 0, 0,
++	0, ImplicitOps | ModRM, 0, 0,
+ 	/* 0x10 - 0x1F */
+ 	0, 0, 0, 0, 0, 0, 0, 0, ImplicitOps | ModRM, 0, 0, 0, 0, 0, 0, 0,
+ 	/* 0x20 - 0x2F */
+-	ModRM | ImplicitOps, ModRM, ModRM | ImplicitOps, ModRM, 0, 0, 0, 0,
++	ModRM | ImplicitOps | Priv, ModRM | Priv,
++	ModRM | ImplicitOps | Priv, ModRM | Priv,
++	0, 0, 0, 0,
+ 	0, 0, 0, 0, 0, 0, 0, 0,
+ 	/* 0x30 - 0x3F */
+-	ImplicitOps, 0, ImplicitOps, 0,
+-	ImplicitOps, ImplicitOps, 0, 0,
++	ImplicitOps | Priv, 0, ImplicitOps | Priv, 0,
++	ImplicitOps, ImplicitOps | Priv, 0, 0,
+ 	0, 0, 0, 0, 0, 0, 0, 0,
+ 	/* 0x40 - 0x47 */
+ 	DstReg | SrcMem | ModRM | Mov, DstReg | SrcMem | ModRM | Mov,
+@@ -258,11 +264,12 @@ static u32 twobyte_table[256] = {
+ 	0, 0, ByteOp | DstReg | SrcMem | ModRM | Mov,
+ 	    DstReg | SrcMem16 | ModRM | Mov,
+ 	/* 0xB8 - 0xBF */
+-	0, 0, DstMem | SrcImmByte | ModRM, DstMem | SrcReg | ModRM | BitOp,
++	0, 0, Group | Group8, DstMem | SrcReg | ModRM | BitOp,
+ 	0, 0, ByteOp | DstReg | SrcMem | ModRM | Mov,
+ 	    DstReg | SrcMem16 | ModRM | Mov,
+ 	/* 0xC0 - 0xCF */
+-	0, 0, 0, DstMem | SrcReg | ModRM | Mov, 0, 0, 0, ImplicitOps | ModRM,
++	0, 0, 0, DstMem | SrcReg | ModRM | Mov,
++	0, 0, 0, Group | GroupDual | Group9,
+ 	0, 0, 0, 0, 0, 0, 0, 0,
+ 	/* 0xD0 - 0xDF */
+ 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+@@ -311,16 +318,24 @@ static u32 group_table[] = {
+ 	SrcMem | ModRM | Stack, 0,
+ 	SrcMem | ModRM | Stack, 0, SrcMem | ModRM | Stack, 0,
+ 	[Group7*8] =
+-	0, 0, ModRM | SrcMem, ModRM | SrcMem,
++	0, 0, ModRM | SrcMem | Priv, ModRM | SrcMem | Priv,
+ 	SrcNone | ModRM | DstMem | Mov, 0,
+-	SrcMem16 | ModRM | Mov, SrcMem | ModRM | ByteOp,
++	SrcMem16 | ModRM | Mov | Priv, SrcMem | ModRM | ByteOp | Priv,
++	[Group8*8] =
++	0, 0, 0, 0,
++	DstMem | SrcImmByte | ModRM, DstMem | SrcImmByte | ModRM,
++	DstMem | SrcImmByte | ModRM, DstMem | SrcImmByte | ModRM,
++	[Group9*8] =
++	0, ImplicitOps | ModRM, 0, 0, 0, 0, 0, 0,
+ };
+ 
+ static u32 group2_table[] = {
+ 	[Group7*8] =
+-	SrcNone | ModRM, 0, 0, SrcNone | ModRM,
++	SrcNone | ModRM | Priv, 0, 0, SrcNone | ModRM,
+ 	SrcNone | ModRM | DstMem | Mov, 0,
+ 	SrcMem16 | ModRM | Mov, 0,
++	[Group9*8] =
++	0, 0, 0, 0, 0, 0, 0, 0,
+ };
+ 
+ /* EFLAGS bit definitions. */
+@@ -1563,12 +1578,6 @@ emulate_sysexit(struct x86_emulate_ctxt *ctxt)
+ 		return -1;
+ 	}
+ 
+-	/* sysexit must be called from CPL 0 */
+-	if (kvm_x86_ops->get_cpl(ctxt->vcpu) != 0) {
+-		kvm_inject_gp(ctxt->vcpu, 0);
+-		return -1;
+-	}
+-
+ 	setup_syscalls_segments(ctxt, &cs, &ss);
+ 
+ 	if ((c->rex_prefix & 0x8) != 0x0)
+@@ -1632,6 +1641,12 @@ x86_emulate_insn(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops)
+ 	memcpy(c->regs, ctxt->vcpu->arch.regs, sizeof c->regs);
+ 	saved_eip = c->eip;
+ 
++	/* Privileged instruction can be executed only in CPL=0 */
++	if ((c->d & Priv) && kvm_x86_ops->get_cpl(ctxt->vcpu)) {
++		kvm_inject_gp(ctxt->vcpu, 0);
++		goto done;
++	}
++
+ 	if (((c->d & ModRM) && (c->modrm_mod != 3)) || (c->d & MemAbs))
+ 		memop = c->modrm_ea;
+ 
+@@ -1870,6 +1885,12 @@ special_insn:
+ 		int err;
+ 
+ 		sel = c->src.val;
++
++		if (c->modrm_reg == VCPU_SREG_CS) {
++			kvm_queue_exception(ctxt->vcpu, UD_VECTOR);
++			goto done;
++		}
++
+ 		if (c->modrm_reg == VCPU_SREG_SS)
+ 			toggle_interruptibility(ctxt, X86_SHADOW_INT_MOV_SS);
+ 
+diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c
+index ed34f5e..c9ba9de 100644
+--- a/arch/x86/mm/pgtable.c
++++ b/arch/x86/mm/pgtable.c
+@@ -6,6 +6,14 @@
+ 
+ #define PGALLOC_GFP GFP_KERNEL | __GFP_NOTRACK | __GFP_REPEAT | __GFP_ZERO
+ 
++#ifdef CONFIG_HIGHPTE
++#define PGALLOC_USER_GFP __GFP_HIGHMEM
++#else
++#define PGALLOC_USER_GFP 0
++#endif
++
++gfp_t __userpte_alloc_gfp = PGALLOC_GFP | PGALLOC_USER_GFP;
++
+ pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
+ {
+ 	return (pte_t *)__get_free_page(PGALLOC_GFP);
+@@ -15,16 +23,29 @@ pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long address)
+ {
+ 	struct page *pte;
+ 
+-#ifdef CONFIG_HIGHPTE
+-	pte = alloc_pages(PGALLOC_GFP | __GFP_HIGHMEM, 0);
+-#else
+-	pte = alloc_pages(PGALLOC_GFP, 0);
+-#endif
++	pte = alloc_pages(__userpte_alloc_gfp, 0);
+ 	if (pte)
+ 		pgtable_page_ctor(pte);
+ 	return pte;
+ }
+ 
++static int __init setup_userpte(char *arg)
++{
++	if (!arg)
++		return -EINVAL;
++
++	/*
++	 * "userpte=nohigh" disables allocation of user pagetables in
++	 * high memory.
++	 */
++	if (strcmp(arg, "nohigh") == 0)
++		__userpte_alloc_gfp &= ~__GFP_HIGHMEM;
++	else
++		return -EINVAL;
++	return 0;
++}
++early_param("userpte", setup_userpte);
++
+ void ___pte_free_tlb(struct mmu_gather *tlb, struct page *pte)
+ {
+ 	pgtable_page_dtor(pte);
+diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c
+index 3347f69..2c505ee 100644
+--- a/arch/x86/oprofile/nmi_int.c
++++ b/arch/x86/oprofile/nmi_int.c
+@@ -159,7 +159,7 @@ static int nmi_setup_mux(void)
+ 
+ 	for_each_possible_cpu(i) {
+ 		per_cpu(cpu_msrs, i).multiplex =
+-			kmalloc(multiplex_size, GFP_KERNEL);
++			kzalloc(multiplex_size, GFP_KERNEL);
+ 		if (!per_cpu(cpu_msrs, i).multiplex)
+ 			return 0;
+ 	}
+@@ -179,7 +179,6 @@ static void nmi_cpu_setup_mux(int cpu, struct op_msrs const * const msrs)
+ 		if (counter_config[i].enabled) {
+ 			multiplex[i].saved = -(u64)counter_config[i].count;
+ 		} else {
+-			multiplex[i].addr  = 0;
+ 			multiplex[i].saved = 0;
+ 		}
+ 	}
+@@ -189,25 +188,27 @@ static void nmi_cpu_setup_mux(int cpu, struct op_msrs const * const msrs)
+ 
+ static void nmi_cpu_save_mpx_registers(struct op_msrs *msrs)
+ {
++	struct op_msr *counters = msrs->counters;
+ 	struct op_msr *multiplex = msrs->multiplex;
+ 	int i;
+ 
+ 	for (i = 0; i < model->num_counters; ++i) {
+ 		int virt = op_x86_phys_to_virt(i);
+-		if (multiplex[virt].addr)
+-			rdmsrl(multiplex[virt].addr, multiplex[virt].saved);
++		if (counters[i].addr)
++			rdmsrl(counters[i].addr, multiplex[virt].saved);
+ 	}
+ }
+ 
+ static void nmi_cpu_restore_mpx_registers(struct op_msrs *msrs)
+ {
++	struct op_msr *counters = msrs->counters;
+ 	struct op_msr *multiplex = msrs->multiplex;
+ 	int i;
+ 
+ 	for (i = 0; i < model->num_counters; ++i) {
+ 		int virt = op_x86_phys_to_virt(i);
+-		if (multiplex[virt].addr)
+-			wrmsrl(multiplex[virt].addr, multiplex[virt].saved);
++		if (counters[i].addr)
++			wrmsrl(counters[i].addr, multiplex[virt].saved);
+ 	}
+ }
+ 
+@@ -303,11 +304,11 @@ static int allocate_msrs(void)
+ 
+ 	int i;
+ 	for_each_possible_cpu(i) {
+-		per_cpu(cpu_msrs, i).counters = kmalloc(counters_size,
++		per_cpu(cpu_msrs, i).counters = kzalloc(counters_size,
+ 							GFP_KERNEL);
+ 		if (!per_cpu(cpu_msrs, i).counters)
+ 			return 0;
+-		per_cpu(cpu_msrs, i).controls = kmalloc(controls_size,
++		per_cpu(cpu_msrs, i).controls = kzalloc(controls_size,
+ 							GFP_KERNEL);
+ 		if (!per_cpu(cpu_msrs, i).controls)
+ 			return 0;
+diff --git a/arch/x86/oprofile/op_model_amd.c b/arch/x86/oprofile/op_model_amd.c
+index 39686c2..1ed963d 100644
+--- a/arch/x86/oprofile/op_model_amd.c
++++ b/arch/x86/oprofile/op_model_amd.c
+@@ -76,19 +76,6 @@ static struct op_ibs_config ibs_config;
+ 
+ #ifdef CONFIG_OPROFILE_EVENT_MULTIPLEX
+ 
+-static void op_mux_fill_in_addresses(struct op_msrs * const msrs)
+-{
+-	int i;
+-
+-	for (i = 0; i < NUM_VIRT_COUNTERS; i++) {
+-		int hw_counter = op_x86_virt_to_phys(i);
+-		if (reserve_perfctr_nmi(MSR_K7_PERFCTR0 + i))
+-			msrs->multiplex[i].addr = MSR_K7_PERFCTR0 + hw_counter;
+-		else
+-			msrs->multiplex[i].addr = 0;
+-	}
+-}
+-
+ static void op_mux_switch_ctrl(struct op_x86_model_spec const *model,
+ 			       struct op_msrs const * const msrs)
+ {
+@@ -98,7 +85,7 @@ static void op_mux_switch_ctrl(struct op_x86_model_spec const *model,
+ 	/* enable active counters */
+ 	for (i = 0; i < NUM_COUNTERS; ++i) {
+ 		int virt = op_x86_phys_to_virt(i);
+-		if (!counter_config[virt].enabled)
++		if (!reset_value[virt])
+ 			continue;
+ 		rdmsrl(msrs->controls[i].addr, val);
+ 		val &= model->reserved;
+@@ -107,10 +94,6 @@ static void op_mux_switch_ctrl(struct op_x86_model_spec const *model,
+ 	}
+ }
+ 
+-#else
+-
+-static inline void op_mux_fill_in_addresses(struct op_msrs * const msrs) { }
+-
+ #endif
+ 
+ /* functions for op_amd_spec */
+@@ -122,18 +105,12 @@ static void op_amd_fill_in_addresses(struct op_msrs * const msrs)
+ 	for (i = 0; i < NUM_COUNTERS; i++) {
+ 		if (reserve_perfctr_nmi(MSR_K7_PERFCTR0 + i))
+ 			msrs->counters[i].addr = MSR_K7_PERFCTR0 + i;
+-		else
+-			msrs->counters[i].addr = 0;
+ 	}
+ 
+ 	for (i = 0; i < NUM_CONTROLS; i++) {
+ 		if (reserve_evntsel_nmi(MSR_K7_EVNTSEL0 + i))
+ 			msrs->controls[i].addr = MSR_K7_EVNTSEL0 + i;
+-		else
+-			msrs->controls[i].addr = 0;
+ 	}
+-
+-	op_mux_fill_in_addresses(msrs);
+ }
+ 
+ static void op_amd_setup_ctrs(struct op_x86_model_spec const *model,
+@@ -144,7 +121,8 @@ static void op_amd_setup_ctrs(struct op_x86_model_spec const *model,
+ 
+ 	/* setup reset_value */
+ 	for (i = 0; i < NUM_VIRT_COUNTERS; ++i) {
+-		if (counter_config[i].enabled)
++		if (counter_config[i].enabled
++		    && msrs->counters[op_x86_virt_to_phys(i)].addr)
+ 			reset_value[i] = counter_config[i].count;
+ 		else
+ 			reset_value[i] = 0;
+@@ -169,9 +147,7 @@ static void op_amd_setup_ctrs(struct op_x86_model_spec const *model,
+ 	/* enable active counters */
+ 	for (i = 0; i < NUM_COUNTERS; ++i) {
+ 		int virt = op_x86_phys_to_virt(i);
+-		if (!counter_config[virt].enabled)
+-			continue;
+-		if (!msrs->counters[i].addr)
++		if (!reset_value[virt])
+ 			continue;
+ 
+ 		/* setup counter registers */
+@@ -405,16 +381,6 @@ static int init_ibs_nmi(void)
+ 		return 1;
+ 	}
+ 
+-#ifdef CONFIG_NUMA
+-	/* Sanity check */
+-	/* Works only for 64bit with proper numa implementation. */
+-	if (nodes != num_possible_nodes()) {
+-		printk(KERN_DEBUG "Failed to setup CPU node(s) for IBS, "
+-			"found: %d, expected %d",
+-			nodes, num_possible_nodes());
+-		return 1;
+-	}
+-#endif
+ 	return 0;
+ }
+ 
+diff --git a/arch/x86/oprofile/op_model_p4.c b/arch/x86/oprofile/op_model_p4.c
+index ac6b354..e6a160a 100644
+--- a/arch/x86/oprofile/op_model_p4.c
++++ b/arch/x86/oprofile/op_model_p4.c
+@@ -394,12 +394,6 @@ static void p4_fill_in_addresses(struct op_msrs * const msrs)
+ 	setup_num_counters();
+ 	stag = get_stagger();
+ 
+-	/* initialize some registers */
+-	for (i = 0; i < num_counters; ++i)
+-		msrs->counters[i].addr = 0;
+-	for (i = 0; i < num_controls; ++i)
+-		msrs->controls[i].addr = 0;
+-
+ 	/* the counter & cccr registers we pay attention to */
+ 	for (i = 0; i < num_counters; ++i) {
+ 		addr = p4_counters[VIRT_CTR(stag, i)].counter_address;
+diff --git a/arch/x86/oprofile/op_model_ppro.c b/arch/x86/oprofile/op_model_ppro.c
+index 8eb0587..2873c00 100644
+--- a/arch/x86/oprofile/op_model_ppro.c
++++ b/arch/x86/oprofile/op_model_ppro.c
+@@ -37,15 +37,11 @@ static void ppro_fill_in_addresses(struct op_msrs * const msrs)
+ 	for (i = 0; i < num_counters; i++) {
+ 		if (reserve_perfctr_nmi(MSR_P6_PERFCTR0 + i))
+ 			msrs->counters[i].addr = MSR_P6_PERFCTR0 + i;
+-		else
+-			msrs->counters[i].addr = 0;
+ 	}
+ 
+ 	for (i = 0; i < num_counters; i++) {
+ 		if (reserve_evntsel_nmi(MSR_P6_EVNTSEL0 + i))
+ 			msrs->controls[i].addr = MSR_P6_EVNTSEL0 + i;
+-		else
+-			msrs->controls[i].addr = 0;
+ 	}
+ }
+ 
+@@ -57,7 +53,7 @@ static void ppro_setup_ctrs(struct op_x86_model_spec const *model,
+ 	int i;
+ 
+ 	if (!reset_value) {
+-		reset_value = kmalloc(sizeof(reset_value[0]) * num_counters,
++		reset_value = kzalloc(sizeof(reset_value[0]) * num_counters,
+ 					GFP_ATOMIC);
+ 		if (!reset_value)
+ 			return;
+diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
+index 79f9738..3578688 100644
+--- a/arch/x86/xen/enlighten.c
++++ b/arch/x86/xen/enlighten.c
+@@ -48,6 +48,7 @@
+ #include <asm/traps.h>
+ #include <asm/setup.h>
+ #include <asm/desc.h>
++#include <asm/pgalloc.h>
+ #include <asm/pgtable.h>
+ #include <asm/tlbflush.h>
+ #include <asm/reboot.h>
+@@ -1092,6 +1093,12 @@ asmlinkage void __init xen_start_kernel(void)
+ 
+ 	__supported_pte_mask |= _PAGE_IOMAP;
+ 
++	/*
++	 * Prevent page tables from being allocated in highmem, even
++	 * if CONFIG_HIGHPTE is enabled.
++	 */
++	__userpte_alloc_gfp &= ~__GFP_HIGHMEM;
++
+ #ifdef CONFIG_X86_64
+ 	/* Work out if we support NX */
+ 	check_efer();
+diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
+index bf4cd6b..350a3de 100644
+--- a/arch/x86/xen/mmu.c
++++ b/arch/x86/xen/mmu.c
+@@ -1432,14 +1432,15 @@ static void *xen_kmap_atomic_pte(struct page *page, enum km_type type)
+ {
+ 	pgprot_t prot = PAGE_KERNEL;
+ 
++	/*
++	 * We disable highmem allocations for page tables so we should never
++	 * see any calls to kmap_atomic_pte on a highmem page.
++	 */
++	BUG_ON(PageHighMem(page));
++
+ 	if (PagePinned(page))
+ 		prot = PAGE_KERNEL_RO;
+ 
+-	if (0 && PageHighMem(page))
+-		printk("mapping highpte %lx type %d prot %s\n",
+-		       page_to_pfn(page), type,
+-		       (unsigned long)pgprot_val(prot) & _PAGE_RW ? "WRITE" : "READ");
+-
+ 	return kmap_atomic_prot(page, type, prot);
+ }
+ #endif
+diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
+index d9f78f6..c8f0797 100644
+--- a/drivers/acpi/processor_idle.c
++++ b/drivers/acpi/processor_idle.c
+@@ -888,12 +888,14 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
+ 		return(acpi_idle_enter_c1(dev, state));
+ 
+ 	local_irq_disable();
+-	current_thread_info()->status &= ~TS_POLLING;
+-	/*
+-	 * TS_POLLING-cleared state must be visible before we test
+-	 * NEED_RESCHED:
+-	 */
+-	smp_mb();
++	if (cx->entry_method != ACPI_CSTATE_FFH) {
++		current_thread_info()->status &= ~TS_POLLING;
++		/*
++		 * TS_POLLING-cleared state must be visible before we test
++		 * NEED_RESCHED:
++		 */
++		smp_mb();
++	}
+ 
+ 	if (unlikely(need_resched())) {
+ 		current_thread_info()->status |= TS_POLLING;
+@@ -973,12 +975,14 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
+ 	}
+ 
+ 	local_irq_disable();
+-	current_thread_info()->status &= ~TS_POLLING;
+-	/*
+-	 * TS_POLLING-cleared state must be visible before we test
+-	 * NEED_RESCHED:
+-	 */
+-	smp_mb();
++	if (cx->entry_method != ACPI_CSTATE_FFH) {
++		current_thread_info()->status &= ~TS_POLLING;
++		/*
++		 * TS_POLLING-cleared state must be visible before we test
++		 * NEED_RESCHED:
++		 */
++		smp_mb();
++	}
+ 
+ 	if (unlikely(need_resched())) {
+ 		current_thread_info()->status |= TS_POLLING;
+diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c
+index f336bca..8a0ed28 100644
+--- a/drivers/acpi/tables.c
++++ b/drivers/acpi/tables.c
+@@ -213,7 +213,7 @@ acpi_table_parse_entries(char *id,
+ 	unsigned long table_end;
+ 	acpi_size tbl_size;
+ 
+-	if (acpi_disabled)
++	if (acpi_disabled && !acpi_ht)
+ 		return -ENODEV;
+ 
+ 	if (!handler)
+@@ -280,7 +280,7 @@ int __init acpi_table_parse(char *id, acpi_table_handler handler)
+ 	struct acpi_table_header *table = NULL;
+ 	acpi_size tbl_size;
+ 
+-	if (acpi_disabled)
++	if (acpi_disabled && !acpi_ht)
+ 		return -ENODEV;
+ 
+ 	if (!handler)
+diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
+index 9b37502..a587046 100644
+--- a/drivers/ata/ahci.c
++++ b/drivers/ata/ahci.c
+@@ -3074,8 +3074,16 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+ 	ahci_save_initial_config(pdev, hpriv);
+ 
+ 	/* prepare host */
+-	if (hpriv->cap & HOST_CAP_NCQ)
+-		pi.flags |= ATA_FLAG_NCQ | ATA_FLAG_FPDMA_AA;
++	if (hpriv->cap & HOST_CAP_NCQ) {
++		pi.flags |= ATA_FLAG_NCQ;
++		/* Auto-activate optimization is supposed to be supported on
++		   all AHCI controllers indicating NCQ support, but it seems
++		   to be broken at least on some NVIDIA MCP79 chipsets.
++		   Until we get info on which NVIDIA chipsets don't have this
++		   issue, if any, disable AA on all NVIDIA AHCIs. */
++		if (pdev->vendor != PCI_VENDOR_ID_NVIDIA)
++			pi.flags |= ATA_FLAG_FPDMA_AA;
++	}
+ 
+ 	if (hpriv->cap & HOST_CAP_PMP)
+ 		pi.flags |= ATA_FLAG_PMP;
+diff --git a/drivers/ata/pata_hpt3x2n.c b/drivers/ata/pata_hpt3x2n.c
+index d16e87e..d9f2913 100644
+--- a/drivers/ata/pata_hpt3x2n.c
++++ b/drivers/ata/pata_hpt3x2n.c
+@@ -25,7 +25,7 @@
+ #include <linux/libata.h>
+ 
+ #define DRV_NAME	"pata_hpt3x2n"
+-#define DRV_VERSION	"0.3.8"
++#define DRV_VERSION	"0.3.9"
+ 
+ enum {
+ 	HPT_PCI_FAST	=	(1 << 31),
+@@ -547,16 +547,16 @@ static int hpt3x2n_init_one(struct pci_dev *dev, const struct pci_device_id *id)
+ 	       pci_mhz);
+ 	/* Set our private data up. We only need a few flags so we use
+ 	   it directly */
+-	if (pci_mhz > 60) {
++	if (pci_mhz > 60)
+ 		hpriv = (void *)(PCI66 | USE_DPLL);
+-		/*
+-		 * On  HPT371N, if ATA clock is 66 MHz we must set bit 2 in
+-		 * the MISC. register to stretch the UltraDMA Tss timing.
+-		 * NOTE: This register is only writeable via I/O space.
+-		 */
+-		if (dev->device == PCI_DEVICE_ID_TTI_HPT371)
+-			outb(inb(iobase + 0x9c) | 0x04, iobase + 0x9c);
+-	}
++
++	/*
++	 * On  HPT371N, if ATA clock is 66 MHz we must set bit 2 in
++	 * the MISC. register to stretch the UltraDMA Tss timing.
++	 * NOTE: This register is only writeable via I/O space.
++	 */
++	if (dev->device == PCI_DEVICE_ID_TTI_HPT371)
++		outb(inb(iobase + 0x9c) | 0x04, iobase + 0x9c);
+ 
+ 	/* Now kick off ATA set up */
+ 	return ata_pci_sff_init_one(dev, ppi, &hpt3x2n_sht, hpriv);
+diff --git a/drivers/base/core.c b/drivers/base/core.c
+index 1093179..f33d768 100644
+--- a/drivers/base/core.c
++++ b/drivers/base/core.c
+@@ -603,6 +603,7 @@ static struct kobject *get_device_parent(struct device *dev,
+ 	int retval;
+ 
+ 	if (dev->class) {
++		static DEFINE_MUTEX(gdp_mutex);
+ 		struct kobject *kobj = NULL;
+ 		struct kobject *parent_kobj;
+ 		struct kobject *k;
+@@ -619,6 +620,8 @@ static struct kobject *get_device_parent(struct device *dev,
+ 		else
+ 			parent_kobj = &parent->kobj;
+ 
++		mutex_lock(&gdp_mutex);
++
+ 		/* find our class-directory at the parent and reference it */
+ 		spin_lock(&dev->class->p->class_dirs.list_lock);
+ 		list_for_each_entry(k, &dev->class->p->class_dirs.list, entry)
+@@ -627,20 +630,26 @@ static struct kobject *get_device_parent(struct device *dev,
+ 				break;
+ 			}
+ 		spin_unlock(&dev->class->p->class_dirs.list_lock);
+-		if (kobj)
++		if (kobj) {
++			mutex_unlock(&gdp_mutex);
+ 			return kobj;
++		}
+ 
+ 		/* or create a new class-directory at the parent device */
+ 		k = kobject_create();
+-		if (!k)
++		if (!k) {
++			mutex_unlock(&gdp_mutex);
+ 			return NULL;
++		}
+ 		k->kset = &dev->class->p->class_dirs;
+ 		retval = kobject_add(k, parent_kobj, "%s", dev->class->name);
+ 		if (retval < 0) {
++			mutex_unlock(&gdp_mutex);
+ 			kobject_put(k);
+ 			return NULL;
+ 		}
+ 		/* do not emit an uevent for this simple "glue" directory */
++		mutex_unlock(&gdp_mutex);
+ 		return k;
+ 	}
+ 
+diff --git a/drivers/base/devtmpfs.c b/drivers/base/devtmpfs.c
+index 33faaa2..4d80966 100644
+--- a/drivers/base/devtmpfs.c
++++ b/drivers/base/devtmpfs.c
+@@ -295,6 +295,19 @@ int devtmpfs_delete_node(struct device *dev)
+ 		if (dentry->d_inode) {
+ 			err = vfs_getattr(nd.path.mnt, dentry, &stat);
+ 			if (!err && dev_mynode(dev, dentry->d_inode, &stat)) {
++				struct iattr newattrs;
++				/*
++				 * before unlinking this node, reset permissions
++				 * of possible references like hardlinks
++				 */
++				newattrs.ia_uid = 0;
++				newattrs.ia_gid = 0;
++				newattrs.ia_mode = stat.mode & ~0777;
++				newattrs.ia_valid =
++					ATTR_UID|ATTR_GID|ATTR_MODE;
++				mutex_lock(&dentry->d_inode->i_mutex);
++				notify_change(dentry, &newattrs);
++				mutex_unlock(&dentry->d_inode->i_mutex);
+ 				err = vfs_unlink(nd.path.dentry->d_inode,
+ 						 dentry);
+ 				if (!err || err == -ENOENT)
+diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
+index 0b73e4e..27e8de4 100644
+--- a/drivers/char/tpm/tpm_tis.c
++++ b/drivers/char/tpm/tpm_tis.c
+@@ -257,6 +257,10 @@ out:
+ 	return size;
+ }
+ 
++static int itpm;
++module_param(itpm, bool, 0444);
++MODULE_PARM_DESC(itpm, "Force iTPM workarounds (found on some Lenovo laptops)");
++
+ /*
+  * If interrupts are used (signaled by an irq set in the vendor structure)
+  * tpm.c can skip polling for the data to be available as the interrupt is
+@@ -293,7 +297,7 @@ static int tpm_tis_send(struct tpm_chip *chip, u8 *buf, size_t len)
+ 		wait_for_stat(chip, TPM_STS_VALID, chip->vendor.timeout_c,
+ 			      &chip->vendor.int_queue);
+ 		status = tpm_tis_status(chip);
+-		if ((status & TPM_STS_DATA_EXPECT) == 0) {
++		if (!itpm && (status & TPM_STS_DATA_EXPECT) == 0) {
+ 			rc = -EIO;
+ 			goto out_err;
+ 		}
+@@ -467,6 +471,10 @@ static int tpm_tis_init(struct device *dev, resource_size_t start,
+ 		 "1.2 TPM (device-id 0x%X, rev-id %d)\n",
+ 		 vendor >> 16, ioread8(chip->vendor.iobase + TPM_RID(0)));
+ 
++	if (itpm)
++		dev_info(dev, "Intel iTPM workaround enabled\n");
++
++
+ 	/* Figure out the capabilities */
+ 	intfcaps =
+ 	    ioread32(chip->vendor.iobase +
+diff --git a/drivers/char/tty_ldisc.c b/drivers/char/tty_ldisc.c
+index feb5507..c6fbc27 100644
+--- a/drivers/char/tty_ldisc.c
++++ b/drivers/char/tty_ldisc.c
+@@ -687,12 +687,13 @@ static void tty_reset_termios(struct tty_struct *tty)
+ /**
+  *	tty_ldisc_reinit	-	reinitialise the tty ldisc
+  *	@tty: tty to reinit
++ *	@ldisc: line discipline to reinitialize
+  *
+- *	Switch the tty back to N_TTY line discipline and leave the
+- *	ldisc state closed
++ *	Switch the tty to a line discipline and leave the ldisc
++ *	state closed
+  */
+ 
+-static void tty_ldisc_reinit(struct tty_struct *tty)
++static void tty_ldisc_reinit(struct tty_struct *tty, int ldisc)
+ {
+ 	struct tty_ldisc *ld;
+ 
+@@ -702,10 +703,10 @@ static void tty_ldisc_reinit(struct tty_struct *tty)
+ 	/*
+ 	 *	Switch the line discipline back
+ 	 */
+-	ld = tty_ldisc_get(N_TTY);
++	ld = tty_ldisc_get(ldisc);
+ 	BUG_ON(IS_ERR(ld));
+ 	tty_ldisc_assign(tty, ld);
+-	tty_set_termios_ldisc(tty, N_TTY);
++	tty_set_termios_ldisc(tty, ldisc);
+ }
+ 
+ /**
+@@ -726,6 +727,8 @@ static void tty_ldisc_reinit(struct tty_struct *tty)
+ void tty_ldisc_hangup(struct tty_struct *tty)
+ {
+ 	struct tty_ldisc *ld;
++	int reset = tty->driver->flags & TTY_DRIVER_RESET_TERMIOS;
++	int err = 0;
+ 
+ 	/*
+ 	 * FIXME! What are the locking issues here? This may me overdoing
+@@ -753,25 +756,32 @@ void tty_ldisc_hangup(struct tty_struct *tty)
+ 	wake_up_interruptible_poll(&tty->read_wait, POLLIN);
+ 	/*
+ 	 * Shutdown the current line discipline, and reset it to
+-	 * N_TTY.
++	 * N_TTY if need be.
++	 *
++	 * Avoid racing set_ldisc or tty_ldisc_release
+ 	 */
+-	if (tty->driver->flags & TTY_DRIVER_RESET_TERMIOS) {
+-		/* Avoid racing set_ldisc or tty_ldisc_release */
+-		mutex_lock(&tty->ldisc_mutex);
+-		tty_ldisc_halt(tty);
+-		if (tty->ldisc) {	/* Not yet closed */
+-			/* Switch back to N_TTY */
+-			tty_ldisc_reinit(tty);
+-			/* At this point we have a closed ldisc and we want to
+-			   reopen it. We could defer this to the next open but
+-			   it means auditing a lot of other paths so this is
+-			   a FIXME */
++	mutex_lock(&tty->ldisc_mutex);
++	tty_ldisc_halt(tty);
++	/* At this point we have a closed ldisc and we want to
++	   reopen it. We could defer this to the next open but
++	   it means auditing a lot of other paths so this is
++	   a FIXME */
++	if (tty->ldisc) {	/* Not yet closed */
++		if (reset == 0) {
++			tty_ldisc_reinit(tty, tty->termios->c_line);
++			err = tty_ldisc_open(tty, tty->ldisc);
++		}
++		/* If the re-open fails or we reset then go to N_TTY. The
++		   N_TTY open cannot fail */
++		if (reset || err) {
++			tty_ldisc_reinit(tty, N_TTY);
+ 			WARN_ON(tty_ldisc_open(tty, tty->ldisc));
+-			tty_ldisc_enable(tty);
+ 		}
+-		mutex_unlock(&tty->ldisc_mutex);
+-		tty_reset_termios(tty);
++		tty_ldisc_enable(tty);
+ 	}
++	mutex_unlock(&tty->ldisc_mutex);
++	if (reset)
++		tty_reset_termios(tty);
+ }
+ 
+ /**
+diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c
+index 6b3e0c2..6fe4f77 100644
+--- a/drivers/clocksource/sh_cmt.c
++++ b/drivers/clocksource/sh_cmt.c
+@@ -603,18 +603,13 @@ static int sh_cmt_setup(struct sh_cmt_priv *p, struct platform_device *pdev)
+ 	p->irqaction.handler = sh_cmt_interrupt;
+ 	p->irqaction.dev_id = p;
+ 	p->irqaction.flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL;
+-	ret = setup_irq(irq, &p->irqaction);
+-	if (ret) {
+-		pr_err("sh_cmt: failed to request irq %d\n", irq);
+-		goto err1;
+-	}
+ 
+ 	/* get hold of clock */
+ 	p->clk = clk_get(&p->pdev->dev, cfg->clk);
+ 	if (IS_ERR(p->clk)) {
+ 		pr_err("sh_cmt: cannot get clock \"%s\"\n", cfg->clk);
+ 		ret = PTR_ERR(p->clk);
+-		goto err2;
++		goto err1;
+ 	}
+ 
+ 	if (resource_size(res) == 6) {
+@@ -627,14 +622,25 @@ static int sh_cmt_setup(struct sh_cmt_priv *p, struct platform_device *pdev)
+ 		p->clear_bits = ~0xc000;
+ 	}
+ 
+-	return sh_cmt_register(p, cfg->name,
+-			       cfg->clockevent_rating,
+-			       cfg->clocksource_rating);
+- err2:
+-	remove_irq(irq, &p->irqaction);
+- err1:
++	ret = sh_cmt_register(p, cfg->name,
++			      cfg->clockevent_rating,
++			      cfg->clocksource_rating);
++	if (ret) {
++		pr_err("sh_cmt: registration failed\n");
++		goto err1;
++	}
++
++	ret = setup_irq(irq, &p->irqaction);
++	if (ret) {
++		pr_err("sh_cmt: failed to request irq %d\n", irq);
++		goto err1;
++	}
++
++	return 0;
++
++err1:
+ 	iounmap(p->mapbase);
+- err0:
++err0:
+ 	return ret;
+ }
+ 
+diff --git a/drivers/clocksource/sh_mtu2.c b/drivers/clocksource/sh_mtu2.c
+index 973e714..4c8a759 100644
+--- a/drivers/clocksource/sh_mtu2.c
++++ b/drivers/clocksource/sh_mtu2.c
+@@ -221,15 +221,15 @@ static void sh_mtu2_register_clockevent(struct sh_mtu2_priv *p,
+ 	ced->cpumask = cpumask_of(0);
+ 	ced->set_mode = sh_mtu2_clock_event_mode;
+ 
++	pr_info("sh_mtu2: %s used for clock events\n", ced->name);
++	clockevents_register_device(ced);
++
+ 	ret = setup_irq(p->irqaction.irq, &p->irqaction);
+ 	if (ret) {
+ 		pr_err("sh_mtu2: failed to request irq %d\n",
+ 		       p->irqaction.irq);
+ 		return;
+ 	}
+-
+-	pr_info("sh_mtu2: %s used for clock events\n", ced->name);
+-	clockevents_register_device(ced);
+ }
+ 
+ static int sh_mtu2_register(struct sh_mtu2_priv *p, char *name,
+diff --git a/drivers/clocksource/sh_tmu.c b/drivers/clocksource/sh_tmu.c
+index 93c2322..961f5b5 100644
+--- a/drivers/clocksource/sh_tmu.c
++++ b/drivers/clocksource/sh_tmu.c
+@@ -323,15 +323,15 @@ static void sh_tmu_register_clockevent(struct sh_tmu_priv *p,
+ 	ced->set_next_event = sh_tmu_clock_event_next;
+ 	ced->set_mode = sh_tmu_clock_event_mode;
+ 
++	pr_info("sh_tmu: %s used for clock events\n", ced->name);
++	clockevents_register_device(ced);
++
+ 	ret = setup_irq(p->irqaction.irq, &p->irqaction);
+ 	if (ret) {
+ 		pr_err("sh_tmu: failed to request irq %d\n",
+ 		       p->irqaction.irq);
+ 		return;
+ 	}
+-
+-	pr_info("sh_tmu: %s used for clock events\n", ced->name);
+-	clockevents_register_device(ced);
+ }
+ 
+ static int sh_tmu_register(struct sh_tmu_priv *p, char *name,
+diff --git a/drivers/gpio/wm831x-gpio.c b/drivers/gpio/wm831x-gpio.c
+index f9c09a5..9a27047 100644
+--- a/drivers/gpio/wm831x-gpio.c
++++ b/drivers/gpio/wm831x-gpio.c
+@@ -61,23 +61,31 @@ static int wm831x_gpio_get(struct gpio_chip *chip, unsigned offset)
+ 		return 0;
+ }
+ 
+-static int wm831x_gpio_direction_out(struct gpio_chip *chip,
+-				     unsigned offset, int value)
++static void wm831x_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
+ {
+ 	struct wm831x_gpio *wm831x_gpio = to_wm831x_gpio(chip);
+ 	struct wm831x *wm831x = wm831x_gpio->wm831x;
+ 
+-	return wm831x_set_bits(wm831x, WM831X_GPIO1_CONTROL + offset,
+-			       WM831X_GPN_DIR | WM831X_GPN_TRI, 0);
++	wm831x_set_bits(wm831x, WM831X_GPIO_LEVEL, 1 << offset,
++			value << offset);
+ }
+ 
+-static void wm831x_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
++static int wm831x_gpio_direction_out(struct gpio_chip *chip,
++				     unsigned offset, int value)
+ {
+ 	struct wm831x_gpio *wm831x_gpio = to_wm831x_gpio(chip);
+ 	struct wm831x *wm831x = wm831x_gpio->wm831x;
++	int ret;
+ 
+-	wm831x_set_bits(wm831x, WM831X_GPIO_LEVEL, 1 << offset,
+-			value << offset);
++	ret = wm831x_set_bits(wm831x, WM831X_GPIO1_CONTROL + offset,
++			      WM831X_GPN_DIR | WM831X_GPN_TRI, 0);
++	if (ret < 0)
++		return ret;
++
++	/* Can only set GPIO state once it's in output mode */
++	wm831x_gpio_set(chip, offset, value);
++
++	return 0;
+ }
+ 
+ #ifdef CONFIG_DEBUG_FS
+diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
+index b00a1aa..cce453e 100644
+--- a/drivers/gpu/drm/i915/intel_display.c
++++ b/drivers/gpu/drm/i915/intel_display.c
+@@ -4322,7 +4322,7 @@ static void intel_init_display(struct drm_device *dev)
+ 	}
+ 
+ 	/* Returns the core display clock speed */
+-	if (IS_I945G(dev))
++	if (IS_I945G(dev) || (IS_G33(dev) && ! IS_IGDGM(dev)))
+ 		dev_priv->display.get_display_clock_speed =
+ 			i945_get_display_clock_speed;
+ 	else if (IS_I915G(dev))
+diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
+index 952bb4e..a177b57 100644
+--- a/drivers/gpu/drm/i915/intel_lvds.c
++++ b/drivers/gpu/drm/i915/intel_lvds.c
+@@ -629,6 +629,13 @@ static const struct dmi_system_id bad_lid_status[] = {
+ 			DMI_MATCH(DMI_PRODUCT_NAME, "PC-81005"),
+ 		},
+ 	},
++	{
++		.ident = "Clevo M5x0N",
++		.matches = {
++			DMI_MATCH(DMI_SYS_VENDOR, "CLEVO Co."),
++			DMI_MATCH(DMI_BOARD_NAME, "M5x0N"),
++		},
++	},
+ 	{ }
+ };
+ 
+diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
+index 3f5aaf1..5d9c6a7 100644
+--- a/drivers/gpu/drm/i915/intel_sdvo.c
++++ b/drivers/gpu/drm/i915/intel_sdvo.c
+@@ -35,6 +35,7 @@
+ #include "i915_drm.h"
+ #include "i915_drv.h"
+ #include "intel_sdvo_regs.h"
++#include <linux/dmi.h>
+ 
+ #undef SDVO_DEBUG
+ 
+@@ -2289,6 +2290,25 @@ intel_sdvo_get_slave_addr(struct drm_device *dev, int output_device)
+ 		return 0x72;
+ }
+ 
++static int intel_sdvo_bad_tv_callback(const struct dmi_system_id *id)
++{
++	DRM_DEBUG_KMS("Ignoring bad SDVO TV connector for %s\n", id->ident);
++	return 1;
++}
++
++static struct dmi_system_id intel_sdvo_bad_tv[] = {
++	{
++		.callback = intel_sdvo_bad_tv_callback,
++		.ident = "IntelG45/ICH10R/DME1737",
++		.matches = {
++			DMI_MATCH(DMI_SYS_VENDOR, "IBM CORPORATION"),
++			DMI_MATCH(DMI_PRODUCT_NAME, "4800784"),
++		},
++	},
++
++	{ }	/* terminating entry */
++};
++
+ static bool
+ intel_sdvo_output_setup(struct intel_output *intel_output, uint16_t flags)
+ {
+@@ -2329,7 +2349,8 @@ intel_sdvo_output_setup(struct intel_output *intel_output, uint16_t flags)
+ 					(1 << INTEL_SDVO_NON_TV_CLONE_BIT) |
+ 					(1 << INTEL_ANALOG_CLONE_BIT);
+ 		}
+-	} else if (flags & SDVO_OUTPUT_SVID0) {
++	} else if ((flags & SDVO_OUTPUT_SVID0) &&
++		   !dmi_check_system(intel_sdvo_bad_tv)) {
+ 
+ 		sdvo_priv->controlled_output = SDVO_OUTPUT_SVID0;
+ 		encoder->encoder_type = DRM_MODE_ENCODER_TVDAC;
+diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
+index ce026f0..5b28b4e 100644
+--- a/drivers/gpu/drm/i915/intel_tv.c
++++ b/drivers/gpu/drm/i915/intel_tv.c
+@@ -1801,8 +1801,6 @@ intel_tv_init(struct drm_device *dev)
+ 	drm_connector_attach_property(connector,
+ 				   dev->mode_config.tv_bottom_margin_property,
+ 				   tv_priv->margin[TV_MARGIN_BOTTOM]);
+-
+-	dev_priv->hotplug_supported_mask |= TV_HOTPLUG_INT_STATUS;
+ out:
+ 	drm_sysfs_connector_add(connector);
+ }
+diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
+index 278f646..7310473 100644
+--- a/drivers/gpu/drm/radeon/r600.c
++++ b/drivers/gpu/drm/radeon/r600.c
+@@ -1686,13 +1686,14 @@ int r600_init(struct radeon_device *rdev)
+ 	if (rdev->accel_working) {
+ 		r = radeon_ib_pool_init(rdev);
+ 		if (r) {
+-			DRM_ERROR("radeon: failled initializing IB pool (%d).\n", r);
+-			rdev->accel_working = false;
+-		}
+-		r = r600_ib_test(rdev);
+-		if (r) {
+-			DRM_ERROR("radeon: failled testing IB (%d).\n", r);
++			dev_err(rdev->dev, "IB initialization failed (%d).\n", r);
+ 			rdev->accel_working = false;
++		} else {
++			r = r600_ib_test(rdev);
++			if (r) {
++				dev_err(rdev->dev, "IB test failed (%d).\n", r);
++				rdev->accel_working = false;
++			}
+ 		}
+ 	}
+ 	return 0;
+diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c
+index 0d82076..838b88c 100644
+--- a/drivers/gpu/drm/radeon/r600_cs.c
++++ b/drivers/gpu/drm/radeon/r600_cs.c
+@@ -36,6 +36,10 @@ static int r600_cs_packet_next_reloc_nomm(struct radeon_cs_parser *p,
+ typedef int (*next_reloc_t)(struct radeon_cs_parser*, struct radeon_cs_reloc**);
+ static next_reloc_t r600_cs_packet_next_reloc = &r600_cs_packet_next_reloc_mm;
+ 
++struct r600_cs_track {
++	u32	cb_color0_base_last;
++};
++
+ /**
+  * r600_cs_packet_parse() - parse cp packet and point ib index to next packet
+  * @parser:	parser structure holding parsing context.
+@@ -177,6 +181,28 @@ static int r600_cs_packet_next_reloc_nomm(struct radeon_cs_parser *p,
+ }
+ 
+ /**
++ * r600_cs_packet_next_is_pkt3_nop() - test if next packet is packet3 nop for reloc
++ * @parser:		parser structure holding parsing context.
++ *
++ * Check next packet is relocation packet3, do bo validation and compute
++ * GPU offset using the provided start.
++ **/
++static inline int r600_cs_packet_next_is_pkt3_nop(struct radeon_cs_parser *p)
++{
++	struct radeon_cs_packet p3reloc;
++	int r;
++
++	r = r600_cs_packet_parse(p, &p3reloc, p->idx);
++	if (r) {
++		return 0;
++	}
++	if (p3reloc.type != PACKET_TYPE3 || p3reloc.opcode != PACKET3_NOP) {
++		return 0;
++	}
++	return 1;
++}
++
++/**
+  * r600_cs_packet_next_vline() - parse userspace VLINE packet
+  * @parser:		parser structure holding parsing context.
+  *
+@@ -337,6 +363,7 @@ static int r600_packet3_check(struct radeon_cs_parser *p,
+ 				struct radeon_cs_packet *pkt)
+ {
+ 	struct radeon_cs_reloc *reloc;
++	struct r600_cs_track *track;
+ 	volatile u32 *ib;
+ 	unsigned idx;
+ 	unsigned i;
+@@ -344,6 +371,7 @@ static int r600_packet3_check(struct radeon_cs_parser *p,
+ 	int r;
+ 	u32 idx_value;
+ 
++	track = (struct r600_cs_track *)p->track;
+ 	ib = p->ib->ptr;
+ 	idx = pkt->idx + 1;
+ 	idx_value = radeon_get_ib_value(p, idx);
+@@ -503,9 +531,60 @@ static int r600_packet3_check(struct radeon_cs_parser *p,
+ 		for (i = 0; i < pkt->count; i++) {
+ 			reg = start_reg + (4 * i);
+ 			switch (reg) {
++			/* This register were added late, there is userspace
++			 * which does provide relocation for those but set
++			 * 0 offset. In order to avoid breaking old userspace
++			 * we detect this and set address to point to last
++			 * CB_COLOR0_BASE, note that if userspace doesn't set
++			 * CB_COLOR0_BASE before this register we will report
++			 * error. Old userspace always set CB_COLOR0_BASE
++			 * before any of this.
++			 */
++			case R_0280E0_CB_COLOR0_FRAG:
++			case R_0280E4_CB_COLOR1_FRAG:
++			case R_0280E8_CB_COLOR2_FRAG:
++			case R_0280EC_CB_COLOR3_FRAG:
++			case R_0280F0_CB_COLOR4_FRAG:
++			case R_0280F4_CB_COLOR5_FRAG:
++			case R_0280F8_CB_COLOR6_FRAG:
++			case R_0280FC_CB_COLOR7_FRAG:
++			case R_0280C0_CB_COLOR0_TILE:
++			case R_0280C4_CB_COLOR1_TILE:
++			case R_0280C8_CB_COLOR2_TILE:
++			case R_0280CC_CB_COLOR3_TILE:
++			case R_0280D0_CB_COLOR4_TILE:
++			case R_0280D4_CB_COLOR5_TILE:
++			case R_0280D8_CB_COLOR6_TILE:
++			case R_0280DC_CB_COLOR7_TILE:
++				if (!r600_cs_packet_next_is_pkt3_nop(p)) {
++					if (!track->cb_color0_base_last) {
++						dev_err(p->dev, "Broken old userspace ? no cb_color0_base supplied before trying to write 0x%08X\n", reg);
++						return -EINVAL;
++					}
++					ib[idx+1+i] = track->cb_color0_base_last;
++					printk_once(KERN_WARNING "You have old & broken userspace "
++						"please consider updating mesa & xf86-video-ati\n");
++				} else {
++					r = r600_cs_packet_next_reloc(p, &reloc);
++					if (r) {
++						dev_err(p->dev, "bad SET_CONTEXT_REG 0x%04X\n", reg);
++						return -EINVAL;
++					}
++					ib[idx+1+i] += (u32)((reloc->lobj.gpu_offset >> 8) & 0xffffffff);
++				}
++				break;
+ 			case DB_DEPTH_BASE:
+ 			case DB_HTILE_DATA_BASE:
+ 			case CB_COLOR0_BASE:
++				r = r600_cs_packet_next_reloc(p, &reloc);
++				if (r) {
++					DRM_ERROR("bad SET_CONTEXT_REG "
++							"0x%04X\n", reg);
++					return -EINVAL;
++				}
++				ib[idx+1+i] += (u32)((reloc->lobj.gpu_offset >> 8) & 0xffffffff);
++				track->cb_color0_base_last = ib[idx+1+i];
++				break;
+ 			case CB_COLOR1_BASE:
+ 			case CB_COLOR2_BASE:
+ 			case CB_COLOR3_BASE:
+@@ -678,8 +757,11 @@ static int r600_packet3_check(struct radeon_cs_parser *p,
+ int r600_cs_parse(struct radeon_cs_parser *p)
+ {
+ 	struct radeon_cs_packet pkt;
++	struct r600_cs_track *track;
+ 	int r;
+ 
++	track = kzalloc(sizeof(*track), GFP_KERNEL);
++	p->track = track;
+ 	do {
+ 		r = r600_cs_packet_parse(p, &pkt, p->idx);
+ 		if (r) {
+@@ -757,6 +839,7 @@ int r600_cs_legacy(struct drm_device *dev, void *data, struct drm_file *filp,
+ 	/* initialize parser */
+ 	memset(&parser, 0, sizeof(struct radeon_cs_parser));
+ 	parser.filp = filp;
++	parser.dev = &dev->pdev->dev;
+ 	parser.rdev = NULL;
+ 	parser.family = family;
+ 	parser.ib = &fake_ib;
+diff --git a/drivers/gpu/drm/radeon/r600d.h b/drivers/gpu/drm/radeon/r600d.h
+index 27ab428..56fc658 100644
+--- a/drivers/gpu/drm/radeon/r600d.h
++++ b/drivers/gpu/drm/radeon/r600d.h
+@@ -674,4 +674,30 @@
+ #define		S_000E60_SOFT_RESET_TSC(x)		(((x) & 1) << 16)
+ #define		S_000E60_SOFT_RESET_VMC(x)		(((x) & 1) << 17)
+ 
++#define R_005480_HDP_MEM_COHERENCY_FLUSH_CNTL		0x5480
++
++#define R_0280E0_CB_COLOR0_FRAG                      0x0280E0
++#define   S_0280E0_BASE_256B(x)                        (((x) & 0xFFFFFFFF) << 0)
++#define   G_0280E0_BASE_256B(x)                        (((x) >> 0) & 0xFFFFFFFF)
++#define   C_0280E0_BASE_256B                           0x00000000
++#define R_0280E4_CB_COLOR1_FRAG                      0x0280E4
++#define R_0280E8_CB_COLOR2_FRAG                      0x0280E8
++#define R_0280EC_CB_COLOR3_FRAG                      0x0280EC
++#define R_0280F0_CB_COLOR4_FRAG                      0x0280F0
++#define R_0280F4_CB_COLOR5_FRAG                      0x0280F4
++#define R_0280F8_CB_COLOR6_FRAG                      0x0280F8
++#define R_0280FC_CB_COLOR7_FRAG                      0x0280FC
++#define R_0280C0_CB_COLOR0_TILE                      0x0280C0
++#define   S_0280C0_BASE_256B(x)                        (((x) & 0xFFFFFFFF) << 0)
++#define   G_0280C0_BASE_256B(x)                        (((x) >> 0) & 0xFFFFFFFF)
++#define   C_0280C0_BASE_256B                           0x00000000
++#define R_0280C4_CB_COLOR1_TILE                      0x0280C4
++#define R_0280C8_CB_COLOR2_TILE                      0x0280C8
++#define R_0280CC_CB_COLOR3_TILE                      0x0280CC
++#define R_0280D0_CB_COLOR4_TILE                      0x0280D0
++#define R_0280D4_CB_COLOR5_TILE                      0x0280D4
++#define R_0280D8_CB_COLOR6_TILE                      0x0280D8
++#define R_0280DC_CB_COLOR7_TILE                      0x0280DC
++
++
+ #endif
+diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
+index 224506a..6735213 100644
+--- a/drivers/gpu/drm/radeon/radeon.h
++++ b/drivers/gpu/drm/radeon/radeon.h
+@@ -448,6 +448,7 @@ struct radeon_cs_chunk {
+ };
+ 
+ struct radeon_cs_parser {
++	struct device		*dev;
+ 	struct radeon_device	*rdev;
+ 	struct drm_file		*filp;
+ 	/* chunks */
+diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c
+index 5ab2cf9..484f791 100644
+--- a/drivers/gpu/drm/radeon/radeon_cs.c
++++ b/drivers/gpu/drm/radeon/radeon_cs.c
+@@ -230,6 +230,7 @@ int radeon_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
+ 	memset(&parser, 0, sizeof(struct radeon_cs_parser));
+ 	parser.filp = filp;
+ 	parser.rdev = rdev;
++	parser.dev = rdev->dev;
+ 	r = radeon_cs_parser_init(&parser, data);
+ 	if (r) {
+ 		DRM_ERROR("Failed to initialize parser !\n");
+diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c
+index c85df4a..6f68315 100644
+--- a/drivers/gpu/drm/radeon/radeon_display.c
++++ b/drivers/gpu/drm/radeon/radeon_display.c
+@@ -599,7 +599,11 @@ radeon_user_framebuffer_create(struct drm_device *dev,
+ 	struct drm_gem_object *obj;
+ 
+ 	obj = drm_gem_object_lookup(dev, file_priv, mode_cmd->handle);
+-
++	if (obj ==  NULL) {
++		dev_err(&dev->pdev->dev, "No GEM object associated to handle 0x%08X, "
++			"can't create framebuffer\n", mode_cmd->handle);
++		return NULL;
++	}
+ 	return radeon_framebuffer_create(dev, mode_cmd, obj);
+ }
+ 
+diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c
+index b0efd0d..c42403b 100644
+--- a/drivers/gpu/drm/radeon/rv770.c
++++ b/drivers/gpu/drm/radeon/rv770.c
+@@ -1034,13 +1034,14 @@ int rv770_init(struct radeon_device *rdev)
+ 	if (rdev->accel_working) {
+ 		r = radeon_ib_pool_init(rdev);
+ 		if (r) {
+-			DRM_ERROR("radeon: failled initializing IB pool (%d).\n", r);
+-			rdev->accel_working = false;
+-		}
+-		r = r600_ib_test(rdev);
+-		if (r) {
+-			DRM_ERROR("radeon: failled testing IB (%d).\n", r);
++			dev_err(rdev->dev, "IB initialization failed (%d).\n", r);
+ 			rdev->accel_working = false;
++		} else {
++			r = r600_ib_test(rdev);
++			if (r) {
++				dev_err(rdev->dev, "IB test failed (%d).\n", r);
++				rdev->accel_working = false;
++			}
+ 		}
+ 	}
+ 	return 0;
+diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
+index 7bcb89f..3d5b8b0 100644
+--- a/drivers/gpu/drm/ttm/ttm_tt.c
++++ b/drivers/gpu/drm/ttm/ttm_tt.c
+@@ -466,7 +466,7 @@ static int ttm_tt_swapin(struct ttm_tt *ttm)
+ 	void *from_virtual;
+ 	void *to_virtual;
+ 	int i;
+-	int ret;
++	int ret = -ENOMEM;
+ 
+ 	if (ttm->page_flags & TTM_PAGE_FLAG_USER) {
+ 		ret = ttm_tt_set_user(ttm, ttm->tsk, ttm->start,
+@@ -485,8 +485,10 @@ static int ttm_tt_swapin(struct ttm_tt *ttm)
+ 
+ 	for (i = 0; i < ttm->num_pages; ++i) {
+ 		from_page = read_mapping_page(swap_space, i, NULL);
+-		if (IS_ERR(from_page))
++		if (IS_ERR(from_page)) {
++			ret = PTR_ERR(from_page);
+ 			goto out_err;
++		}
+ 		to_page = __ttm_tt_get_page(ttm, i);
+ 		if (unlikely(to_page == NULL))
+ 			goto out_err;
+@@ -509,7 +511,7 @@ static int ttm_tt_swapin(struct ttm_tt *ttm)
+ 	return 0;
+ out_err:
+ 	ttm_tt_free_alloced_pages(ttm);
+-	return -ENOMEM;
++	return ret;
+ }
+ 
+ int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistant_swap_storage)
+@@ -521,6 +523,7 @@ int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistant_swap_storage)
+ 	void *from_virtual;
+ 	void *to_virtual;
+ 	int i;
++	int ret = -ENOMEM;
+ 
+ 	BUG_ON(ttm->state != tt_unbound && ttm->state != tt_unpopulated);
+ 	BUG_ON(ttm->caching_state != tt_cached);
+@@ -543,7 +546,7 @@ int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistant_swap_storage)
+ 						0);
+ 		if (unlikely(IS_ERR(swap_storage))) {
+ 			printk(KERN_ERR "Failed allocating swap storage.\n");
+-			return -ENOMEM;
++			return PTR_ERR(swap_storage);
+ 		}
+ 	} else
+ 		swap_storage = persistant_swap_storage;
+@@ -555,9 +558,10 @@ int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistant_swap_storage)
+ 		if (unlikely(from_page == NULL))
+ 			continue;
+ 		to_page = read_mapping_page(swap_space, i, NULL);
+-		if (unlikely(to_page == NULL))
++		if (unlikely(IS_ERR(to_page))) {
++			ret = PTR_ERR(to_page);
+ 			goto out_err;
+-
++		}
+ 		preempt_disable();
+ 		from_virtual = kmap_atomic(from_page, KM_USER0);
+ 		to_virtual = kmap_atomic(to_page, KM_USER1);
+@@ -581,5 +585,5 @@ out_err:
+ 	if (!persistant_swap_storage)
+ 		fput(swap_storage);
+ 
+-	return -ENOMEM;
++	return ret;
+ }
+diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
+index 9678354..668604b 100644
+--- a/drivers/hid/hid-core.c
++++ b/drivers/hid/hid-core.c
+@@ -1658,8 +1658,6 @@ static const struct hid_device_id hid_ignore_list[] = {
+ 	{ HID_USB_DEVICE(USB_VENDOR_ID_PANJIT, 0x0004) },
+ 	{ HID_USB_DEVICE(USB_VENDOR_ID_PHILIPS, USB_DEVICE_ID_PHILIPS_IEEE802154_DONGLE) },
+ 	{ HID_USB_DEVICE(USB_VENDOR_ID_POWERCOM, USB_DEVICE_ID_POWERCOM_UPS) },
+-	{ HID_USB_DEVICE(USB_VENDOR_ID_TENX, USB_DEVICE_ID_TENX_IBUDDY1) },
+-	{ HID_USB_DEVICE(USB_VENDOR_ID_TENX, USB_DEVICE_ID_TENX_IBUDDY2) },
+ 	{ HID_USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_LABPRO) },
+ 	{ HID_USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_GOTEMP) },
+ 	{ HID_USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_SKIP) },
+diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
+index e380e7b..9831c3a 100644
+--- a/drivers/hid/hid-ids.h
++++ b/drivers/hid/hid-ids.h
+@@ -349,6 +349,9 @@
+ #define USB_VENDOR_ID_NEC		0x073e
+ #define USB_DEVICE_ID_NEC_USB_GAME_PAD	0x0301
+ 
++#define USB_VENDOR_ID_NEXTWINDOW	0x1926
++#define USB_DEVICE_ID_NEXTWINDOW_TOUCHSCREEN	0x0003
++
+ #define USB_VENDOR_ID_NTRIG                0x1b96
+ #define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN   0x0001
+ 
+@@ -392,10 +395,6 @@
+ #define USB_VENDOR_ID_SUNPLUS		0x04fc
+ #define USB_DEVICE_ID_SUNPLUS_WDESKTOP	0x05d8
+ 
+-#define USB_VENDOR_ID_TENX		0x1130
+-#define USB_DEVICE_ID_TENX_IBUDDY1	0x0001
+-#define USB_DEVICE_ID_TENX_IBUDDY2	0x0002
+-
+ #define USB_VENDOR_ID_THRUSTMASTER	0x044f
+ 
+ #define USB_VENDOR_ID_TOPMAX		0x0663
+diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
+index 5d901f6..1ca6574 100644
+--- a/drivers/hid/usbhid/hid-core.c
++++ b/drivers/hid/usbhid/hid-core.c
+@@ -318,6 +318,7 @@ static int hid_submit_out(struct hid_device *hid)
+ 			err_hid("usb_submit_urb(out) failed");
+ 			return -1;
+ 		}
++		usbhid->last_out = jiffies;
+ 	} else {
+ 		/*
+ 		 * queue work to wake up the device.
+@@ -379,6 +380,7 @@ static int hid_submit_ctrl(struct hid_device *hid)
+ 			err_hid("usb_submit_urb(ctrl) failed");
+ 			return -1;
+ 		}
++		usbhid->last_ctrl = jiffies;
+ 	} else {
+ 		/*
+ 		 * queue work to wake up the device.
+@@ -514,9 +516,20 @@ static void __usbhid_submit_report(struct hid_device *hid, struct hid_report *re
+ 		usbhid->out[usbhid->outhead].report = report;
+ 		usbhid->outhead = head;
+ 
+-		if (!test_and_set_bit(HID_OUT_RUNNING, &usbhid->iofl))
++		if (!test_and_set_bit(HID_OUT_RUNNING, &usbhid->iofl)) {
+ 			if (hid_submit_out(hid))
+ 				clear_bit(HID_OUT_RUNNING, &usbhid->iofl);
++		} else {
++			/*
++			 * the queue is known to run
++			 * but an earlier request may be stuck
++			 * we may need to time out
++			 * no race because this is called under
++			 * spinlock
++			 */
++			if (time_after(jiffies, usbhid->last_out + HZ * 5))
++				usb_unlink_urb(usbhid->urbout);
++		}
+ 		return;
+ 	}
+ 
+@@ -537,9 +550,20 @@ static void __usbhid_submit_report(struct hid_device *hid, struct hid_report *re
+ 	usbhid->ctrl[usbhid->ctrlhead].dir = dir;
+ 	usbhid->ctrlhead = head;
+ 
+-	if (!test_and_set_bit(HID_CTRL_RUNNING, &usbhid->iofl))
++	if (!test_and_set_bit(HID_CTRL_RUNNING, &usbhid->iofl)) {
+ 		if (hid_submit_ctrl(hid))
+ 			clear_bit(HID_CTRL_RUNNING, &usbhid->iofl);
++	} else {
++		/*
++		 * the queue is known to run
++		 * but an earlier request may be stuck
++		 * we may need to time out
++		 * no race because this is called under
++		 * spinlock
++		 */
++		if (time_after(jiffies, usbhid->last_ctrl + HZ * 5))
++			usb_unlink_urb(usbhid->urbctrl);
++	}
+ }
+ 
+ void usbhid_submit_report(struct hid_device *hid, struct hid_report *report, unsigned char dir)
+diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c
+index 5713b93..64c5dee 100644
+--- a/drivers/hid/usbhid/hid-quirks.c
++++ b/drivers/hid/usbhid/hid-quirks.c
+@@ -37,6 +37,7 @@ static const struct hid_blacklist {
+ 	{ USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FIGHTING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT },
+ 	{ USB_VENDOR_ID_NATSU, USB_DEVICE_ID_NATSU_GAMEPAD, HID_QUIRK_BADPAD },
+ 	{ USB_VENDOR_ID_NEC, USB_DEVICE_ID_NEC_USB_GAME_PAD, HID_QUIRK_BADPAD },
++	{ USB_VENDOR_ID_NEXTWINDOW, USB_DEVICE_ID_NEXTWINDOW_TOUCHSCREEN, HID_QUIRK_MULTI_INPUT},
+ 	{ USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_RUMBLEPAD, HID_QUIRK_BADPAD },
+ 	{ USB_VENDOR_ID_TOPMAX, USB_DEVICE_ID_TOPMAX_COBRAPAD, HID_QUIRK_BADPAD },
+ 
+diff --git a/drivers/hid/usbhid/usbhid.h b/drivers/hid/usbhid/usbhid.h
+index 08f505c..ec20400 100644
+--- a/drivers/hid/usbhid/usbhid.h
++++ b/drivers/hid/usbhid/usbhid.h
+@@ -80,12 +80,14 @@ struct usbhid_device {
+ 	unsigned char ctrlhead, ctrltail;                               /* Control fifo head & tail */
+ 	char *ctrlbuf;                                                  /* Control buffer */
+ 	dma_addr_t ctrlbuf_dma;                                         /* Control buffer dma */
++	unsigned long last_ctrl;						/* record of last output for timeouts */
+ 
+ 	struct urb *urbout;                                             /* Output URB */
+ 	struct hid_output_fifo out[HID_CONTROL_FIFO_SIZE];              /* Output pipe fifo */
+ 	unsigned char outhead, outtail;                                 /* Output pipe fifo head & tail */
+ 	char *outbuf;                                                   /* Output buffer */
+ 	dma_addr_t outbuf_dma;                                          /* Output buffer dma */
++	unsigned long last_out;							/* record of last output for timeouts */
+ 
+ 	spinlock_t lock;						/* fifo spinlock */
+ 	unsigned long iofl;                                             /* I/O flags (CTRL_RUNNING, OUT_RUNNING) */
+diff --git a/drivers/hwmon/ams/ams-core.c b/drivers/hwmon/ams/ams-core.c
+index 6c9ace1..2ad62c3 100644
+--- a/drivers/hwmon/ams/ams-core.c
++++ b/drivers/hwmon/ams/ams-core.c
+@@ -213,7 +213,7 @@ int __init ams_init(void)
+ 	return -ENODEV;
+ }
+ 
+-void ams_exit(void)
++void ams_sensor_detach(void)
+ {
+ 	/* Remove input device */
+ 	ams_input_exit();
+@@ -221,9 +221,6 @@ void ams_exit(void)
+ 	/* Remove attributes */
+ 	device_remove_file(&ams_info.of_dev->dev, &dev_attr_current);
+ 
+-	/* Shut down implementation */
+-	ams_info.exit();
+-
+ 	/* Flush interrupt worker
+ 	 *
+ 	 * We do this after ams_info.exit(), because an interrupt might
+@@ -239,6 +236,12 @@ void ams_exit(void)
+ 	pmf_unregister_irq_client(&ams_freefall_client);
+ }
+ 
++static void __exit ams_exit(void)
++{
++	/* Shut down implementation */
++	ams_info.exit();
++}
++
+ MODULE_AUTHOR("Stelian Pop, Michael Hanselmann");
+ MODULE_DESCRIPTION("Apple Motion Sensor driver");
+ MODULE_LICENSE("GPL");
+diff --git a/drivers/hwmon/ams/ams-i2c.c b/drivers/hwmon/ams/ams-i2c.c
+index 2cbf8a6..abeecd2 100644
+--- a/drivers/hwmon/ams/ams-i2c.c
++++ b/drivers/hwmon/ams/ams-i2c.c
+@@ -238,6 +238,8 @@ static int ams_i2c_probe(struct i2c_client *client,
+ static int ams_i2c_remove(struct i2c_client *client)
+ {
+ 	if (ams_info.has_device) {
++		ams_sensor_detach();
++
+ 		/* Disable interrupts */
+ 		ams_i2c_set_irq(AMS_IRQ_ALL, 0);
+ 
+diff --git a/drivers/hwmon/ams/ams-pmu.c b/drivers/hwmon/ams/ams-pmu.c
+index fb18b3d..4f61b3e 100644
+--- a/drivers/hwmon/ams/ams-pmu.c
++++ b/drivers/hwmon/ams/ams-pmu.c
+@@ -133,6 +133,8 @@ static void ams_pmu_get_xyz(s8 *x, s8 *y, s8 *z)
+ 
+ static void ams_pmu_exit(void)
+ {
++	ams_sensor_detach();
++
+ 	/* Disable interrupts */
+ 	ams_pmu_set_irq(AMS_IRQ_ALL, 0);
+ 
+diff --git a/drivers/hwmon/ams/ams.h b/drivers/hwmon/ams/ams.h
+index 5ed387b..b28d7e2 100644
+--- a/drivers/hwmon/ams/ams.h
++++ b/drivers/hwmon/ams/ams.h
+@@ -61,6 +61,7 @@ extern struct ams ams_info;
+ 
+ extern void ams_sensors(s8 *x, s8 *y, s8 *z);
+ extern int ams_sensor_attach(void);
++extern void ams_sensor_detach(void);
+ 
+ extern int ams_pmu_init(struct device_node *np);
+ extern int ams_i2c_init(struct device_node *np);
+diff --git a/drivers/hwmon/tmp421.c b/drivers/hwmon/tmp421.c
+index 2092434..d3a786b 100644
+--- a/drivers/hwmon/tmp421.c
++++ b/drivers/hwmon/tmp421.c
+@@ -62,9 +62,9 @@ static const u8 TMP421_TEMP_LSB[4]		= { 0x10, 0x11, 0x12, 0x13 };
+ #define TMP423_DEVICE_ID			0x23
+ 
+ static const struct i2c_device_id tmp421_id[] = {
+-	{ "tmp421", tmp421 },
+-	{ "tmp422", tmp422 },
+-	{ "tmp423", tmp423 },
++	{ "tmp421", 2 },
++	{ "tmp422", 3 },
++	{ "tmp423", 4 },
+ 	{ }
+ };
+ MODULE_DEVICE_TABLE(i2c, tmp421_id);
+@@ -74,21 +74,23 @@ struct tmp421_data {
+ 	struct mutex update_lock;
+ 	char valid;
+ 	unsigned long last_updated;
+-	int kind;
++	int channels;
+ 	u8 config;
+ 	s16 temp[4];
+ };
+ 
+ static int temp_from_s16(s16 reg)
+ {
+-	int temp = reg;
++	/* Mask out status bits */
++	int temp = reg & ~0xf;
+ 
+ 	return (temp * 1000 + 128) / 256;
+ }
+ 
+ static int temp_from_u16(u16 reg)
+ {
+-	int temp = reg;
++	/* Mask out status bits */
++	int temp = reg & ~0xf;
+ 
+ 	/* Add offset for extended temperature range. */
+ 	temp -= 64 * 256;
+@@ -108,7 +110,7 @@ static struct tmp421_data *tmp421_update_device(struct device *dev)
+ 		data->config = i2c_smbus_read_byte_data(client,
+ 			TMP421_CONFIG_REG_1);
+ 
+-		for (i = 0; i <= data->kind; i++) {
++		for (i = 0; i < data->channels; i++) {
+ 			data->temp[i] = i2c_smbus_read_byte_data(client,
+ 				TMP421_TEMP_MSB[i]) << 8;
+ 			data->temp[i] |= i2c_smbus_read_byte_data(client,
+@@ -167,7 +169,7 @@ static mode_t tmp421_is_visible(struct kobject *kobj, struct attribute *a,
+ 	devattr = container_of(a, struct device_attribute, attr);
+ 	index = to_sensor_dev_attr(devattr)->index;
+ 
+-	if (data->kind > index)
++	if (index < data->channels)
+ 		return a->mode;
+ 
+ 	return 0;
+@@ -275,7 +277,7 @@ static int tmp421_probe(struct i2c_client *client,
+ 
+ 	i2c_set_clientdata(client, data);
+ 	mutex_init(&data->update_lock);
+-	data->kind = id->driver_data;
++	data->channels = id->driver_data;
+ 
+ 	err = tmp421_init_client(client);
+ 	if (err)
+diff --git a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c
+index 386a797..a564fe2 100644
+--- a/drivers/macintosh/therm_adt746x.c
++++ b/drivers/macintosh/therm_adt746x.c
+@@ -90,6 +90,8 @@ static struct task_struct *thread_therm = NULL;
+ 
+ static void write_both_fan_speed(struct thermostat *th, int speed);
+ static void write_fan_speed(struct thermostat *th, int speed, int fan);
++static void thermostat_create_files(void);
++static void thermostat_remove_files(void);
+ 
+ static int
+ write_reg(struct thermostat* th, int reg, u8 data)
+@@ -161,6 +163,8 @@ remove_thermostat(struct i2c_client *client)
+ 	struct thermostat *th = i2c_get_clientdata(client);
+ 	int i;
+ 	
++	thermostat_remove_files();
++
+ 	if (thread_therm != NULL) {
+ 		kthread_stop(thread_therm);
+ 	}
+@@ -449,6 +453,8 @@ static int probe_thermostat(struct i2c_client *client,
+ 		return -ENOMEM;
+ 	}
+ 
++	thermostat_create_files();
++
+ 	return 0;
+ }
+ 
+@@ -566,7 +572,6 @@ thermostat_init(void)
+ 	struct device_node* np;
+ 	const u32 *prop;
+ 	int i = 0, offset = 0;
+-	int err;
+ 
+ 	np = of_find_node_by_name(NULL, "fan");
+ 	if (!np)
+@@ -633,6 +638,17 @@ thermostat_init(void)
+ 		return -ENODEV;
+ 	}
+ 
++#ifndef CONFIG_I2C_POWERMAC
++	request_module("i2c-powermac");
++#endif
++
++	return i2c_add_driver(&thermostat_driver);
++}
++
++static void thermostat_create_files(void)
++{
++	int err;
++
+ 	err = device_create_file(&of_dev->dev, &dev_attr_sensor1_temperature);
+ 	err |= device_create_file(&of_dev->dev, &dev_attr_sensor2_temperature);
+ 	err |= device_create_file(&of_dev->dev, &dev_attr_sensor1_limit);
+@@ -647,16 +663,9 @@ thermostat_init(void)
+ 	if (err)
+ 		printk(KERN_WARNING
+ 			"Failed to create tempertaure attribute file(s).\n");
+-
+-#ifndef CONFIG_I2C_POWERMAC
+-	request_module("i2c-powermac");
+-#endif
+-
+-	return i2c_add_driver(&thermostat_driver);
+ }
+ 
+-static void __exit
+-thermostat_exit(void)
++static void thermostat_remove_files(void)
+ {
+ 	if (of_dev) {
+ 		device_remove_file(&of_dev->dev, &dev_attr_sensor1_temperature);
+@@ -673,9 +682,14 @@ thermostat_exit(void)
+ 			device_remove_file(&of_dev->dev,
+ 					   &dev_attr_sensor2_fan_speed);
+ 
+-		of_device_unregister(of_dev);
+ 	}
++}
++
++static void __exit
++thermostat_exit(void)
++{
+ 	i2c_del_driver(&thermostat_driver);
++	of_device_unregister(of_dev);
+ }
+ 
+ module_init(thermostat_init);
+diff --git a/drivers/md/dm.c b/drivers/md/dm.c
+index 724efc6..adb3f8a 100644
+--- a/drivers/md/dm.c
++++ b/drivers/md/dm.c
+@@ -614,8 +614,10 @@ static void dec_pending(struct dm_io *io, int error)
+ 			if (!md->barrier_error && io_error != -EOPNOTSUPP)
+ 				md->barrier_error = io_error;
+ 			end_io_acct(io);
++			free_io(md, io);
+ 		} else {
+ 			end_io_acct(io);
++			free_io(md, io);
+ 
+ 			if (io_error != DM_ENDIO_REQUEUE) {
+ 				trace_block_bio_complete(md->queue, bio);
+@@ -623,8 +625,6 @@ static void dec_pending(struct dm_io *io, int error)
+ 				bio_endio(bio, io_error);
+ 			}
+ 		}
+-
+-		free_io(md, io);
+ 	}
+ }
+ 
+diff --git a/drivers/media/dvb/dvb-core/dvb_net.c b/drivers/media/dvb/dvb-core/dvb_net.c
+index 0241a7c..dddfc46 100644
+--- a/drivers/media/dvb/dvb-core/dvb_net.c
++++ b/drivers/media/dvb/dvb-core/dvb_net.c
+@@ -504,6 +504,7 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len )
+ 				       "bytes left in TS.  Resyncing.\n", ts_remain);
+ 				priv->ule_sndu_len = 0;
+ 				priv->need_pusi = 1;
++				ts += TS_SZ;
+ 				continue;
+ 			}
+ 
+diff --git a/drivers/media/dvb/dvb-usb/Kconfig b/drivers/media/dvb/dvb-usb/Kconfig
+index 0e4b97f..690823f 100644
+--- a/drivers/media/dvb/dvb-usb/Kconfig
++++ b/drivers/media/dvb/dvb-usb/Kconfig
+@@ -112,8 +112,8 @@ config DVB_USB_CXUSB
+ 	select DVB_MT352 if !DVB_FE_CUSTOMISE
+ 	select DVB_ZL10353 if !DVB_FE_CUSTOMISE
+ 	select DVB_DIB7000P if !DVB_FE_CUSTOMISE
+-	select DVB_LGS8GL5 if !DVB_FE_CUSTOMISE
+ 	select DVB_TUNER_DIB0070 if !DVB_FE_CUSTOMISE
++	select DVB_LGS8GXX if !DVB_FE_CUSTOMISE
+ 	select MEDIA_TUNER_SIMPLE if !MEDIA_TUNER_CUSTOMISE
+ 	select MEDIA_TUNER_XC2028 if !MEDIA_TUNER_CUSTOMISE
+ 	select MEDIA_TUNER_MXL5005S if !MEDIA_TUNER_CUSTOMISE
+diff --git a/drivers/media/dvb/frontends/l64781.c b/drivers/media/dvb/frontends/l64781.c
+index 3051b64..445fa10 100644
+--- a/drivers/media/dvb/frontends/l64781.c
++++ b/drivers/media/dvb/frontends/l64781.c
+@@ -192,8 +192,8 @@ static int apply_frontend_param (struct dvb_frontend* fe, struct dvb_frontend_pa
+ 	spi_bias *= qam_tab[p->constellation];
+ 	spi_bias /= p->code_rate_HP + 1;
+ 	spi_bias /= (guard_tab[p->guard_interval] + 32);
+-	spi_bias *= 1000ULL;
+-	spi_bias /= 1000ULL + ppm/1000;
++	spi_bias *= 1000;
++	spi_bias /= 1000 + ppm/1000;
+ 	spi_bias *= p->code_rate_HP;
+ 
+ 	val0x04 = (p->transmission_mode << 2) | p->guard_interval;
+diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c
+index a672401..d258ed7 100644
+--- a/drivers/media/video/bt8xx/bttv-driver.c
++++ b/drivers/media/video/bt8xx/bttv-driver.c
+@@ -4468,6 +4468,7 @@ static int __devinit bttv_probe(struct pci_dev *dev,
+ 		request_modules(btv);
+ 	}
+ 
++	init_bttv_i2c_ir(btv);
+ 	bttv_input_init(btv);
+ 
+ 	/* everything is fine */
+diff --git a/drivers/media/video/bt8xx/bttv-i2c.c b/drivers/media/video/bt8xx/bttv-i2c.c
+index beda363..3eb7c29 100644
+--- a/drivers/media/video/bt8xx/bttv-i2c.c
++++ b/drivers/media/video/bt8xx/bttv-i2c.c
+@@ -388,7 +388,12 @@ int __devinit init_bttv_i2c(struct bttv *btv)
+ 	if (0 == btv->i2c_rc && i2c_scan)
+ 		do_i2c_scan(btv->c.v4l2_dev.name, &btv->i2c_client);
+ 
+-	/* Instantiate the IR receiver device, if present */
++	return btv->i2c_rc;
++}
++
++/* Instantiate the I2C IR receiver device, if present */
++void __devinit init_bttv_i2c_ir(struct bttv *btv)
++{
+ 	if (0 == btv->i2c_rc) {
+ 		struct i2c_board_info info;
+ 		/* The external IR receiver is at i2c address 0x34 (0x35 for
+@@ -408,7 +413,6 @@ int __devinit init_bttv_i2c(struct bttv *btv)
+ 		strlcpy(info.type, "ir_video", I2C_NAME_SIZE);
+ 		i2c_new_probed_device(&btv->c.i2c_adap, &info, addr_list);
+ 	}
+-	return btv->i2c_rc;
+ }
+ 
+ int __devexit fini_bttv_i2c(struct bttv *btv)
+diff --git a/drivers/media/video/bt8xx/bttvp.h b/drivers/media/video/bt8xx/bttvp.h
+index a1d0e9c..6cccc2a 100644
+--- a/drivers/media/video/bt8xx/bttvp.h
++++ b/drivers/media/video/bt8xx/bttvp.h
+@@ -279,6 +279,7 @@ extern unsigned int bttv_debug;
+ extern unsigned int bttv_gpio;
+ extern void bttv_gpio_tracking(struct bttv *btv, char *comment);
+ extern int init_bttv_i2c(struct bttv *btv);
++extern void init_bttv_i2c_ir(struct bttv *btv);
+ extern int fini_bttv_i2c(struct bttv *btv);
+ 
+ #define bttv_printk if (bttv_verbose) printk
+diff --git a/drivers/media/video/gspca/mr97310a.c b/drivers/media/video/gspca/mr97310a.c
+index f8328b9..d61767c 100644
+--- a/drivers/media/video/gspca/mr97310a.c
++++ b/drivers/media/video/gspca/mr97310a.c
+@@ -530,6 +530,12 @@ static int start_cif_cam(struct gspca_dev *gspca_dev)
+ 			{0x13, 0x00, {0x01}, 1},
+ 			{0, 0, {0}, 0}
+ 		};
++		/* Without this command the cam won't work with USB-UHCI */
++		gspca_dev->usb_buf[0] = 0x0a;
++		gspca_dev->usb_buf[1] = 0x00;
++		err_code = mr_write(gspca_dev, 2);
++		if (err_code < 0)
++			return err_code;
+ 		err_code = sensor_write_regs(gspca_dev, cif_sensor1_init_data,
+ 					 ARRAY_SIZE(cif_sensor1_init_data));
+ 	}
+diff --git a/drivers/media/video/pwc/pwc-ctrl.c b/drivers/media/video/pwc/pwc-ctrl.c
+index 50b415e..f7f7e04 100644
+--- a/drivers/media/video/pwc/pwc-ctrl.c
++++ b/drivers/media/video/pwc/pwc-ctrl.c
+@@ -753,7 +753,7 @@ int pwc_set_shutter_speed(struct pwc_device *pdev, int mode, int value)
+ 		buf[0] = 0xff; /* fixed */
+ 
+ 	ret = send_control_msg(pdev,
+-		SET_LUM_CTL, SHUTTER_MODE_FORMATTER, &buf, sizeof(buf));
++		SET_LUM_CTL, SHUTTER_MODE_FORMATTER, &buf, 1);
+ 
+ 	if (!mode && ret >= 0) {
+ 		if (value < 0)
+diff --git a/drivers/media/video/uvc/uvc_ctrl.c b/drivers/media/video/uvc/uvc_ctrl.c
+index 4a293b4..0ca39ec 100644
+--- a/drivers/media/video/uvc/uvc_ctrl.c
++++ b/drivers/media/video/uvc/uvc_ctrl.c
+@@ -826,6 +826,13 @@ int uvc_query_v4l2_ctrl(struct uvc_video_chain *chain,
+ 		ret = 0;
+ 		goto out;
+ 
++	case V4L2_CTRL_TYPE_BUTTON:
++		v4l2_ctrl->minimum = 0;
++		v4l2_ctrl->maximum = 0;
++		v4l2_ctrl->step = 0;
++		ret = 0;
++		goto out;
++
+ 	default:
+ 		break;
+ 	}
+diff --git a/drivers/mmc/host/s3cmci.c b/drivers/mmc/host/s3cmci.c
+index 99b74a3..f31f05a 100644
+--- a/drivers/mmc/host/s3cmci.c
++++ b/drivers/mmc/host/s3cmci.c
+@@ -1178,7 +1178,7 @@ static int s3cmci_card_present(struct mmc_host *mmc)
+ 	struct s3c24xx_mci_pdata *pdata = host->pdata;
+ 	int ret;
+ 
+-	if (pdata->gpio_detect == 0)
++	if (pdata->no_detect)
+ 		return -ENOSYS;
+ 
+ 	ret = gpio_get_value(pdata->gpio_detect) ? 0 : 1;
+diff --git a/drivers/net/ks8851_mll.c b/drivers/net/ks8851_mll.c
+index c146304..c0ceebc 100644
+--- a/drivers/net/ks8851_mll.c
++++ b/drivers/net/ks8851_mll.c
+@@ -854,8 +854,8 @@ static void ks_update_link_status(struct net_device *netdev, struct ks_net *ks)
+ 
+ static irqreturn_t ks_irq(int irq, void *pw)
+ {
+-	struct ks_net *ks = pw;
+-	struct net_device *netdev = ks->netdev;
++	struct net_device *netdev = pw;
++	struct ks_net *ks = netdev_priv(netdev);
+ 	u16 status;
+ 
+ 	/*this should be the first in IRQ handler */
+diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
+index f3600b3..77125b5 100644
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -1008,11 +1008,8 @@ static void sky2_prefetch_init(struct sky2_hw *hw, u32 qaddr,
+ static inline struct sky2_tx_le *get_tx_le(struct sky2_port *sky2, u16 *slot)
+ {
+ 	struct sky2_tx_le *le = sky2->tx_le + *slot;
+-	struct tx_ring_info *re = sky2->tx_ring + *slot;
+ 
+ 	*slot = RING_NEXT(*slot, sky2->tx_ring_size);
+-	re->flags = 0;
+-	re->skb = NULL;
+ 	le->ctrl = 0;
+ 	return le;
+ }
+@@ -1580,8 +1577,7 @@ static unsigned tx_le_req(const struct sk_buff *skb)
+ 	return count;
+ }
+ 
+-static void sky2_tx_unmap(struct pci_dev *pdev,
+-			  const struct tx_ring_info *re)
++static void sky2_tx_unmap(struct pci_dev *pdev, struct tx_ring_info *re)
+ {
+ 	if (re->flags & TX_MAP_SINGLE)
+ 		pci_unmap_single(pdev, pci_unmap_addr(re, mapaddr),
+@@ -1591,6 +1587,7 @@ static void sky2_tx_unmap(struct pci_dev *pdev,
+ 		pci_unmap_page(pdev, pci_unmap_addr(re, mapaddr),
+ 			       pci_unmap_len(re, maplen),
+ 			       PCI_DMA_TODEVICE);
++	re->flags = 0;
+ }
+ 
+ /*
+@@ -1797,6 +1794,7 @@ static void sky2_tx_complete(struct sky2_port *sky2, u16 done)
+ 			dev->stats.tx_packets++;
+ 			dev->stats.tx_bytes += skb->len;
+ 
++			re->skb = NULL;
+ 			dev_kfree_skb_any(skb);
+ 
+ 			sky2->tx_next = RING_NEXT(idx, sky2->tx_ring_size);
+diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c
+index 1fd7058..31a5d3c 100644
+--- a/drivers/net/via-rhine.c
++++ b/drivers/net/via-rhine.c
+@@ -102,6 +102,7 @@ static const int multicast_filter_limit = 32;
+ #include <linux/ethtool.h>
+ #include <linux/crc32.h>
+ #include <linux/bitops.h>
++#include <linux/workqueue.h>
+ #include <asm/processor.h>	/* Processor type for cache alignment. */
+ #include <asm/io.h>
+ #include <asm/irq.h>
+@@ -389,6 +390,7 @@ struct rhine_private {
+ 	struct net_device *dev;
+ 	struct napi_struct napi;
+ 	spinlock_t lock;
++	struct work_struct reset_task;
+ 
+ 	/* Frequently used values: keep some adjacent for cache effect. */
+ 	u32 quirks;
+@@ -407,6 +409,7 @@ struct rhine_private {
+ static int  mdio_read(struct net_device *dev, int phy_id, int location);
+ static void mdio_write(struct net_device *dev, int phy_id, int location, int value);
+ static int  rhine_open(struct net_device *dev);
++static void rhine_reset_task(struct work_struct *work);
+ static void rhine_tx_timeout(struct net_device *dev);
+ static netdev_tx_t rhine_start_tx(struct sk_buff *skb,
+ 				  struct net_device *dev);
+@@ -775,6 +778,8 @@ static int __devinit rhine_init_one(struct pci_dev *pdev,
+ 	dev->irq = pdev->irq;
+ 
+ 	spin_lock_init(&rp->lock);
++	INIT_WORK(&rp->reset_task, rhine_reset_task);
++
+ 	rp->mii_if.dev = dev;
+ 	rp->mii_if.mdio_read = mdio_read;
+ 	rp->mii_if.mdio_write = mdio_write;
+@@ -1179,22 +1184,18 @@ static int rhine_open(struct net_device *dev)
+ 	return 0;
+ }
+ 
+-static void rhine_tx_timeout(struct net_device *dev)
++static void rhine_reset_task(struct work_struct *work)
+ {
+-	struct rhine_private *rp = netdev_priv(dev);
+-	void __iomem *ioaddr = rp->base;
+-
+-	printk(KERN_WARNING "%s: Transmit timed out, status %4.4x, PHY status "
+-	       "%4.4x, resetting...\n",
+-	       dev->name, ioread16(ioaddr + IntrStatus),
+-	       mdio_read(dev, rp->mii_if.phy_id, MII_BMSR));
++	struct rhine_private *rp = container_of(work, struct rhine_private,
++						reset_task);
++	struct net_device *dev = rp->dev;
+ 
+ 	/* protect against concurrent rx interrupts */
+ 	disable_irq(rp->pdev->irq);
+ 
+ 	napi_disable(&rp->napi);
+ 
+-	spin_lock(&rp->lock);
++	spin_lock_bh(&rp->lock);
+ 
+ 	/* clear all descriptors */
+ 	free_tbufs(dev);
+@@ -1206,7 +1207,7 @@ static void rhine_tx_timeout(struct net_device *dev)
+ 	rhine_chip_reset(dev);
+ 	init_registers(dev);
+ 
+-	spin_unlock(&rp->lock);
++	spin_unlock_bh(&rp->lock);
+ 	enable_irq(rp->pdev->irq);
+ 
+ 	dev->trans_start = jiffies;
+@@ -1214,6 +1215,19 @@ static void rhine_tx_timeout(struct net_device *dev)
+ 	netif_wake_queue(dev);
+ }
+ 
++static void rhine_tx_timeout(struct net_device *dev)
++{
++	struct rhine_private *rp = netdev_priv(dev);
++	void __iomem *ioaddr = rp->base;
++
++	printk(KERN_WARNING "%s: Transmit timed out, status %4.4x, PHY status "
++	       "%4.4x, resetting...\n",
++	       dev->name, ioread16(ioaddr + IntrStatus),
++	       mdio_read(dev, rp->mii_if.phy_id, MII_BMSR));
++
++	schedule_work(&rp->reset_task);
++}
++
+ static netdev_tx_t rhine_start_tx(struct sk_buff *skb,
+ 				  struct net_device *dev)
+ {
+@@ -1830,10 +1844,11 @@ static int rhine_close(struct net_device *dev)
+ 	struct rhine_private *rp = netdev_priv(dev);
+ 	void __iomem *ioaddr = rp->base;
+ 
+-	spin_lock_irq(&rp->lock);
+-
+-	netif_stop_queue(dev);
+ 	napi_disable(&rp->napi);
++	cancel_work_sync(&rp->reset_task);
++	netif_stop_queue(dev);
++
++	spin_lock_irq(&rp->lock);
+ 
+ 	if (debug > 1)
+ 		printk(KERN_DEBUG "%s: Shutting down ethercard, "
+diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
+index abf896a..6c26840 100644
+--- a/drivers/net/wireless/airo.c
++++ b/drivers/net/wireless/airo.c
+@@ -5254,11 +5254,7 @@ static int set_wep_key(struct airo_info *ai, u16 index, const char *key,
+ 	WepKeyRid wkr;
+ 	int rc;
+ 
+-	if (keylen == 0) {
+-		airo_print_err(ai->dev->name, "%s: key length to set was zero",
+-			       __func__);
+-		return -1;
+-	}
++	WARN_ON(keylen == 0);
+ 
+ 	memset(&wkr, 0, sizeof(wkr));
+ 	wkr.len = cpu_to_le16(sizeof(wkr));
+@@ -6404,11 +6400,7 @@ static int airo_set_encode(struct net_device *dev,
+ 		if (dwrq->length > MIN_KEY_SIZE)
+ 			key.len = MAX_KEY_SIZE;
+ 		else
+-			if (dwrq->length > 0)
+-				key.len = MIN_KEY_SIZE;
+-			else
+-				/* Disable the key */
+-				key.len = 0;
++			key.len = MIN_KEY_SIZE;
+ 		/* Check if the key is not marked as invalid */
+ 		if(!(dwrq->flags & IW_ENCODE_NOKEY)) {
+ 			/* Cleanup */
+@@ -6589,12 +6581,22 @@ static int airo_set_encodeext(struct net_device *dev,
+ 		default:
+ 			return -EINVAL;
+ 		}
+-		/* Send the key to the card */
+-		rc = set_wep_key(local, idx, key.key, key.len, perm, 1);
+-		if (rc < 0) {
+-			airo_print_err(local->dev->name, "failed to set WEP key"
+-			               " at index %d: %d.", idx, rc);
+-			return rc;
++		if (key.len == 0) {
++			rc = set_wep_tx_idx(local, idx, perm, 1);
++			if (rc < 0) {
++				airo_print_err(local->dev->name,
++					       "failed to set WEP transmit index to %d: %d.",
++					       idx, rc);
++				return rc;
++			}
++		} else {
++			rc = set_wep_key(local, idx, key.key, key.len, perm, 1);
++			if (rc < 0) {
++				airo_print_err(local->dev->name,
++					       "failed to set WEP key at index %d: %d.",
++					       idx, rc);
++				return rc;
++			}
+ 		}
+ 	}
+ 
+diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h b/drivers/net/wireless/ath/ath5k/ath5k.h
+index 6cd5efc..aafdc1e 100644
+--- a/drivers/net/wireless/ath/ath5k/ath5k.h
++++ b/drivers/net/wireless/ath/ath5k/ath5k.h
+@@ -546,7 +546,6 @@ struct ath5k_txq_info {
+ /*
+  * Transmit packet types.
+  * used on tx control descriptor
+- * TODO: Use them inside base.c corectly
+  */
+ enum ath5k_pkt_type {
+ 	AR5K_PKT_TYPE_NORMAL		= 0,
+diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
+index 8a82c75..46f913b 100644
+--- a/drivers/net/wireless/ath/ath5k/base.c
++++ b/drivers/net/wireless/ath/ath5k/base.c
+@@ -1220,6 +1220,29 @@ ath5k_rxbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf)
+ 	return 0;
+ }
+ 
++static enum ath5k_pkt_type get_hw_packet_type(struct sk_buff *skb)
++{
++	struct ieee80211_hdr *hdr;
++	enum ath5k_pkt_type htype;
++	__le16 fc;
++
++	hdr = (struct ieee80211_hdr *)skb->data;
++	fc = hdr->frame_control;
++
++	if (ieee80211_is_beacon(fc))
++		htype = AR5K_PKT_TYPE_BEACON;
++	else if (ieee80211_is_probe_resp(fc))
++		htype = AR5K_PKT_TYPE_PROBE_RESP;
++	else if (ieee80211_is_atim(fc))
++		htype = AR5K_PKT_TYPE_ATIM;
++	else if (ieee80211_is_pspoll(fc))
++		htype = AR5K_PKT_TYPE_PSPOLL;
++	else
++		htype = AR5K_PKT_TYPE_NORMAL;
++
++	return htype;
++}
++
+ static int
+ ath5k_txbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf,
+ 		  struct ath5k_txq *txq)
+@@ -1274,7 +1297,8 @@ ath5k_txbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf,
+ 			sc->vif, pktlen, info));
+ 	}
+ 	ret = ah->ah_setup_tx_desc(ah, ds, pktlen,
+-		ieee80211_get_hdrlen_from_skb(skb), AR5K_PKT_TYPE_NORMAL,
++		ieee80211_get_hdrlen_from_skb(skb),
++		get_hw_packet_type(skb),
+ 		(sc->power_level * 2),
+ 		hw_rate,
+ 		info->control.rates[0].count, keyidx, ah->ah_tx_ant, flags,
+diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c
+index 45c4ea5..72e2455 100644
+--- a/drivers/net/wireless/ath/ath9k/beacon.c
++++ b/drivers/net/wireless/ath/ath9k/beacon.c
+@@ -512,16 +512,13 @@ static void ath_beacon_config_ap(struct ath_softc *sc,
+ {
+ 	u32 nexttbtt, intval;
+ 
+-	/* Configure the timers only when the TSF has to be reset */
+-
+-	if (!(sc->sc_flags & SC_OP_TSF_RESET))
+-		return;
+-
+ 	/* NB: the beacon interval is kept internally in TU's */
+ 	intval = conf->beacon_interval & ATH9K_BEACON_PERIOD;
+ 	intval /= ATH_BCBUF;    /* for staggered beacons */
+ 	nexttbtt = intval;
+-	intval |= ATH9K_BEACON_RESET_TSF;
++
++	if (sc->sc_flags & SC_OP_TSF_RESET)
++		intval |= ATH9K_BEACON_RESET_TSF;
+ 
+ 	/*
+ 	 * In AP mode we enable the beacon timers and SWBA interrupts to
+diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
+index 0905b38..f735a96 100644
+--- a/drivers/net/wireless/ath/ath9k/hw.c
++++ b/drivers/net/wireless/ath/ath9k/hw.c
+@@ -1295,6 +1295,16 @@ static void ath9k_hw_override_ini(struct ath_hw *ah,
+ 	 * Necessary to avoid issues on AR5416 2.0
+ 	 */
+ 	REG_WRITE(ah, 0x9800 + (651 << 2), 0x11);
++
++	/*
++	 * Disable RIFS search on some chips to avoid baseband
++	 * hang issues.
++	 */
++	if (AR_SREV_9100(ah) || AR_SREV_9160(ah)) {
++		val = REG_READ(ah, AR_PHY_HEAVY_CLIP_FACTOR_RIFS);
++		val &= ~AR_PHY_RIFS_INIT_DELAY;
++		REG_WRITE(ah, AR_PHY_HEAVY_CLIP_FACTOR_RIFS, val);
++	}
+ }
+ 
+ static u32 ath9k_hw_def_ini_fixup(struct ath_hw *ah,
+diff --git a/drivers/net/wireless/ath/ath9k/phy.h b/drivers/net/wireless/ath/ath9k/phy.h
+index dfda6f4..b36ec94 100644
+--- a/drivers/net/wireless/ath/ath9k/phy.h
++++ b/drivers/net/wireless/ath/ath9k/phy.h
+@@ -368,6 +368,9 @@ bool ath9k_hw_init_rf(struct ath_hw *ah,
+ 
+ #define AR_PHY_HEAVY_CLIP_ENABLE         0x99E0
+ 
++#define AR_PHY_HEAVY_CLIP_FACTOR_RIFS    0x99EC
++#define AR_PHY_RIFS_INIT_DELAY         0x03ff0000
++
+ #define AR_PHY_M_SLEEP      0x99f0
+ #define AR_PHY_REFCLKDLY    0x99f4
+ #define AR_PHY_REFCLKPD     0x99f8
+diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
+index 1895d63..fd397aa 100644
+--- a/drivers/net/wireless/ath/ath9k/rc.c
++++ b/drivers/net/wireless/ath/ath9k/rc.c
+@@ -757,7 +757,7 @@ static void ath_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta,
+ 	struct ieee80211_tx_rate *rates = tx_info->control.rates;
+ 	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
+ 	__le16 fc = hdr->frame_control;
+-	u8 try_per_rate, i = 0, rix, nrix;
++	u8 try_per_rate, i = 0, rix;
+ 	int is_probe = 0;
+ 
+ 	if (rate_control_send_low(sta, priv_sta, txrc))
+@@ -777,26 +777,25 @@ static void ath_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta,
+ 
+ 	rate_table = sc->cur_rate_table;
+ 	rix = ath_rc_get_highest_rix(sc, ath_rc_priv, rate_table, &is_probe);
+-	nrix = rix;
+ 
+ 	if (is_probe) {
+ 		/* set one try for probe rates. For the
+ 		 * probes don't enable rts */
+ 		ath_rc_rate_set_series(rate_table, &rates[i++], txrc,
+-				       1, nrix, 0);
++				       1, rix, 0);
+ 
+ 		/* Get the next tried/allowed rate. No RTS for the next series
+ 		 * after the probe rate
+ 		 */
+-		ath_rc_get_lower_rix(rate_table, ath_rc_priv, rix, &nrix);
++		ath_rc_get_lower_rix(rate_table, ath_rc_priv, rix, &rix);
+ 		ath_rc_rate_set_series(rate_table, &rates[i++], txrc,
+-				       try_per_rate, nrix, 0);
++				       try_per_rate, rix, 0);
+ 
+ 		tx_info->flags |= IEEE80211_TX_CTL_RATE_CTRL_PROBE;
+ 	} else {
+ 		/* Set the choosen rate. No RTS for first series entry. */
+ 		ath_rc_rate_set_series(rate_table, &rates[i++], txrc,
+-				       try_per_rate, nrix, 0);
++				       try_per_rate, rix, 0);
+ 	}
+ 
+ 	/* Fill in the other rates for multirate retry */
+@@ -805,10 +804,10 @@ static void ath_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta,
+ 		if (i + 1 == 4)
+ 			try_per_rate = 4;
+ 
+-		ath_rc_get_lower_rix(rate_table, ath_rc_priv, rix, &nrix);
++		ath_rc_get_lower_rix(rate_table, ath_rc_priv, rix, &rix);
+ 		/* All other rates in the series have RTS enabled */
+ 		ath_rc_rate_set_series(rate_table, &rates[i], txrc,
+-				       try_per_rate, nrix, 1);
++				       try_per_rate, rix, 1);
+ 	}
+ 
+ 	/*
+diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
+index 9ca253e..2bde1a9 100644
+--- a/drivers/net/wireless/b43/main.c
++++ b/drivers/net/wireless/b43/main.c
+@@ -3967,6 +3967,7 @@ static int b43_wireless_core_start(struct b43_wldev *dev)
+ 	}
+ 
+ 	/* We are ready to run. */
++	ieee80211_wake_queues(dev->wl->hw);
+ 	b43_set_status(dev, B43_STAT_STARTED);
+ 
+ 	/* Start data flow (TX/RX). */
+@@ -4376,8 +4377,6 @@ static int b43_wireless_core_init(struct b43_wldev *dev)
+ 
+ 	ieee80211_wake_queues(dev->wl->hw);
+ 
+-	ieee80211_wake_queues(dev->wl->hw);
+-
+ 	b43_set_status(dev, B43_STAT_INITIALIZED);
+ 
+ out:
+diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c
+index 4b60148..c3968fa 100644
+--- a/drivers/net/wireless/b43legacy/main.c
++++ b/drivers/net/wireless/b43legacy/main.c
+@@ -2921,6 +2921,7 @@ static int b43legacy_wireless_core_start(struct b43legacy_wldev *dev)
+ 		goto out;
+ 	}
+ 	/* We are ready to run. */
++	ieee80211_wake_queues(dev->wl->hw);
+ 	b43legacy_set_status(dev, B43legacy_STAT_STARTED);
+ 
+ 	/* Start data flow (TX/RX) */
+@@ -3341,6 +3342,7 @@ static int b43legacy_wireless_core_init(struct b43legacy_wldev *dev)
+ 	b43legacy_security_init(dev);
+ 	b43legacy_rng_init(wl);
+ 
++	ieee80211_wake_queues(dev->wl->hw);
+ 	b43legacy_set_status(dev, B43legacy_STAT_INITIALIZED);
+ 
+ 	b43legacy_leds_init(dev);
+diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
+index 99331ed..852753b 100644
+--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
++++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
+@@ -2134,7 +2134,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
+ 			IWL_DEBUG_TX_REPLY(priv, "Retry scheduler reclaim scd_ssn "
+ 					   "%d index %d\n", scd_ssn , index);
+ 			freed = iwl_tx_queue_reclaim(priv, txq_id, index);
+-			priv->stations[sta_id].tid[tid].tfds_in_queue -= freed;
++			iwl_free_tfds_in_queue(priv, sta_id, tid, freed);
+ 
+ 			if (priv->mac80211_registered &&
+ 			    (iwl_queue_space(&txq->q) > txq->q.low_mark) &&
+diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
+index 133df70..2f89b62 100644
+--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
++++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
+@@ -1264,7 +1264,7 @@ static void iwl5000_rx_reply_tx(struct iwl_priv *priv,
+ 					scd_ssn , index, txq_id, txq->swq_id);
+ 
+ 			freed = iwl_tx_queue_reclaim(priv, txq_id, index);
+-			priv->stations[sta_id].tid[tid].tfds_in_queue -= freed;
++			iwl_free_tfds_in_queue(priv, sta_id, tid, freed);
+ 
+ 			if (priv->mac80211_registered &&
+ 			    (iwl_queue_space(&txq->q) > txq->q.low_mark) &&
+@@ -1293,16 +1293,14 @@ static void iwl5000_rx_reply_tx(struct iwl_priv *priv,
+ 				   tx_resp->failure_frame);
+ 
+ 		freed = iwl_tx_queue_reclaim(priv, txq_id, index);
+-		if (ieee80211_is_data_qos(tx_resp->frame_ctrl))
+-			priv->stations[sta_id].tid[tid].tfds_in_queue -= freed;
++		iwl_free_tfds_in_queue(priv, sta_id, tid, freed);
+ 
+ 		if (priv->mac80211_registered &&
+ 		    (iwl_queue_space(&txq->q) > txq->q.low_mark))
+ 			iwl_wake_queue(priv, txq_id);
+ 	}
+ 
+-	if (ieee80211_is_data_qos(tx_resp->frame_ctrl))
+-		iwl_txq_check_empty(priv, sta_id, tid, txq_id);
++	iwl_txq_check_empty(priv, sta_id, tid, txq_id);
+ 
+ 	if (iwl_check_bits(status, TX_ABORT_REQUIRED_MSK))
+ 		IWL_ERR(priv, "TODO:  Implement Tx ABORT REQUIRED!!!\n");
+diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
+index 0cd4ec4..6d6235f 100644
+--- a/drivers/net/wireless/iwlwifi/iwl-core.c
++++ b/drivers/net/wireless/iwlwifi/iwl-core.c
+@@ -2645,8 +2645,8 @@ int iwl_mac_config(struct ieee80211_hw *hw, u32 changed)
+ 		if ((le16_to_cpu(priv->staging_rxon.channel) != ch))
+ 			priv->staging_rxon.flags = 0;
+ 
+-		iwl_set_rxon_ht(priv, ht_conf);
+ 		iwl_set_rxon_channel(priv, conf->channel);
++		iwl_set_rxon_ht(priv, ht_conf);
+ 
+ 		iwl_set_flags_for_band(priv, conf->channel->band);
+ 		spin_unlock_irqrestore(&priv->lock, flags);
+diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
+index 7754538..40ec0c1 100644
+--- a/drivers/net/wireless/iwlwifi/iwl-core.h
++++ b/drivers/net/wireless/iwlwifi/iwl-core.h
+@@ -410,6 +410,8 @@ void iwl_hw_txq_ctx_free(struct iwl_priv *priv);
+ int iwl_hw_tx_queue_init(struct iwl_priv *priv,
+ 			 struct iwl_tx_queue *txq);
+ int iwl_txq_update_write_ptr(struct iwl_priv *priv, struct iwl_tx_queue *txq);
++void iwl_free_tfds_in_queue(struct iwl_priv *priv,
++			    int sta_id, int tid, int freed);
+ int iwl_tx_queue_init(struct iwl_priv *priv, struct iwl_tx_queue *txq,
+ 		      int slots_num, u32 txq_id);
+ void iwl_tx_queue_free(struct iwl_priv *priv, int txq_id);
+diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c
+index b7e196e..f449f06 100644
+--- a/drivers/net/wireless/iwlwifi/iwl-tx.c
++++ b/drivers/net/wireless/iwlwifi/iwl-tx.c
+@@ -119,6 +119,20 @@ int iwl_txq_update_write_ptr(struct iwl_priv *priv, struct iwl_tx_queue *txq)
+ EXPORT_SYMBOL(iwl_txq_update_write_ptr);
+ 
+ 
++void iwl_free_tfds_in_queue(struct iwl_priv *priv,
++			    int sta_id, int tid, int freed)
++{
++	if (priv->stations[sta_id].tid[tid].tfds_in_queue >= freed)
++		priv->stations[sta_id].tid[tid].tfds_in_queue -= freed;
++	else {
++		IWL_ERR(priv, "free more than tfds_in_queue (%u:%d)\n",
++			priv->stations[sta_id].tid[tid].tfds_in_queue,
++			freed);
++		priv->stations[sta_id].tid[tid].tfds_in_queue = 0;
++	}
++}
++EXPORT_SYMBOL(iwl_free_tfds_in_queue);
++
+ /**
+  * iwl_tx_queue_free - Deallocate DMA queue.
+  * @txq: Transmit queue to deallocate.
+@@ -1057,6 +1071,7 @@ int iwl_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index)
+ 	struct iwl_queue *q = &txq->q;
+ 	struct iwl_tx_info *tx_info;
+ 	int nfreed = 0;
++	struct ieee80211_hdr *hdr;
+ 
+ 	if ((index >= q->n_bd) || (iwl_queue_used(q, index) == 0)) {
+ 		IWL_ERR(priv, "Read index for DMA queue txq id (%d), index %d, "
+@@ -1071,6 +1086,10 @@ int iwl_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index)
+ 
+ 		tx_info = &txq->txb[txq->q.read_ptr];
+ 		ieee80211_tx_status_irqsafe(priv->hw, tx_info->skb[0]);
++
++		hdr = (struct ieee80211_hdr *)tx_info->skb[0]->data;
++		if (hdr && ieee80211_is_data_qos(hdr->frame_control))
++			nfreed++;
+ 		tx_info->skb[0] = NULL;
+ 
+ 		if (priv->cfg->ops->lib->txq_inval_byte_cnt_tbl)
+@@ -1485,7 +1504,7 @@ void iwl_rx_reply_compressed_ba(struct iwl_priv *priv,
+ 	if (txq->q.read_ptr != (ba_resp_scd_ssn & 0xff)) {
+ 		/* calculate mac80211 ampdu sw queue to wake */
+ 		int freed = iwl_tx_queue_reclaim(priv, scd_flow, index);
+-		priv->stations[sta_id].tid[tid].tfds_in_queue -= freed;
++		iwl_free_tfds_in_queue(priv, sta_id, tid, freed);
+ 
+ 		if ((iwl_queue_space(&txq->q) > txq->q.low_mark) &&
+ 		    priv->mac80211_registered &&
+diff --git a/drivers/net/wireless/p54/p54pci.c b/drivers/net/wireless/p54/p54pci.c
+index d348c26..1b73733 100644
+--- a/drivers/net/wireless/p54/p54pci.c
++++ b/drivers/net/wireless/p54/p54pci.c
+@@ -157,6 +157,14 @@ static void p54p_refill_rx_ring(struct ieee80211_hw *dev,
+ 						 skb_tail_pointer(skb),
+ 						 priv->common.rx_mtu + 32,
+ 						 PCI_DMA_FROMDEVICE);
++
++			if (pci_dma_mapping_error(priv->pdev, mapping)) {
++				dev_kfree_skb_any(skb);
++				dev_err(&priv->pdev->dev,
++					"RX DMA Mapping error\n");
++				break;
++			}
++
+ 			desc->host_addr = cpu_to_le32(mapping);
+ 			desc->device_addr = 0;	// FIXME: necessary?
+ 			desc->len = cpu_to_le16(priv->common.rx_mtu + 32);
+@@ -317,14 +325,20 @@ static void p54p_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
+ 	u32 device_idx, idx, i;
+ 
+ 	spin_lock_irqsave(&priv->lock, flags);
+-
+ 	device_idx = le32_to_cpu(ring_control->device_idx[1]);
+ 	idx = le32_to_cpu(ring_control->host_idx[1]);
+ 	i = idx % ARRAY_SIZE(ring_control->tx_data);
+ 
+-	priv->tx_buf_data[i] = skb;
+ 	mapping = pci_map_single(priv->pdev, skb->data, skb->len,
+ 				 PCI_DMA_TODEVICE);
++	if (pci_dma_mapping_error(priv->pdev, mapping)) {
++		spin_unlock_irqrestore(&priv->lock, flags);
++		p54_free_skb(dev, skb);
++		dev_err(&priv->pdev->dev, "TX DMA mapping error\n");
++		return ;
++	}
++	priv->tx_buf_data[i] = skb;
++
+ 	desc = &ring_control->tx_data[i];
+ 	desc->host_addr = cpu_to_le32(mapping);
+ 	desc->device_addr = ((struct p54_hdr *)skb->data)->req_id;
+diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c
+index 92af9b9..8742640 100644
+--- a/drivers/net/wireless/p54/p54usb.c
++++ b/drivers/net/wireless/p54/p54usb.c
+@@ -60,6 +60,7 @@ static struct usb_device_id p54u_table[] __devinitdata = {
+ 	{USB_DEVICE(0x06b9, 0x0121)},	/* Thomson SpeedTouch 121g */
+ 	{USB_DEVICE(0x0707, 0xee13)},   /* SMC 2862W-G version 2 */
+ 	{USB_DEVICE(0x083a, 0x4521)},   /* Siemens Gigaset USB Adapter 54 version 2 */
++	{USB_DEVICE(0x083a, 0xf503)},	/* Accton FD7050E ver 1010ec  */
+ 	{USB_DEVICE(0x0846, 0x4240)},	/* Netgear WG111 (v2) */
+ 	{USB_DEVICE(0x0915, 0x2000)},	/* Cohiba Proto board */
+ 	{USB_DEVICE(0x0915, 0x2002)},	/* Cohiba Proto board */
+diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
+index 54175b6..2ecbedb 100644
+--- a/drivers/net/wireless/rndis_wlan.c
++++ b/drivers/net/wireless/rndis_wlan.c
+@@ -83,11 +83,11 @@ MODULE_PARM_DESC(roamdelta,
+ 	"set roaming tendency: 0=aggressive, 1=moderate, "
+ 				"2=conservative (default: moderate)");
+ 
+-static int modparam_workaround_interval = 500;
++static int modparam_workaround_interval;
+ module_param_named(workaround_interval, modparam_workaround_interval,
+ 							int, 0444);
+ MODULE_PARM_DESC(workaround_interval,
+-	"set stall workaround interval in msecs (default: 500)");
++	"set stall workaround interval in msecs (0=disabled) (default: 0)");
+ 
+ 
+ /* various RNDIS OID defs */
+@@ -733,12 +733,13 @@ static int rndis_query_oid(struct usbnet *dev, __le32 oid, void *data, int *len)
+ 			le32_to_cpu(u.get_c->status));
+ 
+ 	if (ret == 0) {
++		memcpy(data, u.buf + le32_to_cpu(u.get_c->offset) + 8, *len);
++
+ 		ret = le32_to_cpu(u.get_c->len);
+ 		if (ret > *len)
+ 			*len = ret;
+-		memcpy(data, u.buf + le32_to_cpu(u.get_c->offset) + 8, *len);
+-		ret = rndis_error_status(u.get_c->status);
+ 
++		ret = rndis_error_status(u.get_c->status);
+ 		if (ret < 0)
+ 			devdbg(dev, "rndis_query_oid(%s): device returned "
+ 				"error,  0x%08x (%d)", oid_to_string(oid),
+@@ -1072,6 +1073,8 @@ static int set_auth_mode(struct usbnet *usbdev, u32 wpa_version,
+ 		auth_mode = NDIS_80211_AUTH_SHARED;
+ 	else if (auth_type == NL80211_AUTHTYPE_OPEN_SYSTEM)
+ 		auth_mode = NDIS_80211_AUTH_OPEN;
++	else if (auth_type == NL80211_AUTHTYPE_AUTOMATIC)
++		auth_mode = NDIS_80211_AUTH_AUTO_SWITCH;
+ 	else
+ 		return -ENOTSUPP;
+ 
+@@ -2547,7 +2550,7 @@ static void rndis_device_poller(struct work_struct *work)
+ 	/* Workaround transfer stalls on poor quality links.
+ 	 * TODO: find right way to fix these stalls (as stalls do not happen
+ 	 * with ndiswrapper/windows driver). */
+-	if (priv->last_qual <= 25) {
++	if (priv->param_workaround_interval > 0 && priv->last_qual <= 25) {
+ 		/* Decrease stats worker interval to catch stalls.
+ 		 * faster. Faster than 400-500ms causes packet loss,
+ 		 * Slower doesn't catch stalls fast enough.
+diff --git a/drivers/pci/hotplug/ibmphp_ebda.c b/drivers/pci/hotplug/ibmphp_ebda.c
+index c1abac8..5becbde 100644
+--- a/drivers/pci/hotplug/ibmphp_ebda.c
++++ b/drivers/pci/hotplug/ibmphp_ebda.c
+@@ -245,7 +245,7 @@ static void __init print_ebda_hpc (void)
+ 
+ int __init ibmphp_access_ebda (void)
+ {
+-	u8 format, num_ctlrs, rio_complete, hs_complete;
++	u8 format, num_ctlrs, rio_complete, hs_complete, ebda_sz;
+ 	u16 ebda_seg, num_entries, next_offset, offset, blk_id, sub_addr, re, rc_id, re_id, base;
+ 	int rc = 0;
+ 
+@@ -260,7 +260,16 @@ int __init ibmphp_access_ebda (void)
+ 	iounmap (io_mem);
+ 	debug ("returned ebda segment: %x\n", ebda_seg);
+ 	
+-	io_mem = ioremap(ebda_seg<<4, 1024);
++	io_mem = ioremap(ebda_seg<<4, 1);
++	if (!io_mem)
++		return -ENOMEM;
++	ebda_sz = readb(io_mem);
++	iounmap(io_mem);
++	debug("ebda size: %d(KiB)\n", ebda_sz);
++	if (ebda_sz == 0)
++		return -ENOMEM;
++
++	io_mem = ioremap(ebda_seg<<4, (ebda_sz * 1024));
+ 	if (!io_mem )
+ 		return -ENOMEM;
+ 	next_offset = 0x180;
+diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
+index 1ee734c..fa0a0d3 100644
+--- a/drivers/platform/x86/thinkpad_acpi.c
++++ b/drivers/platform/x86/thinkpad_acpi.c
+@@ -2073,6 +2073,7 @@ static struct attribute_set *hotkey_dev_attributes;
+ 
+ static void tpacpi_driver_event(const unsigned int hkey_event);
+ static void hotkey_driver_event(const unsigned int scancode);
++static void hotkey_poll_setup(const bool may_warn);
+ 
+ /* HKEY.MHKG() return bits */
+ #define TP_HOTKEY_TABLET_MASK (1 << 3)
+@@ -2254,6 +2255,8 @@ static int tpacpi_hotkey_driver_mask_set(const u32 mask)
+ 
+ 	rc = hotkey_mask_set((hotkey_acpi_mask | hotkey_driver_mask) &
+ 							~hotkey_source_mask);
++	hotkey_poll_setup(true);
++
+ 	mutex_unlock(&hotkey_mutex);
+ 
+ 	return rc;
+@@ -2538,7 +2541,7 @@ static void hotkey_poll_stop_sync(void)
+ }
+ 
+ /* call with hotkey_mutex held */
+-static void hotkey_poll_setup(bool may_warn)
++static void hotkey_poll_setup(const bool may_warn)
+ {
+ 	const u32 poll_driver_mask = hotkey_driver_mask & hotkey_source_mask;
+ 	const u32 poll_user_mask = hotkey_user_mask & hotkey_source_mask;
+@@ -2569,7 +2572,7 @@ static void hotkey_poll_setup(bool may_warn)
+ 	}
+ }
+ 
+-static void hotkey_poll_setup_safe(bool may_warn)
++static void hotkey_poll_setup_safe(const bool may_warn)
+ {
+ 	mutex_lock(&hotkey_mutex);
+ 	hotkey_poll_setup(may_warn);
+@@ -2587,7 +2590,11 @@ static void hotkey_poll_set_freq(unsigned int freq)
+ 
+ #else /* CONFIG_THINKPAD_ACPI_HOTKEY_POLL */
+ 
+-static void hotkey_poll_setup_safe(bool __unused)
++static void hotkey_poll_setup(const bool __unused)
++{
++}
++
++static void hotkey_poll_setup_safe(const bool __unused)
+ {
+ }
+ 
+@@ -2597,16 +2604,11 @@ static int hotkey_inputdev_open(struct input_dev *dev)
+ {
+ 	switch (tpacpi_lifecycle) {
+ 	case TPACPI_LIFE_INIT:
+-		/*
+-		 * hotkey_init will call hotkey_poll_setup_safe
+-		 * at the appropriate moment
+-		 */
+-		return 0;
+-	case TPACPI_LIFE_EXITING:
+-		return -EBUSY;
+ 	case TPACPI_LIFE_RUNNING:
+ 		hotkey_poll_setup_safe(false);
+ 		return 0;
++	case TPACPI_LIFE_EXITING:
++		return -EBUSY;
+ 	}
+ 
+ 	/* Should only happen if tpacpi_lifecycle is corrupt */
+@@ -2617,7 +2619,7 @@ static int hotkey_inputdev_open(struct input_dev *dev)
+ static void hotkey_inputdev_close(struct input_dev *dev)
+ {
+ 	/* disable hotkey polling when possible */
+-	if (tpacpi_lifecycle == TPACPI_LIFE_RUNNING &&
++	if (tpacpi_lifecycle != TPACPI_LIFE_EXITING &&
+ 	    !(hotkey_source_mask & hotkey_driver_mask))
+ 		hotkey_poll_setup_safe(false);
+ }
+@@ -3635,13 +3637,19 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
+ 			break;
+ 		case 3:
+ 			/* 0x3000-0x3FFF: bay-related wakeups */
+-			if (hkey == TP_HKEY_EV_BAYEJ_ACK) {
++			switch (hkey) {
++			case TP_HKEY_EV_BAYEJ_ACK:
+ 				hotkey_autosleep_ack = 1;
+ 				printk(TPACPI_INFO
+ 				       "bay ejected\n");
+ 				hotkey_wakeup_hotunplug_complete_notify_change();
+ 				known_ev = true;
+-			} else {
++				break;
++			case TP_HKEY_EV_OPTDRV_EJ:
++				/* FIXME: kick libata if SATA link offline */
++				known_ev = true;
++				break;
++			default:
+ 				known_ev = false;
+ 			}
+ 			break;
+@@ -3852,7 +3860,7 @@ enum {
+ 	TP_ACPI_BLUETOOTH_HWPRESENT	= 0x01,	/* Bluetooth hw available */
+ 	TP_ACPI_BLUETOOTH_RADIOSSW	= 0x02,	/* Bluetooth radio enabled */
+ 	TP_ACPI_BLUETOOTH_RESUMECTRL	= 0x04,	/* Bluetooth state at resume:
+-						   off / last state */
++						   0 = disable, 1 = enable */
+ };
+ 
+ enum {
+@@ -3898,10 +3906,11 @@ static int bluetooth_set_status(enum tpacpi_rfkill_state state)
+ 	}
+ #endif
+ 
+-	/* We make sure to keep TP_ACPI_BLUETOOTH_RESUMECTRL off */
+-	status = TP_ACPI_BLUETOOTH_RESUMECTRL;
+ 	if (state == TPACPI_RFK_RADIO_ON)
+-		status |= TP_ACPI_BLUETOOTH_RADIOSSW;
++		status = TP_ACPI_BLUETOOTH_RADIOSSW
++			  | TP_ACPI_BLUETOOTH_RESUMECTRL;
++	else
++		status = 0;
+ 
+ 	if (!acpi_evalf(hkey_handle, NULL, "SBDC", "vd", status))
+ 		return -EIO;
+@@ -4052,7 +4061,7 @@ enum {
+ 	TP_ACPI_WANCARD_HWPRESENT	= 0x01,	/* Wan hw available */
+ 	TP_ACPI_WANCARD_RADIOSSW	= 0x02,	/* Wan radio enabled */
+ 	TP_ACPI_WANCARD_RESUMECTRL	= 0x04,	/* Wan state at resume:
+-						   off / last state */
++						   0 = disable, 1 = enable */
+ };
+ 
+ #define TPACPI_RFK_WWAN_SW_NAME		"tpacpi_wwan_sw"
+@@ -4089,10 +4098,11 @@ static int wan_set_status(enum tpacpi_rfkill_state state)
+ 	}
+ #endif
+ 
+-	/* We make sure to set TP_ACPI_WANCARD_RESUMECTRL */
+-	status = TP_ACPI_WANCARD_RESUMECTRL;
+ 	if (state == TPACPI_RFK_RADIO_ON)
+-		status |= TP_ACPI_WANCARD_RADIOSSW;
++		status = TP_ACPI_WANCARD_RADIOSSW
++			 | TP_ACPI_WANCARD_RESUMECTRL;
++	else
++		status = 0;
+ 
+ 	if (!acpi_evalf(hkey_handle, NULL, "SWAN", "vd", status))
+ 		return -EIO;
+@@ -5736,7 +5746,7 @@ static void thermal_exit(void)
+ 	case TPACPI_THERMAL_ACPI_TMP07:
+ 	case TPACPI_THERMAL_ACPI_UPDT:
+ 		sysfs_remove_group(&tpacpi_sensors_pdev->dev.kobj,
+-				   &thermal_temp_input16_group);
++				   &thermal_temp_input8_group);
+ 		break;
+ 	case TPACPI_THERMAL_NONE:
+ 	default:
+@@ -6094,13 +6104,13 @@ static const struct tpacpi_quirk brightness_quirk_table[] __initconst = {
+ 	TPACPI_Q_IBM('1', 'Y', TPACPI_BRGHT_Q_EC),	/* T43/p ATI */
+ 
+ 	/* Models with ATI GPUs that can use ECNVRAM */
+-	TPACPI_Q_IBM('1', 'R', TPACPI_BRGHT_Q_EC),
++	TPACPI_Q_IBM('1', 'R', TPACPI_BRGHT_Q_EC),	/* R50,51 T40-42 */
+ 	TPACPI_Q_IBM('1', 'Q', TPACPI_BRGHT_Q_ASK|TPACPI_BRGHT_Q_EC),
+-	TPACPI_Q_IBM('7', '6', TPACPI_BRGHT_Q_ASK|TPACPI_BRGHT_Q_EC),
++	TPACPI_Q_IBM('7', '6', TPACPI_BRGHT_Q_EC),	/* R52 */
+ 	TPACPI_Q_IBM('7', '8', TPACPI_BRGHT_Q_ASK|TPACPI_BRGHT_Q_EC),
+ 
+ 	/* Models with Intel Extreme Graphics 2 */
+-	TPACPI_Q_IBM('1', 'U', TPACPI_BRGHT_Q_NOEC),
++	TPACPI_Q_IBM('1', 'U', TPACPI_BRGHT_Q_NOEC),	/* X40 */
+ 	TPACPI_Q_IBM('1', 'V', TPACPI_BRGHT_Q_ASK|TPACPI_BRGHT_Q_EC),
+ 	TPACPI_Q_IBM('1', 'W', TPACPI_BRGHT_Q_ASK|TPACPI_BRGHT_Q_EC),
+ 
+@@ -8362,6 +8372,9 @@ static int __init thinkpad_acpi_module_init(void)
+ 			return ret;
+ 		}
+ 	}
++
++	tpacpi_lifecycle = TPACPI_LIFE_RUNNING;
++
+ 	ret = input_register_device(tpacpi_inputdev);
+ 	if (ret < 0) {
+ 		printk(TPACPI_ERR "unable to register input device\n");
+@@ -8371,7 +8384,6 @@ static int __init thinkpad_acpi_module_init(void)
+ 		tp_features.input_device_registered = 1;
+ 	}
+ 
+-	tpacpi_lifecycle = TPACPI_LIFE_RUNNING;
+ 	return 0;
+ }
+ 
+diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c
+index be5a6b7..40845c7 100644
+--- a/drivers/rtc/class.c
++++ b/drivers/rtc/class.c
+@@ -226,6 +226,7 @@ static void __exit rtc_exit(void)
+ {
+ 	rtc_dev_exit();
+ 	class_destroy(rtc_class);
++	idr_destroy(&rtc_idr);
+ }
+ 
+ subsys_initcall(rtc_init);
+diff --git a/drivers/rtc/rtc-coh901331.c b/drivers/rtc/rtc-coh901331.c
+index 03ea530..44c4399 100644
+--- a/drivers/rtc/rtc-coh901331.c
++++ b/drivers/rtc/rtc-coh901331.c
+@@ -271,12 +271,13 @@ static int coh901331_resume(struct platform_device *pdev)
+ {
+ 	struct coh901331_port *rtap = dev_get_drvdata(&pdev->dev);
+ 
+-	if (device_may_wakeup(&pdev->dev))
++	if (device_may_wakeup(&pdev->dev)) {
+ 		disable_irq_wake(rtap->irq);
+-	else
++	} else {
+ 		clk_enable(rtap->clk);
+ 		writel(rtap->irqmaskstore, rtap->virtbase + COH901331_IRQ_MASK);
+ 		clk_disable(rtap->clk);
++	}
+ 	return 0;
+ }
+ #else
+diff --git a/drivers/scsi/arm/fas216.c b/drivers/scsi/arm/fas216.c
+index 4775426..9e71ac6 100644
+--- a/drivers/scsi/arm/fas216.c
++++ b/drivers/scsi/arm/fas216.c
+@@ -2516,7 +2516,7 @@ int fas216_eh_device_reset(struct scsi_cmnd *SCpnt)
+ 		if (info->scsi.phase == PHASE_IDLE)
+ 			fas216_kick(info);
+ 
+-		mod_timer(&info->eh_timer, 30 * HZ);
++		mod_timer(&info->eh_timer, jiffies + 30 * HZ);
+ 		spin_unlock_irqrestore(&info->host_lock, flags);
+ 
+ 		/*
+diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+index 1743640..f10bf70 100644
+--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
++++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+@@ -5721,6 +5721,8 @@ _scsih_remove(struct pci_dev *pdev)
+ 	struct _sas_port *mpt2sas_port;
+ 	struct _sas_device *sas_device;
+ 	struct _sas_node *expander_sibling;
++	struct _raid_device *raid_device, *next;
++	struct MPT2SAS_TARGET *sas_target_priv_data;
+ 	struct workqueue_struct	*wq;
+ 	unsigned long flags;
+ 
+@@ -5734,6 +5736,21 @@ _scsih_remove(struct pci_dev *pdev)
+ 	if (wq)
+ 		destroy_workqueue(wq);
+ 
++	/* release all the volumes */
++	list_for_each_entry_safe(raid_device, next, &ioc->raid_device_list,
++	    list) {
++		if (raid_device->starget) {
++			sas_target_priv_data =
++			    raid_device->starget->hostdata;
++			sas_target_priv_data->deleted = 1;
++			scsi_remove_target(&raid_device->starget->dev);
++		}
++		printk(MPT2SAS_INFO_FMT "removing handle(0x%04x), wwid"
++		    "(0x%016llx)\n", ioc->name,  raid_device->handle,
++		    (unsigned long long) raid_device->wwid);
++		_scsih_raid_device_remove(ioc, raid_device);
++	}
++
+ 	/* free ports attached to the sas_host */
+  retry_again:
+ 	list_for_each_entry(mpt2sas_port,
+diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c
+index 8371d91..49ac414 100644
+--- a/drivers/scsi/qla1280.c
++++ b/drivers/scsi/qla1280.c
+@@ -1640,8 +1640,10 @@ qla1280_load_firmware_pio(struct scsi_qla_host *ha)
+ 	uint16_t mb[MAILBOX_REGISTER_COUNT], i;
+ 	int err;
+ 
++	spin_unlock_irq(ha->host->host_lock);
+ 	err = request_firmware(&fw, ql1280_board_tbl[ha->devnum].fwname,
+ 			       &ha->pdev->dev);
++	spin_lock_irq(ha->host->host_lock);
+ 	if (err) {
+ 		printk(KERN_ERR "Failed to load image \"%s\" err %d\n",
+ 		       ql1280_board_tbl[ha->devnum].fwname, err);
+@@ -1699,8 +1701,10 @@ qla1280_load_firmware_dma(struct scsi_qla_host *ha)
+ 		return -ENOMEM;
+ #endif
+ 
++	spin_unlock_irq(ha->host->host_lock);
+ 	err = request_firmware(&fw, ql1280_board_tbl[ha->devnum].fwname,
+ 			       &ha->pdev->dev);
++	spin_lock_irq(ha->host->host_lock);
+ 	if (err) {
+ 		printk(KERN_ERR "Failed to load image \"%s\" err %d\n",
+ 		       ql1280_board_tbl[ha->devnum].fwname, err);
+diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h
+index f3d1d1a..65ef03c 100644
+--- a/drivers/scsi/qla2xxx/qla_gbl.h
++++ b/drivers/scsi/qla2xxx/qla_gbl.h
+@@ -453,6 +453,5 @@ extern void qla24xx_wrt_req_reg(struct qla_hw_data *, uint16_t, uint16_t);
+ extern void qla25xx_wrt_req_reg(struct qla_hw_data *, uint16_t, uint16_t);
+ extern void qla25xx_wrt_rsp_reg(struct qla_hw_data *, uint16_t, uint16_t);
+ extern void qla24xx_wrt_rsp_reg(struct qla_hw_data *, uint16_t, uint16_t);
+-extern struct scsi_qla_host * qla25xx_get_host(struct rsp_que *);
+ 
+ #endif /* _QLA_GBL_H */
+diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
+index b20a716..b79481e 100644
+--- a/drivers/scsi/qla2xxx/qla_isr.c
++++ b/drivers/scsi/qla2xxx/qla_isr.c
+@@ -2018,7 +2018,7 @@ qla24xx_msix_rsp_q(int irq, void *dev_id)
+ 
+ 	spin_lock_irq(&ha->hardware_lock);
+ 
+-	vha = qla25xx_get_host(rsp);
++	vha = pci_get_drvdata(ha->pdev);
+ 	qla24xx_process_response_queue(vha, rsp);
+ 	if (!ha->mqenable) {
+ 		WRT_REG_DWORD(&reg->hccr, HCCRX_CLR_RISC_INT);
+@@ -2357,30 +2357,3 @@ int qla25xx_request_irq(struct rsp_que *rsp)
+ 	msix->rsp = rsp;
+ 	return ret;
+ }
+-
+-struct scsi_qla_host *
+-qla25xx_get_host(struct rsp_que *rsp)
+-{
+-	srb_t *sp;
+-	struct qla_hw_data *ha = rsp->hw;
+-	struct scsi_qla_host *vha = NULL;
+-	struct sts_entry_24xx *pkt;
+-	struct req_que *req;
+-	uint16_t que;
+-	uint32_t handle;
+-
+-	pkt = (struct sts_entry_24xx *) rsp->ring_ptr;
+-	que = MSW(pkt->handle);
+-	handle = (uint32_t) LSW(pkt->handle);
+-	req = ha->req_q_map[que];
+-	if (handle < MAX_OUTSTANDING_COMMANDS) {
+-		sp = req->outstanding_cmds[handle];
+-		if (sp)
+-			return  sp->fcport->vha;
+-		else
+-			goto base_que;
+-	}
+-base_que:
+-	vha = pci_get_drvdata(ha->pdev);
+-	return vha;
+-}
+diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c
+index e07b361..4a69cc8 100644
+--- a/drivers/scsi/qla2xxx/qla_mid.c
++++ b/drivers/scsi/qla2xxx/qla_mid.c
+@@ -638,11 +638,15 @@ failed:
+ 
+ static void qla_do_work(struct work_struct *work)
+ {
++	unsigned long flags;
+ 	struct rsp_que *rsp = container_of(work, struct rsp_que, q_work);
+ 	struct scsi_qla_host *vha;
++	struct qla_hw_data *ha = rsp->hw;
+ 
+-	vha = qla25xx_get_host(rsp);
++	spin_lock_irqsave(&rsp->hw->hardware_lock, flags);
++	vha = pci_get_drvdata(ha->pdev);
+ 	qla24xx_process_response_queue(vha, rsp);
++	spin_unlock_irqrestore(&rsp->hw->hardware_lock, flags);
+ }
+ 
+ /* create response queue */
+diff --git a/drivers/serial/imx.c b/drivers/serial/imx.c
+index 18130f1..8c0dd13 100644
+--- a/drivers/serial/imx.c
++++ b/drivers/serial/imx.c
+@@ -1279,7 +1279,7 @@ static int serial_imx_probe(struct platform_device *pdev)
+ 		sport->use_irda = 1;
+ #endif
+ 
+-	if (pdata->init) {
++	if (pdata && pdata->init) {
+ 		ret = pdata->init(pdev);
+ 		if (ret)
+ 			goto clkput;
+@@ -1292,7 +1292,7 @@ static int serial_imx_probe(struct platform_device *pdev)
+ 
+ 	return 0;
+ deinit:
+-	if (pdata->exit)
++	if (pdata && pdata->exit)
+ 		pdata->exit(pdev);
+ clkput:
+ 	clk_put(sport->clk);
+@@ -1321,7 +1321,7 @@ static int serial_imx_remove(struct platform_device *pdev)
+ 
+ 	clk_disable(sport->clk);
+ 
+-	if (pdata->exit)
++	if (pdata && pdata->exit)
+ 		pdata->exit(pdev);
+ 
+ 	iounmap(sport->port.membase);
+diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig
+index d21b346..b926b00 100644
+--- a/drivers/staging/Kconfig
++++ b/drivers/staging/Kconfig
+@@ -81,8 +81,6 @@ source "drivers/staging/rtl8192su/Kconfig"
+ 
+ source "drivers/staging/rtl8192e/Kconfig"
+ 
+-source "drivers/staging/mimio/Kconfig"
+-
+ source "drivers/staging/frontier/Kconfig"
+ 
+ source "drivers/staging/android/Kconfig"
+diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile
+index 8cbf1ae..030d8f8 100644
+--- a/drivers/staging/Makefile
++++ b/drivers/staging/Makefile
+@@ -23,7 +23,6 @@ obj-$(CONFIG_ALTERA_PCIE_CHDMA)	+= altpciechdma/
+ obj-$(CONFIG_RTL8187SE)		+= rtl8187se/
+ obj-$(CONFIG_RTL8192SU)		+= rtl8192su/
+ obj-$(CONFIG_RTL8192E)		+= rtl8192e/
+-obj-$(CONFIG_INPUT_MIMIO)	+= mimio/
+ obj-$(CONFIG_TRANZPORT)		+= frontier/
+ obj-$(CONFIG_ANDROID)		+= android/
+ obj-$(CONFIG_ANDROID)		+= dream/
+diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
+index 894eecf..6acc49a 100644
+--- a/drivers/staging/hv/vmbus_drv.c
++++ b/drivers/staging/hv/vmbus_drv.c
+@@ -24,6 +24,8 @@
+ #include <linux/irq.h>
+ #include <linux/interrupt.h>
+ #include <linux/sysctl.h>
++#include <linux/pci.h>
++#include <linux/dmi.h>
+ #include "osd.h"
+ #include "logging.h"
+ #include "vmbus.h"
+@@ -946,6 +948,19 @@ static irqreturn_t vmbus_isr(int irq, void *dev_id)
+ 	}
+ }
+ 
++static struct dmi_system_id __initdata microsoft_hv_dmi_table[] = {
++	{
++		.ident = "Hyper-V",
++		.matches = {
++			DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
++			DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"),
++			DMI_MATCH(DMI_BOARD_NAME, "Virtual Machine"),
++		},
++	},
++	{ },
++};
++MODULE_DEVICE_TABLE(dmi, microsoft_hv_dmi_table);
++
+ static int __init vmbus_init(void)
+ {
+ 	int ret = 0;
+@@ -957,6 +972,9 @@ static int __init vmbus_init(void)
+ 		vmbus_loglevel, HIWORD(vmbus_loglevel), LOWORD(vmbus_loglevel));
+ 	/* Todo: it is used for loglevel, to be ported to new kernel. */
+ 
++	if (!dmi_check_system(microsoft_hv_dmi_table))
++		return -ENODEV;
++
+ 	ret = vmbus_bus_init(VmbusInitialize);
+ 
+ 	DPRINT_EXIT(VMBUS_DRV);
+@@ -973,6 +991,18 @@ static void __exit vmbus_exit(void)
+ 	return;
+ }
+ 
++/*
++ * We use a PCI table to determine if we should autoload this driver  This is
++ * needed by distro tools to determine if the hyperv drivers should be
++ * installed and/or configured.  We don't do anything else with the table, but
++ * it needs to be present.
++ */
++const static struct pci_device_id microsoft_hv_pci_table[] = {
++	{ PCI_DEVICE(0x1414, 0x5353) },	/* VGA compatible controller */
++	{ 0 }
++};
++MODULE_DEVICE_TABLE(pci, microsoft_hv_pci_table);
++
+ MODULE_LICENSE("GPL");
+ module_param(vmbus_irq, int, S_IRUGO);
+ module_param(vmbus_loglevel, int, S_IRUGO);
+diff --git a/drivers/staging/mimio/Kconfig b/drivers/staging/mimio/Kconfig
+deleted file mode 100644
+index 505dcb2..0000000
+--- a/drivers/staging/mimio/Kconfig
++++ /dev/null
+@@ -1,10 +0,0 @@
+-config INPUT_MIMIO
+-	tristate "Mimio Xi interactive whiteboard support"
+-	depends on USB && INPUT
+-	default N
+-	help
+-	  Say Y here if you want to use a Mimio Xi interactive
+-	  whiteboard device.
+-
+-	  To compile this driver as a module, choose M here: the
+-	  module will be called mimio.
+diff --git a/drivers/staging/mimio/Makefile b/drivers/staging/mimio/Makefile
+deleted file mode 100644
+index 77807ee..0000000
+--- a/drivers/staging/mimio/Makefile
++++ /dev/null
+@@ -1 +0,0 @@
+-obj-$(CONFIG_INPUT_MIMIO)	+= mimio.o
+diff --git a/drivers/staging/mimio/mimio.c b/drivers/staging/mimio/mimio.c
+deleted file mode 100644
+index 1ba8103..0000000
+--- a/drivers/staging/mimio/mimio.c
++++ /dev/null
+@@ -1,914 +0,0 @@
+-/*
+- * Hardware event => input event mapping:
+- *
+- *
+- *
+- input.h:#define BTN_TOOL_PEN            0x140 black
+- input.h:#define BTN_TOOL_RUBBER         0x141 blue
+- input.h:#define BTN_TOOL_BRUSH          0x142 green
+- input.h:#define BTN_TOOL_PENCIL         0x143 red
+- input.h:#define BTN_TOOL_AIRBRUSH       0x144 eraser
+- input.h:#define BTN_TOOL_FINGER         0x145 small eraser
+- input.h:#define BTN_TOOL_MOUSE          0x146 mimio interactive
+- input.h:#define BTN_TOOL_LENS           0x147 mimio interactive but1
+- input.h:#define LOCALBTN_TOOL_EXTRA1    0x14a mimio interactive but2 == BTN_TOUCH
+- input.h:#define LOCALBTN_TOOL_EXTRA2    0x14b mimio extra pens (orange, brown, yellow, purple) == BTN_STYLUS
+- input.h:#define LOCALBTN_TOOL_EXTRA3    0x14c unused == BTN_STYLUS2
+- input.h:#define BTN_TOOL_DOUBLETAP      0x14d unused
+- input.h:#define BTN_TOOL_TRIPLETAP      0x14e unused
+- *
+- * MIMIO_EV_PENDOWN(MIMIO_PEN_K)     => EV_KEY BIT(BTN_TOOL_PEN)
+- * MIMIO_EV_PENDOWN(MIMIO_PEN_B)     => EV_KEY BIT(BTN_TOOL_RUBBER)
+- * MIMIO_EV_PENDOWN(MIMIO_PEN_G)     => EV_KEY BIT(BTN_TOOL_BRUSH)
+- * MIMIO_EV_PENDOWN(MIMIO_PEN_R)     => EV_KEY BIT(BTN_TOOL_PENCIL)
+- * MIMIO_EV_PENDOWN(MIMIO_PEN_E)     => EV_KEY BIT(BTN_TOOL_AIRBRUSH)
+- * MIMIO_EV_PENDOWN(MIMIO_PEN_ES)    => EV_KEY BIT(BTN_TOOL_FINGER)
+- * MIMIO_EV_PENDOWN(MIMIO_PEN_I)     => EV_KEY BIT(BTN_TOOL_MOUSE)
+- * MIMIO_EV_PENDOWN(MIMIO_PEN_IL)    => EV_KEY BIT(BTN_TOOL_LENS)
+- * MIMIO_EV_PENDOWN(MIMIO_PEN_IR)    => EV_KEY BIT(BTN_TOOL_DOUBLETAP)
+- * MIMIO_EV_PENDOWN(MIMIO_PEN_EX)    => EV_KEY BIT(BTN_TOOL_TRIPLETAP)
+- * MIMIO_EV_PENDATA                 => EV_ABS BIT(ABS_X), BIT(ABS_Y)
+- * MIMIO_EV_MEMRESET              => EV_KEY BIT(BTN_0)
+- * MIMIO_EV_ACC(ACC_NEWPAGE)       => EV_KEY BIT(BTN_1)
+- * MIMIO_EV_ACC(ACC_TAGPAGE)      => EV_KEY BIT(BTN_2)
+- * MIMIO_EV_ACC(ACC_PRINTPAGE)      => EV_KEY BIT(BTN_3)
+- * MIMIO_EV_ACC(ACC_MAXIMIZE)      => EV_KEY BIT(BTN_4)
+- * MIMIO_EV_ACC(ACC_FINDCTLPNL)      => EV_KEY BIT(BTN_5)
+- *
+- *
+- * open issues:
+- *      - cold-load of data captured when mimio in standalone mode not yet
+- *         supported; need to snoop Win32 box to see datastream for this.
+- *       - mimio mouse not yet supported; need to snoop Win32 box to see the
+- *         datastream for this.
+- */
+-#include <linux/kernel.h>
+-#include <linux/init.h>
+-#include <linux/slab.h>
+-#include <linux/spinlock.h>
+-#include <linux/input.h>
+-#include <linux/usb.h>
+-
+-#define DRIVER_VERSION		"v0.031"
+-#define DRIVER_AUTHOR		"mwilder@cs.nmsu.edu"
+-#define DRIVER_DESC		"USB mimio-xi driver"
+-
+-enum {UPVALUE, DOWNVALUE, MOVEVALUE};
+-
+-#define MIMIO_XRANGE_MAX	9600
+-#define MIMIO_YRANGE_MAX	4800
+-
+-#define LOCALBTN_TOOL_EXTRA1	BTN_TOUCH
+-#define LOCALBTN_TOOL_EXTRA2	BTN_STYLUS
+-#define LOCALBTN_TOOL_EXTRA3	BTN_STYLUS2
+-
+-#define MIMIO_VENDOR_ID		0x08d3
+-#define MIMIO_PRODUCT_ID	0x0001
+-#define MIMIO_MAXPAYLOAD	(8)
+-#define MIMIO_MAXNAMELEN	(64)
+-#define MIMIO_TXWAIT		(1)
+-#define MIMIO_TXDONE		(2)
+-
+-#define MIMIO_EV_PENDOWN	(0x22)
+-#define MIMIO_EV_PENDATA	(0x24)
+-#define MIMIO_EV_PENUP		(0x51)
+-#define MIMIO_EV_MEMRESET	(0x45)
+-#define MIMIO_EV_ACC		(0xb2)
+-
+-#define MIMIO_PEN_K		(1)	/* black pen */
+-#define MIMIO_PEN_B		(2)	/* blue pen */
+-#define MIMIO_PEN_G		(3)	/* green pen */
+-#define MIMIO_PEN_R		(4)	/* red pen */
+-/* 5, 6, 7, 8 are extra pens */
+-#define MIMIO_PEN_E		(9)	/* big eraser */
+-#define MIMIO_PEN_ES		(10)	/* lil eraser */
+-#define MIMIO_PENJUMP_START	(10)
+-#define MIMIO_PENJUMP		(6)
+-#define MIMIO_PEN_I		(17)	/* mimio interactive */
+-#define MIMIO_PEN_IL		(18)	/* mimio interactive button 1 */
+-#define MIMIO_PEN_IR		(19)	/* mimio interactive button 2 */
+-
+-#define MIMIO_PEN_MAX		(MIMIO_PEN_IR)
+-
+-#define ACC_DONE		(0)
+-#define ACC_NEWPAGE		(1)
+-#define ACC_TAGPAGE		(2)
+-#define ACC_PRINTPAGE		(4)
+-#define ACC_MAXIMIZE		(8)
+-#define ACC_FINDCTLPNL		(16)
+-
+-#define isvalidtxsize(n)	((n) > 0 && (n) <= MIMIO_MAXPAYLOAD)
+-
+-
+-struct pktbuf {
+-	unsigned char instr;
+-	unsigned char buf[16];
+-	unsigned char *p;
+-	unsigned char *q;
+-};
+-
+-struct usbintendpt {
+-	dma_addr_t dma;
+-	struct urb *urb;
+-	unsigned char *buf;
+-	struct usb_endpoint_descriptor *desc;
+-};
+-
+-struct mimio {
+-	struct input_dev *idev;
+-	struct usb_device *udev;
+-	struct usb_interface *uifc;
+-	int open;
+-	int present;
+-	int greeted;
+-	int txflags;
+-	char phys[MIMIO_MAXNAMELEN];
+-	struct usbintendpt in;
+-	struct usbintendpt out;
+-	struct pktbuf pktbuf;
+-	unsigned char minor;
+-	wait_queue_head_t waitq;
+-	spinlock_t txlock;
+-	void (*rxhandler)(struct mimio *, unsigned char *, unsigned int);
+-	int last_pen_down;
+-};
+-
+-static void mimio_close(struct input_dev *);
+-static void mimio_dealloc(struct mimio *);
+-static void mimio_disconnect(struct usb_interface *);
+-static int mimio_greet(struct mimio *);
+-static void mimio_irq_in(struct urb *);
+-static void mimio_irq_out(struct urb *);
+-static int mimio_open(struct input_dev *);
+-static int mimio_probe(struct usb_interface *, const struct usb_device_id *);
+-static void mimio_rx_handler(struct mimio *, unsigned char *, unsigned int);
+-static int mimio_tx(struct mimio *, const char *, int);
+-
+-static char mimio_name[] = "VirtualInk mimio-Xi";
+-static struct usb_device_id mimio_table [] = {
+-	{ USB_DEVICE(MIMIO_VENDOR_ID, MIMIO_PRODUCT_ID) },
+-	{ USB_DEVICE(0x0525, 0xa4a0) }, /* gadget zero firmware */
+-	{ }
+-};
+-
+-MODULE_DEVICE_TABLE(usb, mimio_table);
+-
+-static struct usb_driver mimio_driver = {
+-	.name = "mimio",
+-	.probe = mimio_probe,
+-	.disconnect = mimio_disconnect,
+-	.id_table = mimio_table,
+-};
+-
+-static DECLARE_MUTEX(disconnect_sem);
+-
+-static void mimio_close(struct input_dev *idev)
+-{
+-	struct mimio *mimio;
+-
+-	mimio = input_get_drvdata(idev);
+-	if (!mimio) {
+-		dev_err(&idev->dev, "null mimio attached to input device\n");
+-		return;
+-	}
+-
+-	if (mimio->open <= 0)
+-		dev_err(&idev->dev, "mimio not open.\n");
+-	else
+-		mimio->open--;
+-
+-	if (mimio->present == 0 && mimio->open == 0)
+-		mimio_dealloc(mimio);
+-}
+-
+-static void mimio_dealloc(struct mimio *mimio)
+-{
+-	if (mimio == NULL)
+-		return;
+-
+-	usb_kill_urb(mimio->in.urb);
+-
+-	usb_kill_urb(mimio->out.urb);
+-
+-	if (mimio->idev) {
+-		input_unregister_device(mimio->idev);
+-		if (mimio->idev->grab)
+-			input_close_device(mimio->idev->grab);
+-		else
+-			dev_dbg(&mimio->idev->dev, "mimio->idev->grab == NULL"
+-				" -- didn't call input_close_device\n");
+-	}
+-
+-	usb_free_urb(mimio->in.urb);
+-
+-	usb_free_urb(mimio->out.urb);
+-
+-	if (mimio->in.buf) {
+-		usb_buffer_free(mimio->udev, MIMIO_MAXPAYLOAD, mimio->in.buf,
+-				mimio->in.dma);
+-	}
+-
+-	if (mimio->out.buf)
+-		usb_buffer_free(mimio->udev, MIMIO_MAXPAYLOAD, mimio->out.buf,
+-				mimio->out.dma);
+-
+-	if (mimio->idev)
+-		input_free_device(mimio->idev);
+-
+-	kfree(mimio);
+-}
+-
+-static void mimio_disconnect(struct usb_interface *ifc)
+-{
+-	struct mimio *mimio;
+-
+-	down(&disconnect_sem);
+-
+-	mimio = usb_get_intfdata(ifc);
+-	usb_set_intfdata(ifc, NULL);
+-	dev_dbg(&mimio->idev->dev, "disconnect\n");
+-
+-	if (mimio) {
+-		mimio->present = 0;
+-
+-		if (mimio->open <= 0)
+-			mimio_dealloc(mimio);
+-	}
+-
+-	up(&disconnect_sem);
+-}
+-
+-static int mimio_greet(struct mimio *mimio)
+-{
+-	const struct grtpkt {
+-		int nbytes;
+-		unsigned delay;
+-		char data[8];
+-	} grtpkts[] = {
+-		{ 3, 0, { 0x11, 0x55, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00 } },
+-		{ 5, 0, { 0x53, 0x55, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00 } },
+-		{ 5, 0, { 0x43, 0x55, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00 } },
+-		{ 5, 0, { 0x33, 0x55, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00 } },
+-		{ 5, 0, { 0x13, 0x00, 0x5e, 0x02, 0x4f, 0x00, 0x00, 0x00 } },
+-		{ 5, 0, { 0x13, 0x00, 0x04, 0x03, 0x14, 0x00, 0x00, 0x00 } },
+-		{ 5, 2, { 0x13, 0x00, 0x00, 0x04, 0x17, 0x00, 0x00, 0x00 } },
+-		{ 5, 0, { 0x13, 0x00, 0x0d, 0x08, 0x16, 0x00, 0x00, 0x00 } },
+-		{ 5, 0, { 0x13, 0x00, 0x4d, 0x01, 0x5f, 0x00, 0x00, 0x00 } },
+-		{ 3, 0, { 0xf1, 0x55, 0xa4, 0x00, 0x00, 0x00, 0x00, 0x00 } },
+-		{ 7, 2, { 0x52, 0x55, 0x00, 0x07, 0x31, 0x55, 0x64, 0x00 } },
+-		{ 0, 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
+-	};
+-	int rslt;
+-	const struct grtpkt *pkt;
+-
+-	for (pkt = grtpkts; pkt->nbytes; pkt++) {
+-		rslt = mimio_tx(mimio, pkt->data, pkt->nbytes);
+-		if (rslt)
+-			return rslt;
+-		if (pkt->delay)
+-			msleep(pkt->delay);
+-	}
+-
+-	return 0;
+-}
+-
+-static void mimio_irq_in(struct urb *urb)
+-{
+-	int rslt;
+-	char *data;
+-	const char *reason = "going down";
+-	struct mimio *mimio;
+-
+-	mimio = urb->context;
+-
+-	if (mimio == NULL)
+-		/* paranoia */
+-		return;
+-
+-	switch (urb->status) {
+-	case 0:
+-		/* success */
+-		break;
+-	case -ETIMEDOUT:
+-		reason = "timeout -- unplugged?";
+-	case -ECONNRESET:
+-	case -ENOENT:
+-	case -ESHUTDOWN:
+-		dev_dbg(&mimio->idev->dev, "%s.\n", reason);
+-		return;
+-	default:
+-		dev_dbg(&mimio->idev->dev, "unknown urb-status: %d.\n",
+-			urb->status);
+-		goto exit;
+-	}
+-	data = mimio->in.buf;
+-
+-	if (mimio->rxhandler)
+-		mimio->rxhandler(mimio, data, urb->actual_length);
+-exit:
+-	/*
+-	 * Keep listening to device on same urb.
+-	 */
+-	rslt = usb_submit_urb(urb, GFP_ATOMIC);
+-	if (rslt)
+-		dev_err(&mimio->idev->dev, "usb_submit_urb failure: %d.\n",
+-			rslt);
+-}
+-
+-static void mimio_irq_out(struct urb *urb)
+-{
+-	unsigned long flags;
+-	struct mimio *mimio;
+-
+-	mimio = urb->context;
+-
+-	if (urb->status)
+-		dev_dbg(&mimio->idev->dev, "urb-status: %d.\n", urb->status);
+-
+-	spin_lock_irqsave(&mimio->txlock, flags);
+-	mimio->txflags |= MIMIO_TXDONE;
+-	spin_unlock_irqrestore(&mimio->txlock, flags);
+-	wmb();
+-	wake_up(&mimio->waitq);
+-}
+-
+-static int mimio_open(struct input_dev *idev)
+-{
+-	int rslt;
+-	struct mimio *mimio;
+-
+-	rslt = 0;
+-	down(&disconnect_sem);
+-	mimio = input_get_drvdata(idev);
+-	dev_dbg(&idev->dev, "mimio_open\n");
+-
+-	if (mimio == NULL) {
+-		dev_err(&idev->dev, "null mimio.\n");
+-		rslt = -ENODEV;
+-		goto exit;
+-	}
+-
+-	if (mimio->open++)
+-		goto exit;
+-
+-	if (mimio->present && !mimio->greeted) {
+-		struct urb *urb = mimio->in.urb;
+-		mimio->in.urb->dev = mimio->udev;
+-		rslt = usb_submit_urb(mimio->in.urb, GFP_KERNEL);
+-		if (rslt) {
+-			dev_err(&idev->dev, "usb_submit_urb failure "
+-				"(res = %d: %s). Not greeting.\n",
+-				rslt,
+-				(!urb ? "urb is NULL" :
+-				 (urb->hcpriv ? "urb->hcpriv is non-NULL" :
+-				  (!urb->complete ? "urb is not complete" :
+-				   (urb->number_of_packets <= 0 ? "urb has no packets" :
+-				    (urb->interval <= 0 ? "urb interval too small" :
+-				     "urb interval too large or some other error"))))));
+-			rslt = -EIO;
+-			goto exit;
+-		}
+-		rslt = mimio_greet(mimio);
+-		if (rslt == 0) {
+-			dev_dbg(&idev->dev, "Mimio greeted OK.\n");
+-			mimio->greeted = 1;
+-		} else {
+-			dev_dbg(&idev->dev, "Mimio greet Failure (%d)\n",
+-				rslt);
+-		}
+-	}
+-
+-exit:
+-	up(&disconnect_sem);
+-	return rslt;
+-}
+-
+-static int mimio_probe(struct usb_interface *ifc,
+-		       const struct usb_device_id *id)
+-{
+-	char path[64];
+-	int pipe, maxp;
+-	struct mimio *mimio;
+-	struct usb_device *udev;
+-	struct usb_host_interface *hostifc;
+-	struct input_dev *input_dev;
+-	int res = 0;
+-	int i;
+-
+-	udev = interface_to_usbdev(ifc);
+-
+-	mimio = kzalloc(sizeof(struct mimio), GFP_KERNEL);
+-	if (!mimio)
+-		return -ENOMEM;
+-
+-	input_dev = input_allocate_device();
+-	if (!input_dev) {
+-		mimio_dealloc(mimio);
+-		return -ENOMEM;
+-	}
+-
+-	mimio->uifc = ifc;
+-	mimio->udev = udev;
+-	mimio->pktbuf.p = mimio->pktbuf.buf;
+-	mimio->pktbuf.q = mimio->pktbuf.buf;
+-	/* init_input_dev(mimio->idev); */
+-	mimio->idev = input_dev;
+-	init_waitqueue_head(&mimio->waitq);
+-	spin_lock_init(&mimio->txlock);
+-	hostifc = ifc->cur_altsetting;
+-
+-	if (hostifc->desc.bNumEndpoints != 2) {
+-		dev_err(&udev->dev, "Unexpected endpoint count: %d.\n",
+-			hostifc->desc.bNumEndpoints);
+-		mimio_dealloc(mimio);
+-		return -ENODEV;
+-	}
+-
+-	mimio->in.desc = &(hostifc->endpoint[0].desc);
+-	mimio->out.desc = &(hostifc->endpoint[1].desc);
+-
+-	mimio->in.buf = usb_buffer_alloc(udev, MIMIO_MAXPAYLOAD, GFP_KERNEL,
+-					 &mimio->in.dma);
+-	mimio->out.buf = usb_buffer_alloc(udev, MIMIO_MAXPAYLOAD, GFP_KERNEL,
+-					  &mimio->out.dma);
+-
+-	if (mimio->in.buf == NULL || mimio->out.buf == NULL) {
+-		dev_err(&udev->dev, "usb_buffer_alloc failure.\n");
+-		mimio_dealloc(mimio);
+-		return -ENOMEM;
+-	}
+-
+-	mimio->in.urb = usb_alloc_urb(0, GFP_KERNEL);
+-	mimio->out.urb = usb_alloc_urb(0, GFP_KERNEL);
+-
+-	if (mimio->in.urb == NULL || mimio->out.urb == NULL) {
+-		dev_err(&udev->dev, "usb_alloc_urb failure.\n");
+-		mimio_dealloc(mimio);
+-		return -ENOMEM;
+-	}
+-
+-	/*
+-	 * Build the input urb.
+-	 */
+-	pipe = usb_rcvintpipe(udev, mimio->in.desc->bEndpointAddress);
+-	maxp = usb_maxpacket(udev, pipe, usb_pipeout(pipe));
+-	if (maxp > MIMIO_MAXPAYLOAD)
+-		maxp = MIMIO_MAXPAYLOAD;
+-	usb_fill_int_urb(mimio->in.urb, udev, pipe, mimio->in.buf, maxp,
+-			 mimio_irq_in, mimio, mimio->in.desc->bInterval);
+-	mimio->in.urb->transfer_dma = mimio->in.dma;
+-	mimio->in.urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
+-
+-	/*
+-	 * Build the output urb.
+-	 */
+-	pipe = usb_sndintpipe(udev, mimio->out.desc->bEndpointAddress);
+-	maxp = usb_maxpacket(udev, pipe, usb_pipeout(pipe));
+-	if (maxp > MIMIO_MAXPAYLOAD)
+-		maxp = MIMIO_MAXPAYLOAD;
+-	usb_fill_int_urb(mimio->out.urb, udev, pipe, mimio->out.buf, maxp,
+-			 mimio_irq_out, mimio, mimio->out.desc->bInterval);
+-	mimio->out.urb->transfer_dma = mimio->out.dma;
+-	mimio->out.urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
+-
+-	/*
+-	 * Build input device info
+-	 */
+-	usb_make_path(udev, path, 64);
+-	snprintf(mimio->phys, MIMIO_MAXNAMELEN, "%s/input0", path);
+-	input_set_drvdata(input_dev, mimio);
+-	/* input_dev->dev = &ifc->dev; */
+-	input_dev->open = mimio_open;
+-	input_dev->close = mimio_close;
+-	input_dev->name = mimio_name;
+-	input_dev->phys = mimio->phys;
+-	input_dev->dev.parent = &ifc->dev;
+-
+-	input_dev->id.bustype = BUS_USB;
+-	input_dev->id.vendor = le16_to_cpu(udev->descriptor.idVendor);
+-	input_dev->id.product = le16_to_cpu(udev->descriptor.idProduct);
+-	input_dev->id.version = le16_to_cpu(udev->descriptor.bcdDevice);
+-
+-	input_dev->evbit[0] |= BIT(EV_KEY) | BIT(EV_ABS);
+-	for (i = BTN_TOOL_PEN; i <= LOCALBTN_TOOL_EXTRA2; ++i)
+-		set_bit(i, input_dev->keybit);
+-
+-	input_dev->keybit[BIT_WORD(BTN_MISC)] |= BIT_MASK(BTN_0) |
+-						 BIT_MASK(BTN_1) |
+-						 BIT_MASK(BTN_2) |
+-						 BIT_MASK(BTN_3) |
+-						 BIT_MASK(BTN_4) |
+-						 BIT_MASK(BTN_5);
+-	/*   input_dev->keybit[BTN_MOUSE] |= BIT(BTN_LEFT); */
+-	input_dev->absbit[0] |= BIT_MASK(ABS_X) | BIT_MASK(ABS_Y);
+-	input_set_abs_params(input_dev, ABS_X, 0, MIMIO_XRANGE_MAX, 0, 0);
+-	input_set_abs_params(input_dev, ABS_Y, 0, MIMIO_YRANGE_MAX, 0, 0);
+-	input_dev->absbit[BIT_WORD(ABS_MISC)] |= BIT_MASK(ABS_MISC);
+-
+-#if 0
+-	input_dev->absmin[ABS_X] = 0;
+-	input_dev->absmin[ABS_Y] = 0;
+-	input_dev->absmax[ABS_X] = 9600;
+-	input_dev->absmax[ABS_Y] = 4800;
+-	input_dev->absfuzz[ABS_X] = 0;
+-	input_dev->absfuzz[ABS_Y] = 0;
+-	input_dev->absflat[ABS_X] = 0;
+-	input_dev->absflat[ABS_Y] = 0;
+-#endif
+-
+-#if 0
+-	/* this will just reduce the precision */
+-	input_dev->absfuzz[ABS_X] = 8; /* experimental; may need to change */
+-	input_dev->absfuzz[ABS_Y] = 8; /* experimental; may need to change */
+-#endif
+-
+-	/*
+-	 * Register the input device.
+-	 */
+-	res = input_register_device(mimio->idev);
+-	if (res) {
+-		dev_err(&udev->dev, "input_register_device failure (%d)\n",
+-			res);
+-		mimio_dealloc(mimio);
+-		return -EIO;
+-	}
+-	dev_dbg(&mimio->idev->dev, "input: %s on %s (res = %d).\n",
+-		input_dev->name, input_dev->phys, res);
+-
+-	usb_set_intfdata(ifc, mimio);
+-	mimio->present = 1;
+-
+-	/*
+-	 * Submit the input urb to the usb subsystem.
+-	 */
+-	mimio->in.urb->dev = mimio->udev;
+-	res = usb_submit_urb(mimio->in.urb, GFP_KERNEL);
+-	if (res) {
+-		dev_err(&mimio->idev->dev, "usb_submit_urb failure (%d)\n",
+-			res);
+-		mimio_dealloc(mimio);
+-		return -EIO;
+-	}
+-
+-	/*
+-	 * Attempt to greet the mimio after giving
+-	 * it some post-init settling time.
+-	 *
+-	 * note: sometimes this sleep interval isn't
+-	 * long enough to permit the device to re-init
+-	 * after a hot-swap; maybe need to bump it up.
+-	 *
+-	 * As it is, this probably breaks module unloading support!
+-	 */
+-	msleep(1024);
+-
+-	res = mimio_greet(mimio);
+-	if (res == 0) {
+-		dev_dbg(&mimio->idev->dev, "Mimio greeted OK.\n");
+-		mimio->greeted = 1;
+-		mimio->rxhandler = mimio_rx_handler;
+-	} else {
+-		dev_dbg(&mimio->idev->dev, "Mimio greet Failure (%d)\n", res);
+-	}
+-
+-	return 0;
+-}
+-
+-static int handle_mimio_rx_penupdown(struct mimio *mimio,
+-				     int down,
+-				     const char *const instr[],
+-				     const int instr_ofst[])
+-{
+-	int penid, x;
+-	if (mimio->pktbuf.q - mimio->pktbuf.p < (down ? 4 : 3))
+-		return 1; 		/* partial pkt */
+-
+-	if (down) {
+-		x = *mimio->pktbuf.p ^ *(mimio->pktbuf.p + 1) ^
+-			*(mimio->pktbuf.p + 2);
+-		if (x != *(mimio->pktbuf.p + 3)) {
+-			dev_dbg(&mimio->idev->dev, "EV_PEN%s: bad xsum.\n",
+-				down ? "DOWN":"UP");
+-			/* skip this event data */
+-			mimio->pktbuf.p += 4;
+-			/* decode any remaining events */
+-			return 0;
+-		}
+-		penid = mimio->pktbuf.instr = *(mimio->pktbuf.p + 2);
+-		if (penid > MIMIO_PEN_MAX) {
+-			dev_dbg(&mimio->idev->dev,
+-				"Unmapped penID (not in [0, %d]): %d\n",
+-				MIMIO_PEN_MAX, (int)mimio->pktbuf.instr);
+-			penid = mimio->pktbuf.instr = 0;
+-		}
+-		mimio->last_pen_down = penid;
+-	} else {
+-		penid = mimio->last_pen_down;
+-	}
+-	dev_dbg(&mimio->idev->dev, "%s (id %d, code %d) %s.\n", instr[penid],
+-		instr_ofst[penid], penid, down ? "down" : "up");
+-
+-	if (instr_ofst[penid] >= 0) {
+-		int code = BTN_TOOL_PEN + instr_ofst[penid];
+-		int value = down ? DOWNVALUE : UPVALUE;
+-		if (code > KEY_MAX)
+-			dev_dbg(&mimio->idev->dev, "input_event will ignore "
+-				"-- code (%d) > KEY_MAX\n", code);
+-		if (!test_bit(code, mimio->idev->keybit))
+-			dev_dbg(&mimio->idev->dev, "input_event will ignore "
+-				"-- bit for code (%d) not enabled\n", code);
+-		if (!!test_bit(code, mimio->idev->key) == value)
+-			dev_dbg(&mimio->idev->dev, "input_event will ignore "
+-				"-- bit for code (%d) already set to %d\n",
+-				code, value);
+-		if (value != DOWNVALUE) {
+-			/* input_regs(mimio->idev, regs); */
+-			input_report_key(mimio->idev, code, value);
+-			input_sync(mimio->idev);
+-		} else {
+-			/* wait until we get some coordinates */
+-		}
+-	} else {
+-		dev_dbg(&mimio->idev->dev, "penID offset[%d] == %d is < 0 "
+-			"- not sending\n", penid, instr_ofst[penid]);
+-	}
+-	mimio->pktbuf.p += down ? 4 : 3; /* 3 for up, 4 for down */
+-	return 0;
+-}
+-
+-/*
+- * Stay tuned for partial-packet excitement.
+- *
+- * This routine buffers data packets received from the mimio device
+- * in the mimio's data space.  This buffering is necessary because
+- * the mimio's in endpoint can serve us partial packets of data, and
+- * we want the driver to support the servicing of multiple mimios.
+- * Empirical evidence gathered so far suggests that the method of
+- * buffering packet data in the mimio's data space works.  Previous
+- * versions of this driver did not buffer packet data in each mimio's
+- * data-space, and were therefore not able to service multiple mimios.
+- * Note that since the caller of this routine is running in interrupt
+- * context, care needs to be taken to ensure that this routine does not
+- * become bloated, and it may be that another spinlock is needed in each
+- * mimio to guard the buffered packet data properly.
+- */
+-static void mimio_rx_handler(struct mimio *mimio,
+-			     unsigned char *data,
+-			     unsigned int nbytes)
+-{
+-	struct device *dev = &mimio->idev->dev;
+-	unsigned int x;
+-	unsigned int y;
+-	static const char * const instr[] = {
+-		"?0",
+-		"black pen", "blue pen", "green pen", "red pen",
+-		"brown pen", "orange pen", "purple pen", "yellow pen",
+-		"big eraser", "lil eraser",
+-		"?11", "?12", "?13", "?14", "?15", "?16",
+-		"mimio interactive", "interactive button1",
+-		"interactive button2"
+-	};
+-
+-	/* Mimio Interactive gives:
+-	 * down: [0x22 0x01 0x11 0x32 0x24]
+-	 * b1  : [0x22 0x01 0x12 0x31 0x24]
+-	 * b2  : [0x22 0x01 0x13 0x30 0x24]
+-	 */
+-	static const int instr_ofst[] = {
+-		-1,
+-		0, 1, 2, 3,
+-		9, 9, 9, 9,
+-		4, 5,
+-		-1, -1, -1, -1, -1, -1,
+-		6, 7, 8,
+-	};
+-
+-	memcpy(mimio->pktbuf.q, data, nbytes);
+-	mimio->pktbuf.q += nbytes;
+-
+-	while (mimio->pktbuf.p < mimio->pktbuf.q) {
+-		int t = *mimio->pktbuf.p;
+-		switch (t) {
+-		case MIMIO_EV_PENUP:
+-		case MIMIO_EV_PENDOWN:
+-			if (handle_mimio_rx_penupdown(mimio,
+-						      t == MIMIO_EV_PENDOWN,
+-						      instr, instr_ofst))
+-				return; /* partial packet */
+-			break;
+-
+-		case MIMIO_EV_PENDATA:
+-			if (mimio->pktbuf.q - mimio->pktbuf.p < 6)
+-				/* partial pkt */
+-				return;
+-			x = *mimio->pktbuf.p ^ *(mimio->pktbuf.p + 1) ^
+-				*(mimio->pktbuf.p + 2) ^
+-				*(mimio->pktbuf.p + 3) ^
+-				*(mimio->pktbuf.p + 4);
+-			if (x != *(mimio->pktbuf.p + 5)) {
+-				dev_dbg(dev, "EV_PENDATA: bad xsum.\n");
+-				mimio->pktbuf.p += 6; /* skip this event data */
+-				break; /* decode any remaining events */
+-			}
+-			x = *(mimio->pktbuf.p + 1);
+-			x <<= 8;
+-			x |= *(mimio->pktbuf.p + 2);
+-			y = *(mimio->pktbuf.p + 3);
+-			y <<= 8;
+-			y |= *(mimio->pktbuf.p + 4);
+-			dev_dbg(dev, "coord: (%d, %d)\n", x, y);
+-			if (instr_ofst[mimio->pktbuf.instr] >= 0) {
+-				int code = BTN_TOOL_PEN +
+-					   instr_ofst[mimio->last_pen_down];
+-#if 0
+-				/* Utter hack to ensure we get forwarded _AND_
+-				 * so we can identify when a complete signal is
+-				 * received */
+-				mimio->idev->abs[ABS_Y] = -1;
+-				mimio->idev->abs[ABS_X] = -1;
+-#endif
+-				/* input_regs(mimio->idev, regs); */
+-				input_report_abs(mimio->idev, ABS_X, x);
+-				input_report_abs(mimio->idev, ABS_Y, y);
+-				/* fake a penup */
+-				change_bit(code, mimio->idev->key);
+-				input_report_key(mimio->idev,
+-						 code,
+-						 DOWNVALUE);
+-				/* always sync here */
+-				mimio->idev->sync = 0;
+-				input_sync(mimio->idev);
+-			}
+-			mimio->pktbuf.p += 6;
+-			break;
+-		case MIMIO_EV_MEMRESET:
+-			if (mimio->pktbuf.q - mimio->pktbuf.p < 7)
+-				/* partial pkt */
+-				return;
+-			dev_dbg(dev, "mem-reset.\n");
+-			/* input_regs(mimio->idev, regs); */
+-			input_event(mimio->idev, EV_KEY, BTN_0, 1);
+-			input_event(mimio->idev, EV_KEY, BTN_0, 0);
+-			input_sync(mimio->idev);
+-			mimio->pktbuf.p += 7;
+-			break;
+-		case MIMIO_EV_ACC:
+-			if (mimio->pktbuf.q - mimio->pktbuf.p < 4)
+-				/* partial pkt */
+-				return;
+-			x = *mimio->pktbuf.p ^ *(mimio->pktbuf.p + 1) ^
+-				*(mimio->pktbuf.p + 2);
+-			if (x != *(mimio->pktbuf.p + 3)) {
+-				dev_dbg(dev, "EV_ACC: bad xsum.\n");
+-				mimio->pktbuf.p += 4; /* skip this event data */
+-				break; /* decode any remaining events */
+-			}
+-			switch (*(mimio->pktbuf.p + 2)) {
+-			case ACC_NEWPAGE:
+-				dev_dbg(&mimio->idev->dev, "new-page.\n");
+-				/* input_regs(mimio->idev, regs); */
+-				input_event(mimio->idev, EV_KEY, BTN_1, 1);
+-				input_event(mimio->idev, EV_KEY, BTN_1, 0);
+-				input_sync(mimio->idev);
+-				break;
+-			case ACC_TAGPAGE:
+-				dev_dbg(&mimio->idev->dev, "tag-page.\n");
+-				/* input_regs(mimio->idev, regs); */
+-				input_event(mimio->idev, EV_KEY, BTN_2, 1);
+-				input_event(mimio->idev, EV_KEY, BTN_2, 0);
+-				input_sync(mimio->idev);
+-				break;
+-			case ACC_PRINTPAGE:
+-				dev_dbg(&mimio->idev->dev, "print-page.\n");
+-				/* input_regs(mimio->idev, regs);*/
+-				input_event(mimio->idev, EV_KEY, BTN_3, 1);
+-				input_event(mimio->idev, EV_KEY, BTN_3, 0);
+-				input_sync(mimio->idev);
+-				break;
+-			case ACC_MAXIMIZE:
+-				dev_dbg(&mimio->idev->dev,
+-					"maximize-window.\n");
+-				/* input_regs(mimio->idev, regs); */
+-				input_event(mimio->idev, EV_KEY, BTN_4, 1);
+-				input_event(mimio->idev, EV_KEY, BTN_4, 0);
+-				input_sync(mimio->idev);
+-				break;
+-			case ACC_FINDCTLPNL:
+-				dev_dbg(&mimio->idev->dev, "find-ctl-panel.\n");
+-				/* input_regs(mimio->idev, regs); */
+-				input_event(mimio->idev, EV_KEY, BTN_5, 1);
+-				input_event(mimio->idev, EV_KEY, BTN_5, 0);
+-				input_sync(mimio->idev);
+-				break;
+-			case ACC_DONE:
+-				dev_dbg(&mimio->idev->dev, "acc-done.\n");
+-				/* no event is dispatched to the input
+-				 * subsystem for this device event.
+-				 */
+-				break;
+-			default:
+-				dev_dbg(dev, "unknown acc event.\n");
+-				break;
+-			}
+-			mimio->pktbuf.p += 4;
+-			break;
+-		default:
+-			mimio->pktbuf.p++;
+-			break;
+-		}
+-	}
+-
+-	/*
+-	 * No partial event was received, so reset mimio's pktbuf ptrs.
+-	 */
+-	mimio->pktbuf.p = mimio->pktbuf.q = mimio->pktbuf.buf;
+-}
+-
+-static int mimio_tx(struct mimio *mimio, const char *buf, int nbytes)
+-{
+-	int rslt;
+-	int timeout;
+-	unsigned long flags;
+-	DECLARE_WAITQUEUE(wait, current);
+-
+-	if (!(isvalidtxsize(nbytes))) {
+-		dev_err(&mimio->idev->dev, "invalid arg: nbytes: %d.\n",
+-			nbytes);
+-		return -EINVAL;
+-	}
+-
+-	/*
+-	 * Init the out urb and copy the data to send.
+-	 */
+-	mimio->out.urb->dev = mimio->udev;
+-	mimio->out.urb->transfer_buffer_length = nbytes;
+-	memcpy(mimio->out.urb->transfer_buffer, buf, nbytes);
+-
+-	/*
+-	 * Send the data.
+-	 */
+-	spin_lock_irqsave(&mimio->txlock, flags);
+-	mimio->txflags = MIMIO_TXWAIT;
+-	rslt = usb_submit_urb(mimio->out.urb, GFP_ATOMIC);
+-	spin_unlock_irqrestore(&mimio->txlock, flags);
+-	dev_dbg(&mimio->idev->dev, "rslt: %d.\n", rslt);
+-
+-	if (rslt) {
+-		dev_err(&mimio->idev->dev, "usb_submit_urb failure: %d.\n",
+-			rslt);
+-		return rslt;
+-	}
+-
+-	/*
+-	 * Wait for completion to be signalled (the mimio_irq_out
+-	 * completion routine will or MIMIO_TXDONE in with txflags).
+-	 */
+-	timeout = HZ;
+-	set_current_state(TASK_INTERRUPTIBLE);
+-	add_wait_queue(&mimio->waitq, &wait);
+-
+-	while (timeout && ((mimio->txflags & MIMIO_TXDONE) == 0)) {
+-		timeout = schedule_timeout(timeout);
+-		rmb();
+-	}
+-
+-	if ((mimio->txflags & MIMIO_TXDONE) == 0)
+-		dev_dbg(&mimio->idev->dev, "tx timed out.\n");
+-
+-	/*
+-	 * Now that completion has been signalled,
+-	 * unlink the urb so that it can be recycled.
+-	 */
+-	set_current_state(TASK_RUNNING);
+-	remove_wait_queue(&mimio->waitq, &wait);
+-	usb_unlink_urb(mimio->out.urb);
+-
+-	return rslt;
+-}
+-
+-static int __init mimio_init(void)
+-{
+-	int rslt;
+-
+-	rslt = usb_register(&mimio_driver);
+-	if (rslt != 0) {
+-		err("%s: usb_register failure: %d", __func__, rslt);
+-		return rslt;
+-	}
+-
+-	printk(KERN_INFO KBUILD_MODNAME ":"
+-	       DRIVER_DESC " " DRIVER_VERSION "\n");
+-	return rslt;
+-}
+-
+-static void __exit mimio_exit(void)
+-{
+-	usb_deregister(&mimio_driver);
+-}
+-
+-module_init(mimio_init);
+-module_exit(mimio_exit);
+-
+-MODULE_AUTHOR(DRIVER_AUTHOR);
+-MODULE_DESCRIPTION(DRIVER_DESC);
+-MODULE_LICENSE("GPL");
+diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
+index 4f86447..5d80d5e 100644
+--- a/drivers/usb/core/driver.c
++++ b/drivers/usb/core/driver.c
+@@ -625,9 +625,6 @@ static int usb_uevent(struct device *dev, struct kobj_uevent_env *env)
+ {
+ 	struct usb_device *usb_dev;
+ 
+-	/* driver is often null here; dev_dbg() would oops */
+-	pr_debug("usb %s: uevent\n", dev_name(dev));
+-
+ 	if (is_usb_device(dev)) {
+ 		usb_dev = to_usb_device(dev);
+ 	} else if (is_usb_interface(dev)) {
+@@ -639,6 +636,7 @@ static int usb_uevent(struct device *dev, struct kobj_uevent_env *env)
+ 	}
+ 
+ 	if (usb_dev->devnum < 0) {
++		/* driver is often null here; dev_dbg() would oops */
+ 		pr_debug("usb %s: already deleted?\n", dev_name(dev));
+ 		return -ENODEV;
+ 	}
+diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
+index 34de475..24e6205 100644
+--- a/drivers/usb/core/hcd.c
++++ b/drivers/usb/core/hcd.c
+@@ -140,7 +140,7 @@ static const u8 usb3_rh_dev_descriptor[18] = {
+ 	0x09,       /*  __u8  bMaxPacketSize0; 2^9 = 512 Bytes */
+ 
+ 	0x6b, 0x1d, /*  __le16 idVendor; Linux Foundation */
+-	0x02, 0x00, /*  __le16 idProduct; device 0x0002 */
++	0x03, 0x00, /*  __le16 idProduct; device 0x0003 */
+ 	KERNEL_VER, KERNEL_REL, /*  __le16 bcdDevice */
+ 
+ 	0x03,       /*  __u8  iManufacturer; */
+diff --git a/drivers/usb/core/hcd.h b/drivers/usb/core/hcd.h
+index 79782a1..bcbe104 100644
+--- a/drivers/usb/core/hcd.h
++++ b/drivers/usb/core/hcd.h
+@@ -234,7 +234,7 @@ struct hc_driver {
+ 	/* xHCI specific functions */
+ 		/* Called by usb_alloc_dev to alloc HC device structures */
+ 	int	(*alloc_dev)(struct usb_hcd *, struct usb_device *);
+-		/* Called by usb_release_dev to free HC device structures */
++		/* Called by usb_disconnect to free HC device structures */
+ 	void	(*free_dev)(struct usb_hcd *, struct usb_device *);
+ 
+ 	/* Bandwidth computation functions */
+diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
+index 1a7d54b..ed3aa7a 100644
+--- a/drivers/usb/core/hub.c
++++ b/drivers/usb/core/hub.c
+@@ -1508,6 +1508,15 @@ static inline void usb_stop_pm(struct usb_device *udev)
+ 
+ #endif
+ 
++static void hub_free_dev(struct usb_device *udev)
++{
++	struct usb_hcd *hcd = bus_to_hcd(udev->bus);
++
++	/* Root hubs aren't real devices, so don't free HCD resources */
++	if (hcd->driver->free_dev && udev->parent)
++		hcd->driver->free_dev(hcd, udev);
++}
++
+ /**
+  * usb_disconnect - disconnect a device (usbcore-internal)
+  * @pdev: pointer to device being disconnected
+@@ -1578,6 +1587,8 @@ void usb_disconnect(struct usb_device **pdev)
+ 
+ 	usb_stop_pm(udev);
+ 
++	hub_free_dev(udev);
++
+ 	put_device(&udev->dev);
+ }
+ 
+@@ -3130,6 +3141,7 @@ loop_disable:
+ loop:
+ 		usb_ep0_reinit(udev);
+ 		release_address(udev);
++		hub_free_dev(udev);
+ 		usb_put_dev(udev);
+ 		if ((status == -ENOTCONN) || (status == -ENOTSUPP))
+ 			break;
+diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
+index 52e5e31..ab2d3e7 100644
+--- a/drivers/usb/core/usb.c
++++ b/drivers/usb/core/usb.c
+@@ -191,9 +191,6 @@ static void usb_release_dev(struct device *dev)
+ 	hcd = bus_to_hcd(udev->bus);
+ 
+ 	usb_destroy_configuration(udev);
+-	/* Root hubs aren't real devices, so don't free HCD resources */
+-	if (hcd->driver->free_dev && udev->parent)
+-		hcd->driver->free_dev(hcd, udev);
+ 	usb_put_hcd(hcd);
+ 	kfree(udev->product);
+ 	kfree(udev->manufacturer);
+diff --git a/drivers/usb/host/ohci-pnx4008.c b/drivers/usb/host/ohci-pnx4008.c
+index 100bf3d..1f1d4fa 100644
+--- a/drivers/usb/host/ohci-pnx4008.c
++++ b/drivers/usb/host/ohci-pnx4008.c
+@@ -327,7 +327,7 @@ static int __devinit usb_hcd_pnx4008_probe(struct platform_device *pdev)
+ 	}
+ 	i2c_adap = i2c_get_adapter(2);
+ 	memset(&i2c_info, 0, sizeof(struct i2c_board_info));
+-	strlcpy(i2c_info.name, "isp1301_pnx", I2C_NAME_SIZE);
++	strlcpy(i2c_info.type, "isp1301_pnx", I2C_NAME_SIZE);
+ 	isp1301_i2c_client = i2c_new_probed_device(i2c_adap, &i2c_info,
+ 						   normal_i2c);
+ 	i2c_put_adapter(i2c_adap);
+@@ -411,7 +411,7 @@ out3:
+ out2:
+ 	clk_put(usb_clk);
+ out1:
+-	i2c_unregister_client(isp1301_i2c_client);
++	i2c_unregister_device(isp1301_i2c_client);
+ 	isp1301_i2c_client = NULL;
+ out_i2c_driver:
+ 	i2c_del_driver(&isp1301_driver);
+@@ -430,7 +430,7 @@ static int usb_hcd_pnx4008_remove(struct platform_device *pdev)
+ 	pnx4008_unset_usb_bits();
+ 	clk_disable(usb_clk);
+ 	clk_put(usb_clk);
+-	i2c_unregister_client(isp1301_i2c_client);
++	i2c_unregister_device(isp1301_i2c_client);
+ 	isp1301_i2c_client = NULL;
+ 	i2c_del_driver(&isp1301_driver);
+ 
+diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c
+index 99cd00f..0919706 100644
+--- a/drivers/usb/host/uhci-hcd.c
++++ b/drivers/usb/host/uhci-hcd.c
+@@ -735,6 +735,7 @@ static void uhci_stop(struct usb_hcd *hcd)
+ 		uhci_hc_died(uhci);
+ 	uhci_scan_schedule(uhci);
+ 	spin_unlock_irq(&uhci->lock);
++	synchronize_irq(hcd->irq);
+ 
+ 	del_timer_sync(&uhci->fsbr_timer);
+ 	release_uhci(uhci);
+diff --git a/drivers/usb/host/xhci-ext-caps.h b/drivers/usb/host/xhci-ext-caps.h
+index ecc131c..78c4eda 100644
+--- a/drivers/usb/host/xhci-ext-caps.h
++++ b/drivers/usb/host/xhci-ext-caps.h
+@@ -101,12 +101,15 @@ static inline int xhci_find_next_cap_offset(void __iomem *base, int ext_offset)
+ 
+ 	next = readl(base + ext_offset);
+ 
+-	if (ext_offset == XHCI_HCC_PARAMS_OFFSET)
++	if (ext_offset == XHCI_HCC_PARAMS_OFFSET) {
+ 		/* Find the first extended capability */
+ 		next = XHCI_HCC_EXT_CAPS(next);
+-	else
++		ext_offset = 0;
++	} else {
+ 		/* Find the next extended capability */
+ 		next = XHCI_EXT_CAPS_NEXT(next);
++	}
++
+ 	if (!next)
+ 		return 0;
+ 	/*
+diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c
+index 0025847..8b37a4b 100644
+--- a/drivers/usb/misc/sisusbvga/sisusb.c
++++ b/drivers/usb/misc/sisusbvga/sisusb.c
+@@ -3245,6 +3245,7 @@ static struct usb_device_id sisusb_table [] = {
+ 	{ USB_DEVICE(0x0711, 0x0902) },
+ 	{ USB_DEVICE(0x0711, 0x0903) },
+ 	{ USB_DEVICE(0x0711, 0x0918) },
++	{ USB_DEVICE(0x0711, 0x0920) },
+ 	{ USB_DEVICE(0x182d, 0x021c) },
+ 	{ USB_DEVICE(0x182d, 0x0269) },
+ 	{ }
+diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
+index bd254ec..7d920f2 100644
+--- a/drivers/usb/serial/cp210x.c
++++ b/drivers/usb/serial/cp210x.c
+@@ -91,11 +91,12 @@ static struct usb_device_id id_table [] = {
+ 	{ USB_DEVICE(0x10C4, 0x81C8) }, /* Lipowsky Industrie Elektronik GmbH, Baby-JTAG */
+ 	{ USB_DEVICE(0x10C4, 0x81E2) }, /* Lipowsky Industrie Elektronik GmbH, Baby-LIN */
+ 	{ USB_DEVICE(0x10C4, 0x81E7) }, /* Aerocomm Radio */
++	{ USB_DEVICE(0x10C4, 0x81E8) }, /* Zephyr Bioharness */
+ 	{ USB_DEVICE(0x10C4, 0x81F2) }, /* C1007 HF band RFID controller */
+ 	{ USB_DEVICE(0x10C4, 0x8218) }, /* Lipowsky Industrie Elektronik GmbH, HARP-1 */
+ 	{ USB_DEVICE(0x10C4, 0x822B) }, /* Modem EDGE(GSM) Comander 2 */
+ 	{ USB_DEVICE(0x10C4, 0x826B) }, /* Cygnal Integrated Products, Inc., Fasttrax GPS demostration module */
+-	{ USB_DEVICE(0x10c4, 0x8293) }, /* Telegesys ETRX2USB */
++	{ USB_DEVICE(0x10C4, 0x8293) }, /* Telegesys ETRX2USB */
+ 	{ USB_DEVICE(0x10C4, 0x82F9) }, /* Procyon AVS */
+ 	{ USB_DEVICE(0x10C4, 0x8341) }, /* Siemens MC35PU GPRS Modem */
+ 	{ USB_DEVICE(0x10C4, 0x8382) }, /* Cygnal Integrated Products, Inc. */
+diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
+index 13a1b39..ce937e7 100644
+--- a/drivers/usb/serial/ftdi_sio.c
++++ b/drivers/usb/serial/ftdi_sio.c
+@@ -44,12 +44,13 @@
+ #include <linux/serial.h>
+ #include <linux/usb/serial.h>
+ #include "ftdi_sio.h"
++#include "ftdi_sio_ids.h"
+ 
+ /*
+  * Version Information
+  */
+ #define DRIVER_VERSION "v1.5.0"
+-#define DRIVER_AUTHOR "Greg Kroah-Hartman <greg@kroah.com>, Bill Ryder <bryder@sgi.com>, Kuba Ober <kuba@mareimbrium.org>"
++#define DRIVER_AUTHOR "Greg Kroah-Hartman <greg@kroah.com>, Bill Ryder <bryder@sgi.com>, Kuba Ober <kuba@mareimbrium.org>, Andreas Mohr"
+ #define DRIVER_DESC "USB FTDI Serial Converters Driver"
+ 
+ static int debug;
+@@ -144,10 +145,15 @@ static struct ftdi_sio_quirk ftdi_HE_TIRA1_quirk = {
+ 
+ 
+ 
++/*
++ * Device ID not listed? Test via module params product/vendor or
++ * /sys/bus/usb/ftdi_sio/new_id, then send patch/report!
++ */
+ static struct usb_device_id id_table_combined [] = {
+ 	{ USB_DEVICE(FTDI_VID, FTDI_AMC232_PID) },
+ 	{ USB_DEVICE(FTDI_VID, FTDI_CANUSB_PID) },
+ 	{ USB_DEVICE(FTDI_VID, FTDI_CANDAPTER_PID) },
++	{ USB_DEVICE(FTDI_VID, FTDI_NXTCAM_PID) },
+ 	{ USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_0_PID) },
+ 	{ USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_1_PID) },
+ 	{ USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_2_PID) },
+@@ -551,9 +557,16 @@ static struct usb_device_id id_table_combined [] = {
+ 	{ USB_DEVICE(FTDI_VID, FTDI_IBS_PEDO_PID) },
+ 	{ USB_DEVICE(FTDI_VID, FTDI_IBS_PROD_PID) },
+ 	/*
+-	 * Due to many user requests for multiple ELV devices we enable
+-	 * them by default.
++	 * ELV devices:
+ 	 */
++	{ USB_DEVICE(FTDI_VID, FTDI_ELV_USR_PID) },
++	{ USB_DEVICE(FTDI_VID, FTDI_ELV_MSM1_PID) },
++	{ USB_DEVICE(FTDI_VID, FTDI_ELV_KL100_PID) },
++	{ USB_DEVICE(FTDI_VID, FTDI_ELV_WS550_PID) },
++	{ USB_DEVICE(FTDI_VID, FTDI_ELV_EC3000_PID) },
++	{ USB_DEVICE(FTDI_VID, FTDI_ELV_WS888_PID) },
++	{ USB_DEVICE(FTDI_VID, FTDI_ELV_TWS550_PID) },
++	{ USB_DEVICE(FTDI_VID, FTDI_ELV_FEM_PID) },
+ 	{ USB_DEVICE(FTDI_VID, FTDI_ELV_CLI7000_PID) },
+ 	{ USB_DEVICE(FTDI_VID, FTDI_ELV_PPS7330_PID) },
+ 	{ USB_DEVICE(FTDI_VID, FTDI_ELV_TFM100_PID) },
+@@ -570,11 +583,17 @@ static struct usb_device_id id_table_combined [] = {
+ 	{ USB_DEVICE(FTDI_VID, FTDI_ELV_PCK100_PID) },
+ 	{ USB_DEVICE(FTDI_VID, FTDI_ELV_RFP500_PID) },
+ 	{ USB_DEVICE(FTDI_VID, FTDI_ELV_FS20SIG_PID) },
++	{ USB_DEVICE(FTDI_VID, FTDI_ELV_UTP8_PID) },
+ 	{ USB_DEVICE(FTDI_VID, FTDI_ELV_WS300PC_PID) },
++	{ USB_DEVICE(FTDI_VID, FTDI_ELV_WS444PC_PID) },
+ 	{ USB_DEVICE(FTDI_VID, FTDI_ELV_FHZ1300PC_PID) },
+ 	{ USB_DEVICE(FTDI_VID, FTDI_ELV_EM1010PC_PID) },
+ 	{ USB_DEVICE(FTDI_VID, FTDI_ELV_WS500_PID) },
+ 	{ USB_DEVICE(FTDI_VID, FTDI_ELV_HS485_PID) },
++	{ USB_DEVICE(FTDI_VID, FTDI_ELV_UMS100_PID) },
++	{ USB_DEVICE(FTDI_VID, FTDI_ELV_TFD128_PID) },
++	{ USB_DEVICE(FTDI_VID, FTDI_ELV_FM3RX_PID) },
++	{ USB_DEVICE(FTDI_VID, FTDI_ELV_WS777_PID) },
+ 	{ USB_DEVICE(FTDI_VID, LINX_SDMUSBQSS_PID) },
+ 	{ USB_DEVICE(FTDI_VID, LINX_MASTERDEVEL2_PID) },
+ 	{ USB_DEVICE(FTDI_VID, LINX_FUTURE_0_PID) },
+@@ -595,6 +614,7 @@ static struct usb_device_id id_table_combined [] = {
+ 	{ USB_DEVICE(FTDI_VID, FTDI_OCEANIC_PID) },
+ 	{ USB_DEVICE(TTI_VID, TTI_QL355P_PID) },
+ 	{ USB_DEVICE(FTDI_VID, FTDI_RM_CANVIEW_PID) },
++	{ USB_DEVICE(CONTEC_VID, CONTEC_COM1USBH_PID) },
+ 	{ USB_DEVICE(BANDB_VID, BANDB_USOTL4_PID) },
+ 	{ USB_DEVICE(BANDB_VID, BANDB_USTL4_PID) },
+ 	{ USB_DEVICE(BANDB_VID, BANDB_USO9ML2_PID) },
+@@ -696,6 +716,7 @@ static struct usb_device_id id_table_combined [] = {
+ 	{ USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_USB60F) },
+ 	{ USB_DEVICE(FTDI_VID, FTDI_REU_TINY_PID) },
+ 	{ USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO4x4_PID) },
++	{ USB_DEVICE(PAPOUCH_VID, PAPOUCH_AD4USB_PID) },
+ 	{ USB_DEVICE(FTDI_VID, FTDI_DOMINTELL_DGQG_PID) },
+ 	{ USB_DEVICE(FTDI_VID, FTDI_DOMINTELL_DUSB_PID) },
+ 	{ USB_DEVICE(ALTI2_VID, ALTI2_N3_PID) },
+@@ -717,6 +738,10 @@ static struct usb_device_id id_table_combined [] = {
+ 		.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
+ 	{ USB_DEVICE(FTDI_VID, HAMEG_HO820_PID) },
+ 	{ USB_DEVICE(FTDI_VID, HAMEG_HO870_PID) },
++	{ USB_DEVICE(FTDI_VID, MJSG_GENERIC_PID) },
++	{ USB_DEVICE(FTDI_VID, MJSG_SR_RADIO_PID) },
++	{ USB_DEVICE(FTDI_VID, MJSG_HD_RADIO_PID) },
++	{ USB_DEVICE(FTDI_VID, MJSG_XM_RADIO_PID) },
+ 	{ },					/* Optional parameter entry */
+ 	{ }					/* Terminating entry */
+ };
+diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h
+index 4586a24..b0e0d64 100644
+--- a/drivers/usb/serial/ftdi_sio.h
++++ b/drivers/usb/serial/ftdi_sio.h
+@@ -1,7 +1,10 @@
+ /*
+- * Definitions for the FTDI USB Single Port Serial Converter -
++ * Driver definitions for the FTDI USB Single Port Serial Converter -
+  * known as FTDI_SIO (Serial Input/Output application of the chipset)
+  *
++ * For USB vendor/product IDs (VID/PID), please see ftdi_sio_ids.h
++ *
++ *
+  * The example I have is known as the USC-1000 which is available from
+  * http://www.dse.co.nz - cat no XH4214 It looks similar to this:
+  * http://www.dansdata.com/usbser.htm but I can't be sure There are other
+@@ -17,880 +20,7 @@
+  * Bill Ryder - bryder@sgi.com formerly of Silicon Graphics, Inc.- wrote the
+  * FTDI_SIO implementation.
+  *
+- * Philipp Gühring - pg@futureware.at - added the Device ID of the USB relais
+- * from Rudolf Gugler
+- *
+- */
+-
+-#define FTDI_VID	0x0403	/* Vendor Id */
+-#define FTDI_SIO_PID	0x8372	/* Product Id SIO application of 8U100AX  */
+-#define FTDI_8U232AM_PID 0x6001 /* Similar device to SIO above */
+-#define FTDI_8U232AM_ALT_PID 0x6006 /* FTDI's alternate PID for above */
+-#define FTDI_8U2232C_PID 0x6010 /* Dual channel device */
+-#define FTDI_232RL_PID  0xFBFA  /* Product ID for FT232RL */
+-#define FTDI_4232H_PID 0x6011 /* Quad channel hi-speed device */
+-#define FTDI_RELAIS_PID	0xFA10  /* Relais device from Rudolf Gugler */
+-#define FTDI_NF_RIC_VID	0x0DCD	/* Vendor Id */
+-#define FTDI_NF_RIC_PID	0x0001	/* Product Id */
+-#define FTDI_USBX_707_PID 0xF857	/* ADSTech IR Blaster USBX-707 */
+-
+-/* Larsen and Brusgaard AltiTrack/USBtrack  */
+-#define LARSENBRUSGAARD_VID		0x0FD8
+-#define LB_ALTITRACK_PID		0x0001
+-
+-/* www.canusb.com Lawicel CANUSB device */
+-#define FTDI_CANUSB_PID 0xFFA8 /* Product Id */
+-
+-/* AlphaMicro Components AMC-232USB01 device */
+-#define FTDI_AMC232_PID 0xFF00 /* Product Id */
+-
+-/* www.candapter.com Ewert Energy Systems CANdapter device */
+-#define FTDI_CANDAPTER_PID 0x9F80 /* Product Id */
+-
+-/* SCS HF Radio Modems PID's (http://www.scs-ptc.com) */
+-/* the VID is the standard ftdi vid (FTDI_VID) */
+-#define FTDI_SCS_DEVICE_0_PID 0xD010    /* SCS PTC-IIusb */
+-#define FTDI_SCS_DEVICE_1_PID 0xD011    /* SCS Tracker / DSP TNC */
+-#define FTDI_SCS_DEVICE_2_PID 0xD012
+-#define FTDI_SCS_DEVICE_3_PID 0xD013
+-#define FTDI_SCS_DEVICE_4_PID 0xD014
+-#define FTDI_SCS_DEVICE_5_PID 0xD015
+-#define FTDI_SCS_DEVICE_6_PID 0xD016
+-#define FTDI_SCS_DEVICE_7_PID 0xD017
+-
+-/* ACT Solutions HomePro ZWave interface (http://www.act-solutions.com/HomePro.htm) */
+-#define FTDI_ACTZWAVE_PID	0xF2D0
+-
+-
+-/* www.starting-point-systems.com µChameleon device */
+-#define FTDI_MICRO_CHAMELEON_PID	0xCAA0	/* Product Id */
+-
+-/* www.irtrans.de device */
+-#define FTDI_IRTRANS_PID 0xFC60 /* Product Id */
+-
+-
+-/* www.thoughttechnology.com/ TT-USB provide with procomp use ftdi_sio */
+-#define FTDI_TTUSB_PID 0xFF20 /* Product Id */
+-
+-/* iPlus device */
+-#define FTDI_IPLUS_PID 0xD070 /* Product Id */
+-#define FTDI_IPLUS2_PID 0xD071 /* Product Id */
+-
+-/* DMX4ALL DMX Interfaces */
+-#define FTDI_DMX4ALL 0xC850
+-
+-/* OpenDCC (www.opendcc.de) product id */
+-#define FTDI_OPENDCC_PID	0xBFD8
+-#define FTDI_OPENDCC_SNIFFER_PID	0xBFD9
+-#define FTDI_OPENDCC_THROTTLE_PID	0xBFDA
+-#define FTDI_OPENDCC_GATEWAY_PID	0xBFDB
+-
+-/* Sprog II (Andrew Crosland's SprogII DCC interface) */
+-#define FTDI_SPROG_II		0xF0C8
+-
+-/* www.crystalfontz.com devices - thanx for providing free devices for evaluation ! */
+-/* they use the ftdi chipset for the USB interface and the vendor id is the same */
+-#define FTDI_XF_632_PID 0xFC08	/* 632: 16x2 Character Display */
+-#define FTDI_XF_634_PID 0xFC09	/* 634: 20x4 Character Display */
+-#define FTDI_XF_547_PID 0xFC0A	/* 547: Two line Display */
+-#define FTDI_XF_633_PID 0xFC0B	/* 633: 16x2 Character Display with Keys */
+-#define FTDI_XF_631_PID 0xFC0C	/* 631: 20x2 Character Display */
+-#define FTDI_XF_635_PID 0xFC0D	/* 635: 20x4 Character Display */
+-#define FTDI_XF_640_PID 0xFC0E	/* 640: Two line Display */
+-#define FTDI_XF_642_PID 0xFC0F	/* 642: Two line Display */
+-
+-/* Video Networks Limited / Homechoice in the UK use an ftdi-based device for their 1Mb */
+-/* broadband internet service.  The following PID is exhibited by the usb device supplied */
+-/* (the VID is the standard ftdi vid (FTDI_VID) */
+-#define FTDI_VNHCPCUSB_D_PID 0xfe38 /* Product Id */
+-
+-/*
+- * PCDJ use ftdi based dj-controllers.  The following PID is for their DAC-2 device
+- * http://www.pcdjhardware.com/DAC2.asp (PID sent by Wouter Paesen)
+- * (the VID is the standard ftdi vid (FTDI_VID) */
+-#define FTDI_PCDJ_DAC2_PID 0xFA88
+-
+-/*
+- * The following are the values for the Matrix Orbital LCD displays,
+- * which are the FT232BM ( similar to the 8U232AM )
+- */
+-#define FTDI_MTXORB_0_PID      0xFA00  /* Matrix Orbital Product Id */
+-#define FTDI_MTXORB_1_PID      0xFA01  /* Matrix Orbital Product Id */
+-#define FTDI_MTXORB_2_PID      0xFA02  /* Matrix Orbital Product Id */
+-#define FTDI_MTXORB_3_PID      0xFA03  /* Matrix Orbital Product Id */
+-#define FTDI_MTXORB_4_PID      0xFA04  /* Matrix Orbital Product Id */
+-#define FTDI_MTXORB_5_PID      0xFA05  /* Matrix Orbital Product Id */
+-#define FTDI_MTXORB_6_PID      0xFA06  /* Matrix Orbital Product Id */
+-
+-/* OOCDlink by Joern Kaipf <joernk@web.de>
+- * (http://www.joernonline.de/dw/doku.php?id=start&idx=projects:oocdlink) */
+-#define FTDI_OOCDLINK_PID	0xbaf8	/* Amontec JTAGkey */
+-
+-/*
+- * The following are the values for the Matrix Orbital FTDI Range
+- * Anything in this range will use an FT232RL.
+- */
+-#define MTXORB_VID			0x1B3D
+-#define MTXORB_FTDI_RANGE_0100_PID	0x0100
+-#define MTXORB_FTDI_RANGE_0101_PID	0x0101
+-#define MTXORB_FTDI_RANGE_0102_PID	0x0102
+-#define MTXORB_FTDI_RANGE_0103_PID	0x0103
+-#define MTXORB_FTDI_RANGE_0104_PID	0x0104
+-#define MTXORB_FTDI_RANGE_0105_PID	0x0105
+-#define MTXORB_FTDI_RANGE_0106_PID	0x0106
+-#define MTXORB_FTDI_RANGE_0107_PID	0x0107
+-#define MTXORB_FTDI_RANGE_0108_PID	0x0108
+-#define MTXORB_FTDI_RANGE_0109_PID	0x0109
+-#define MTXORB_FTDI_RANGE_010A_PID	0x010A
+-#define MTXORB_FTDI_RANGE_010B_PID	0x010B
+-#define MTXORB_FTDI_RANGE_010C_PID	0x010C
+-#define MTXORB_FTDI_RANGE_010D_PID	0x010D
+-#define MTXORB_FTDI_RANGE_010E_PID	0x010E
+-#define MTXORB_FTDI_RANGE_010F_PID	0x010F
+-#define MTXORB_FTDI_RANGE_0110_PID	0x0110
+-#define MTXORB_FTDI_RANGE_0111_PID	0x0111
+-#define MTXORB_FTDI_RANGE_0112_PID	0x0112
+-#define MTXORB_FTDI_RANGE_0113_PID	0x0113
+-#define MTXORB_FTDI_RANGE_0114_PID	0x0114
+-#define MTXORB_FTDI_RANGE_0115_PID	0x0115
+-#define MTXORB_FTDI_RANGE_0116_PID	0x0116
+-#define MTXORB_FTDI_RANGE_0117_PID	0x0117
+-#define MTXORB_FTDI_RANGE_0118_PID	0x0118
+-#define MTXORB_FTDI_RANGE_0119_PID	0x0119
+-#define MTXORB_FTDI_RANGE_011A_PID	0x011A
+-#define MTXORB_FTDI_RANGE_011B_PID	0x011B
+-#define MTXORB_FTDI_RANGE_011C_PID	0x011C
+-#define MTXORB_FTDI_RANGE_011D_PID	0x011D
+-#define MTXORB_FTDI_RANGE_011E_PID	0x011E
+-#define MTXORB_FTDI_RANGE_011F_PID	0x011F
+-#define MTXORB_FTDI_RANGE_0120_PID	0x0120
+-#define MTXORB_FTDI_RANGE_0121_PID	0x0121
+-#define MTXORB_FTDI_RANGE_0122_PID	0x0122
+-#define MTXORB_FTDI_RANGE_0123_PID	0x0123
+-#define MTXORB_FTDI_RANGE_0124_PID	0x0124
+-#define MTXORB_FTDI_RANGE_0125_PID	0x0125
+-#define MTXORB_FTDI_RANGE_0126_PID	0x0126
+-#define MTXORB_FTDI_RANGE_0127_PID	0x0127
+-#define MTXORB_FTDI_RANGE_0128_PID	0x0128
+-#define MTXORB_FTDI_RANGE_0129_PID	0x0129
+-#define MTXORB_FTDI_RANGE_012A_PID	0x012A
+-#define MTXORB_FTDI_RANGE_012B_PID	0x012B
+-#define MTXORB_FTDI_RANGE_012C_PID	0x012C
+-#define MTXORB_FTDI_RANGE_012D_PID	0x012D
+-#define MTXORB_FTDI_RANGE_012E_PID	0x012E
+-#define MTXORB_FTDI_RANGE_012F_PID	0x012F
+-#define MTXORB_FTDI_RANGE_0130_PID	0x0130
+-#define MTXORB_FTDI_RANGE_0131_PID	0x0131
+-#define MTXORB_FTDI_RANGE_0132_PID	0x0132
+-#define MTXORB_FTDI_RANGE_0133_PID	0x0133
+-#define MTXORB_FTDI_RANGE_0134_PID	0x0134
+-#define MTXORB_FTDI_RANGE_0135_PID	0x0135
+-#define MTXORB_FTDI_RANGE_0136_PID	0x0136
+-#define MTXORB_FTDI_RANGE_0137_PID	0x0137
+-#define MTXORB_FTDI_RANGE_0138_PID	0x0138
+-#define MTXORB_FTDI_RANGE_0139_PID	0x0139
+-#define MTXORB_FTDI_RANGE_013A_PID	0x013A
+-#define MTXORB_FTDI_RANGE_013B_PID	0x013B
+-#define MTXORB_FTDI_RANGE_013C_PID	0x013C
+-#define MTXORB_FTDI_RANGE_013D_PID	0x013D
+-#define MTXORB_FTDI_RANGE_013E_PID	0x013E
+-#define MTXORB_FTDI_RANGE_013F_PID	0x013F
+-#define MTXORB_FTDI_RANGE_0140_PID	0x0140
+-#define MTXORB_FTDI_RANGE_0141_PID	0x0141
+-#define MTXORB_FTDI_RANGE_0142_PID	0x0142
+-#define MTXORB_FTDI_RANGE_0143_PID	0x0143
+-#define MTXORB_FTDI_RANGE_0144_PID	0x0144
+-#define MTXORB_FTDI_RANGE_0145_PID	0x0145
+-#define MTXORB_FTDI_RANGE_0146_PID	0x0146
+-#define MTXORB_FTDI_RANGE_0147_PID	0x0147
+-#define MTXORB_FTDI_RANGE_0148_PID	0x0148
+-#define MTXORB_FTDI_RANGE_0149_PID	0x0149
+-#define MTXORB_FTDI_RANGE_014A_PID	0x014A
+-#define MTXORB_FTDI_RANGE_014B_PID	0x014B
+-#define MTXORB_FTDI_RANGE_014C_PID	0x014C
+-#define MTXORB_FTDI_RANGE_014D_PID	0x014D
+-#define MTXORB_FTDI_RANGE_014E_PID	0x014E
+-#define MTXORB_FTDI_RANGE_014F_PID	0x014F
+-#define MTXORB_FTDI_RANGE_0150_PID	0x0150
+-#define MTXORB_FTDI_RANGE_0151_PID	0x0151
+-#define MTXORB_FTDI_RANGE_0152_PID	0x0152
+-#define MTXORB_FTDI_RANGE_0153_PID	0x0153
+-#define MTXORB_FTDI_RANGE_0154_PID	0x0154
+-#define MTXORB_FTDI_RANGE_0155_PID	0x0155
+-#define MTXORB_FTDI_RANGE_0156_PID	0x0156
+-#define MTXORB_FTDI_RANGE_0157_PID	0x0157
+-#define MTXORB_FTDI_RANGE_0158_PID	0x0158
+-#define MTXORB_FTDI_RANGE_0159_PID	0x0159
+-#define MTXORB_FTDI_RANGE_015A_PID	0x015A
+-#define MTXORB_FTDI_RANGE_015B_PID	0x015B
+-#define MTXORB_FTDI_RANGE_015C_PID	0x015C
+-#define MTXORB_FTDI_RANGE_015D_PID	0x015D
+-#define MTXORB_FTDI_RANGE_015E_PID	0x015E
+-#define MTXORB_FTDI_RANGE_015F_PID	0x015F
+-#define MTXORB_FTDI_RANGE_0160_PID	0x0160
+-#define MTXORB_FTDI_RANGE_0161_PID	0x0161
+-#define MTXORB_FTDI_RANGE_0162_PID	0x0162
+-#define MTXORB_FTDI_RANGE_0163_PID	0x0163
+-#define MTXORB_FTDI_RANGE_0164_PID	0x0164
+-#define MTXORB_FTDI_RANGE_0165_PID	0x0165
+-#define MTXORB_FTDI_RANGE_0166_PID	0x0166
+-#define MTXORB_FTDI_RANGE_0167_PID	0x0167
+-#define MTXORB_FTDI_RANGE_0168_PID	0x0168
+-#define MTXORB_FTDI_RANGE_0169_PID	0x0169
+-#define MTXORB_FTDI_RANGE_016A_PID	0x016A
+-#define MTXORB_FTDI_RANGE_016B_PID	0x016B
+-#define MTXORB_FTDI_RANGE_016C_PID	0x016C
+-#define MTXORB_FTDI_RANGE_016D_PID	0x016D
+-#define MTXORB_FTDI_RANGE_016E_PID	0x016E
+-#define MTXORB_FTDI_RANGE_016F_PID	0x016F
+-#define MTXORB_FTDI_RANGE_0170_PID	0x0170
+-#define MTXORB_FTDI_RANGE_0171_PID	0x0171
+-#define MTXORB_FTDI_RANGE_0172_PID	0x0172
+-#define MTXORB_FTDI_RANGE_0173_PID	0x0173
+-#define MTXORB_FTDI_RANGE_0174_PID	0x0174
+-#define MTXORB_FTDI_RANGE_0175_PID	0x0175
+-#define MTXORB_FTDI_RANGE_0176_PID	0x0176
+-#define MTXORB_FTDI_RANGE_0177_PID	0x0177
+-#define MTXORB_FTDI_RANGE_0178_PID	0x0178
+-#define MTXORB_FTDI_RANGE_0179_PID	0x0179
+-#define MTXORB_FTDI_RANGE_017A_PID	0x017A
+-#define MTXORB_FTDI_RANGE_017B_PID	0x017B
+-#define MTXORB_FTDI_RANGE_017C_PID	0x017C
+-#define MTXORB_FTDI_RANGE_017D_PID	0x017D
+-#define MTXORB_FTDI_RANGE_017E_PID	0x017E
+-#define MTXORB_FTDI_RANGE_017F_PID	0x017F
+-#define MTXORB_FTDI_RANGE_0180_PID	0x0180
+-#define MTXORB_FTDI_RANGE_0181_PID	0x0181
+-#define MTXORB_FTDI_RANGE_0182_PID	0x0182
+-#define MTXORB_FTDI_RANGE_0183_PID	0x0183
+-#define MTXORB_FTDI_RANGE_0184_PID	0x0184
+-#define MTXORB_FTDI_RANGE_0185_PID	0x0185
+-#define MTXORB_FTDI_RANGE_0186_PID	0x0186
+-#define MTXORB_FTDI_RANGE_0187_PID	0x0187
+-#define MTXORB_FTDI_RANGE_0188_PID	0x0188
+-#define MTXORB_FTDI_RANGE_0189_PID	0x0189
+-#define MTXORB_FTDI_RANGE_018A_PID	0x018A
+-#define MTXORB_FTDI_RANGE_018B_PID	0x018B
+-#define MTXORB_FTDI_RANGE_018C_PID	0x018C
+-#define MTXORB_FTDI_RANGE_018D_PID	0x018D
+-#define MTXORB_FTDI_RANGE_018E_PID	0x018E
+-#define MTXORB_FTDI_RANGE_018F_PID	0x018F
+-#define MTXORB_FTDI_RANGE_0190_PID	0x0190
+-#define MTXORB_FTDI_RANGE_0191_PID	0x0191
+-#define MTXORB_FTDI_RANGE_0192_PID	0x0192
+-#define MTXORB_FTDI_RANGE_0193_PID	0x0193
+-#define MTXORB_FTDI_RANGE_0194_PID	0x0194
+-#define MTXORB_FTDI_RANGE_0195_PID	0x0195
+-#define MTXORB_FTDI_RANGE_0196_PID	0x0196
+-#define MTXORB_FTDI_RANGE_0197_PID	0x0197
+-#define MTXORB_FTDI_RANGE_0198_PID	0x0198
+-#define MTXORB_FTDI_RANGE_0199_PID	0x0199
+-#define MTXORB_FTDI_RANGE_019A_PID	0x019A
+-#define MTXORB_FTDI_RANGE_019B_PID	0x019B
+-#define MTXORB_FTDI_RANGE_019C_PID	0x019C
+-#define MTXORB_FTDI_RANGE_019D_PID	0x019D
+-#define MTXORB_FTDI_RANGE_019E_PID	0x019E
+-#define MTXORB_FTDI_RANGE_019F_PID	0x019F
+-#define MTXORB_FTDI_RANGE_01A0_PID	0x01A0
+-#define MTXORB_FTDI_RANGE_01A1_PID	0x01A1
+-#define MTXORB_FTDI_RANGE_01A2_PID	0x01A2
+-#define MTXORB_FTDI_RANGE_01A3_PID	0x01A3
+-#define MTXORB_FTDI_RANGE_01A4_PID	0x01A4
+-#define MTXORB_FTDI_RANGE_01A5_PID	0x01A5
+-#define MTXORB_FTDI_RANGE_01A6_PID	0x01A6
+-#define MTXORB_FTDI_RANGE_01A7_PID	0x01A7
+-#define MTXORB_FTDI_RANGE_01A8_PID	0x01A8
+-#define MTXORB_FTDI_RANGE_01A9_PID	0x01A9
+-#define MTXORB_FTDI_RANGE_01AA_PID	0x01AA
+-#define MTXORB_FTDI_RANGE_01AB_PID	0x01AB
+-#define MTXORB_FTDI_RANGE_01AC_PID	0x01AC
+-#define MTXORB_FTDI_RANGE_01AD_PID	0x01AD
+-#define MTXORB_FTDI_RANGE_01AE_PID	0x01AE
+-#define MTXORB_FTDI_RANGE_01AF_PID	0x01AF
+-#define MTXORB_FTDI_RANGE_01B0_PID	0x01B0
+-#define MTXORB_FTDI_RANGE_01B1_PID	0x01B1
+-#define MTXORB_FTDI_RANGE_01B2_PID	0x01B2
+-#define MTXORB_FTDI_RANGE_01B3_PID	0x01B3
+-#define MTXORB_FTDI_RANGE_01B4_PID	0x01B4
+-#define MTXORB_FTDI_RANGE_01B5_PID	0x01B5
+-#define MTXORB_FTDI_RANGE_01B6_PID	0x01B6
+-#define MTXORB_FTDI_RANGE_01B7_PID	0x01B7
+-#define MTXORB_FTDI_RANGE_01B8_PID	0x01B8
+-#define MTXORB_FTDI_RANGE_01B9_PID	0x01B9
+-#define MTXORB_FTDI_RANGE_01BA_PID	0x01BA
+-#define MTXORB_FTDI_RANGE_01BB_PID	0x01BB
+-#define MTXORB_FTDI_RANGE_01BC_PID	0x01BC
+-#define MTXORB_FTDI_RANGE_01BD_PID	0x01BD
+-#define MTXORB_FTDI_RANGE_01BE_PID	0x01BE
+-#define MTXORB_FTDI_RANGE_01BF_PID	0x01BF
+-#define MTXORB_FTDI_RANGE_01C0_PID	0x01C0
+-#define MTXORB_FTDI_RANGE_01C1_PID	0x01C1
+-#define MTXORB_FTDI_RANGE_01C2_PID	0x01C2
+-#define MTXORB_FTDI_RANGE_01C3_PID	0x01C3
+-#define MTXORB_FTDI_RANGE_01C4_PID	0x01C4
+-#define MTXORB_FTDI_RANGE_01C5_PID	0x01C5
+-#define MTXORB_FTDI_RANGE_01C6_PID	0x01C6
+-#define MTXORB_FTDI_RANGE_01C7_PID	0x01C7
+-#define MTXORB_FTDI_RANGE_01C8_PID	0x01C8
+-#define MTXORB_FTDI_RANGE_01C9_PID	0x01C9
+-#define MTXORB_FTDI_RANGE_01CA_PID	0x01CA
+-#define MTXORB_FTDI_RANGE_01CB_PID	0x01CB
+-#define MTXORB_FTDI_RANGE_01CC_PID	0x01CC
+-#define MTXORB_FTDI_RANGE_01CD_PID	0x01CD
+-#define MTXORB_FTDI_RANGE_01CE_PID	0x01CE
+-#define MTXORB_FTDI_RANGE_01CF_PID	0x01CF
+-#define MTXORB_FTDI_RANGE_01D0_PID	0x01D0
+-#define MTXORB_FTDI_RANGE_01D1_PID	0x01D1
+-#define MTXORB_FTDI_RANGE_01D2_PID	0x01D2
+-#define MTXORB_FTDI_RANGE_01D3_PID	0x01D3
+-#define MTXORB_FTDI_RANGE_01D4_PID	0x01D4
+-#define MTXORB_FTDI_RANGE_01D5_PID	0x01D5
+-#define MTXORB_FTDI_RANGE_01D6_PID	0x01D6
+-#define MTXORB_FTDI_RANGE_01D7_PID	0x01D7
+-#define MTXORB_FTDI_RANGE_01D8_PID	0x01D8
+-#define MTXORB_FTDI_RANGE_01D9_PID	0x01D9
+-#define MTXORB_FTDI_RANGE_01DA_PID	0x01DA
+-#define MTXORB_FTDI_RANGE_01DB_PID	0x01DB
+-#define MTXORB_FTDI_RANGE_01DC_PID	0x01DC
+-#define MTXORB_FTDI_RANGE_01DD_PID	0x01DD
+-#define MTXORB_FTDI_RANGE_01DE_PID	0x01DE
+-#define MTXORB_FTDI_RANGE_01DF_PID	0x01DF
+-#define MTXORB_FTDI_RANGE_01E0_PID	0x01E0
+-#define MTXORB_FTDI_RANGE_01E1_PID	0x01E1
+-#define MTXORB_FTDI_RANGE_01E2_PID	0x01E2
+-#define MTXORB_FTDI_RANGE_01E3_PID	0x01E3
+-#define MTXORB_FTDI_RANGE_01E4_PID	0x01E4
+-#define MTXORB_FTDI_RANGE_01E5_PID	0x01E5
+-#define MTXORB_FTDI_RANGE_01E6_PID	0x01E6
+-#define MTXORB_FTDI_RANGE_01E7_PID	0x01E7
+-#define MTXORB_FTDI_RANGE_01E8_PID	0x01E8
+-#define MTXORB_FTDI_RANGE_01E9_PID	0x01E9
+-#define MTXORB_FTDI_RANGE_01EA_PID	0x01EA
+-#define MTXORB_FTDI_RANGE_01EB_PID	0x01EB
+-#define MTXORB_FTDI_RANGE_01EC_PID	0x01EC
+-#define MTXORB_FTDI_RANGE_01ED_PID	0x01ED
+-#define MTXORB_FTDI_RANGE_01EE_PID	0x01EE
+-#define MTXORB_FTDI_RANGE_01EF_PID	0x01EF
+-#define MTXORB_FTDI_RANGE_01F0_PID	0x01F0
+-#define MTXORB_FTDI_RANGE_01F1_PID	0x01F1
+-#define MTXORB_FTDI_RANGE_01F2_PID	0x01F2
+-#define MTXORB_FTDI_RANGE_01F3_PID	0x01F3
+-#define MTXORB_FTDI_RANGE_01F4_PID	0x01F4
+-#define MTXORB_FTDI_RANGE_01F5_PID	0x01F5
+-#define MTXORB_FTDI_RANGE_01F6_PID	0x01F6
+-#define MTXORB_FTDI_RANGE_01F7_PID	0x01F7
+-#define MTXORB_FTDI_RANGE_01F8_PID	0x01F8
+-#define MTXORB_FTDI_RANGE_01F9_PID	0x01F9
+-#define MTXORB_FTDI_RANGE_01FA_PID	0x01FA
+-#define MTXORB_FTDI_RANGE_01FB_PID	0x01FB
+-#define MTXORB_FTDI_RANGE_01FC_PID	0x01FC
+-#define MTXORB_FTDI_RANGE_01FD_PID	0x01FD
+-#define MTXORB_FTDI_RANGE_01FE_PID	0x01FE
+-#define MTXORB_FTDI_RANGE_01FF_PID	0x01FF
+-
+-
+-
+-/* Interbiometrics USB I/O Board */
+-/* Developed for Interbiometrics by Rudolf Gugler */
+-#define INTERBIOMETRICS_VID              0x1209
+-#define INTERBIOMETRICS_IOBOARD_PID      0x1002
+-#define INTERBIOMETRICS_MINI_IOBOARD_PID 0x1006
+-
+-/*
+- * The following are the values for the Perle Systems
+- * UltraPort USB serial converters
+- */
+-#define FTDI_PERLE_ULTRAPORT_PID 0xF0C0	/* Perle UltraPort Product Id */
+-
+-/*
+- * The following are the values for the Sealevel SeaLINK+ adapters.
+- * (Original list sent by Tuan Hoang.  Ian Abbott renamed the macros and
+- * removed some PIDs that don't seem to match any existing products.)
+- */
+-#define SEALEVEL_VID		0x0c52	/* Sealevel Vendor ID */
+-#define SEALEVEL_2101_PID	0x2101	/* SeaLINK+232 (2101/2105) */
+-#define SEALEVEL_2102_PID	0x2102	/* SeaLINK+485 (2102) */
+-#define SEALEVEL_2103_PID	0x2103	/* SeaLINK+232I (2103) */
+-#define SEALEVEL_2104_PID	0x2104	/* SeaLINK+485I (2104) */
+-#define SEALEVEL_2106_PID	0x9020	/* SeaLINK+422 (2106) */
+-#define SEALEVEL_2201_1_PID	0x2211	/* SeaPORT+2/232 (2201) Port 1 */
+-#define SEALEVEL_2201_2_PID	0x2221	/* SeaPORT+2/232 (2201) Port 2 */
+-#define SEALEVEL_2202_1_PID	0x2212	/* SeaPORT+2/485 (2202) Port 1 */
+-#define SEALEVEL_2202_2_PID	0x2222	/* SeaPORT+2/485 (2202) Port 2 */
+-#define SEALEVEL_2203_1_PID	0x2213	/* SeaPORT+2 (2203) Port 1 */
+-#define SEALEVEL_2203_2_PID	0x2223	/* SeaPORT+2 (2203) Port 2 */
+-#define SEALEVEL_2401_1_PID	0x2411	/* SeaPORT+4/232 (2401) Port 1 */
+-#define SEALEVEL_2401_2_PID	0x2421	/* SeaPORT+4/232 (2401) Port 2 */
+-#define SEALEVEL_2401_3_PID	0x2431	/* SeaPORT+4/232 (2401) Port 3 */
+-#define SEALEVEL_2401_4_PID	0x2441	/* SeaPORT+4/232 (2401) Port 4 */
+-#define SEALEVEL_2402_1_PID	0x2412	/* SeaPORT+4/485 (2402) Port 1 */
+-#define SEALEVEL_2402_2_PID	0x2422	/* SeaPORT+4/485 (2402) Port 2 */
+-#define SEALEVEL_2402_3_PID	0x2432	/* SeaPORT+4/485 (2402) Port 3 */
+-#define SEALEVEL_2402_4_PID	0x2442	/* SeaPORT+4/485 (2402) Port 4 */
+-#define SEALEVEL_2403_1_PID	0x2413	/* SeaPORT+4 (2403) Port 1 */
+-#define SEALEVEL_2403_2_PID	0x2423	/* SeaPORT+4 (2403) Port 2 */
+-#define SEALEVEL_2403_3_PID	0x2433	/* SeaPORT+4 (2403) Port 3 */
+-#define SEALEVEL_2403_4_PID	0x2443	/* SeaPORT+4 (2403) Port 4 */
+-#define SEALEVEL_2801_1_PID	0X2811	/* SeaLINK+8/232 (2801) Port 1 */
+-#define SEALEVEL_2801_2_PID	0X2821	/* SeaLINK+8/232 (2801) Port 2 */
+-#define SEALEVEL_2801_3_PID	0X2831	/* SeaLINK+8/232 (2801) Port 3 */
+-#define SEALEVEL_2801_4_PID	0X2841	/* SeaLINK+8/232 (2801) Port 4 */
+-#define SEALEVEL_2801_5_PID	0X2851	/* SeaLINK+8/232 (2801) Port 5 */
+-#define SEALEVEL_2801_6_PID	0X2861	/* SeaLINK+8/232 (2801) Port 6 */
+-#define SEALEVEL_2801_7_PID	0X2871	/* SeaLINK+8/232 (2801) Port 7 */
+-#define SEALEVEL_2801_8_PID	0X2881	/* SeaLINK+8/232 (2801) Port 8 */
+-#define SEALEVEL_2802_1_PID	0X2812	/* SeaLINK+8/485 (2802) Port 1 */
+-#define SEALEVEL_2802_2_PID	0X2822	/* SeaLINK+8/485 (2802) Port 2 */
+-#define SEALEVEL_2802_3_PID	0X2832	/* SeaLINK+8/485 (2802) Port 3 */
+-#define SEALEVEL_2802_4_PID	0X2842	/* SeaLINK+8/485 (2802) Port 4 */
+-#define SEALEVEL_2802_5_PID	0X2852	/* SeaLINK+8/485 (2802) Port 5 */
+-#define SEALEVEL_2802_6_PID	0X2862	/* SeaLINK+8/485 (2802) Port 6 */
+-#define SEALEVEL_2802_7_PID	0X2872	/* SeaLINK+8/485 (2802) Port 7 */
+-#define SEALEVEL_2802_8_PID	0X2882	/* SeaLINK+8/485 (2802) Port 8 */
+-#define SEALEVEL_2803_1_PID	0X2813	/* SeaLINK+8 (2803) Port 1 */
+-#define SEALEVEL_2803_2_PID	0X2823 	/* SeaLINK+8 (2803) Port 2 */
+-#define SEALEVEL_2803_3_PID	0X2833 	/* SeaLINK+8 (2803) Port 3 */
+-#define SEALEVEL_2803_4_PID	0X2843 	/* SeaLINK+8 (2803) Port 4 */
+-#define SEALEVEL_2803_5_PID	0X2853 	/* SeaLINK+8 (2803) Port 5 */
+-#define SEALEVEL_2803_6_PID	0X2863 	/* SeaLINK+8 (2803) Port 6 */
+-#define SEALEVEL_2803_7_PID	0X2873 	/* SeaLINK+8 (2803) Port 7 */
+-#define SEALEVEL_2803_8_PID	0X2883 	/* SeaLINK+8 (2803) Port 8 */
+-
+-/*
+- * The following are the values for two KOBIL chipcard terminals.
+- */
+-#define KOBIL_VID		0x0d46	/* KOBIL Vendor ID */
+-#define KOBIL_CONV_B1_PID	0x2020	/* KOBIL Konverter for B1 */
+-#define KOBIL_CONV_KAAN_PID	0x2021	/* KOBIL_Konverter for KAAN */
+-
+-/*
+- * Icom ID-1 digital transceiver
+- */
+-
+-#define ICOM_ID1_VID            0x0C26
+-#define ICOM_ID1_PID            0x0004
+-
+-/*
+- * ASK.fr devices
+- */
+-#define FTDI_ASK_RDR400_PID	0xC991	/* ASK RDR 400 series card reader */
+-
+-/*
+- * FTDI USB UART chips used in construction projects from the
+- * Elektor Electronics magazine (http://elektor-electronics.co.uk)
+- */
+-#define ELEKTOR_VID		0x0C7D
+-#define ELEKTOR_FT323R_PID	0x0005	/* RFID-Reader, issue 09-2006 */
+-
+-/*
+- * DSS-20 Sync Station for Sony Ericsson P800
+- */
+-#define FTDI_DSS20_PID          0xFC82
+-
+-/*
+- * Home Electronics (www.home-electro.com) USB gadgets
+- */
+-#define FTDI_HE_TIRA1_PID	0xFA78	/* Tira-1 IR transceiver */
+-
+-/* USB-UIRT - An infrared receiver and transmitter using the 8U232AM chip */
+-/* http://home.earthlink.net/~jrhees/USBUIRT/index.htm */
+-#define FTDI_USB_UIRT_PID	0xF850	/* Product Id */
+-
+-/* TNC-X USB-to-packet-radio adapter, versions prior to 3.0 (DLP module) */
+-
+-#define FTDI_TNC_X_PID		0xEBE0
+-
+-/*
+- * ELV USB devices submitted by Christian Abt of ELV (www.elv.de).
+- * All of these devices use FTDI's vendor ID (0x0403).
+- *
+- * The previously included PID for the UO 100 module was incorrect.
+- * In fact, that PID was for ELV's UR 100 USB-RS232 converter (0xFB58).
+- *
+- * Armin Laeuger originally sent the PID for the UM 100 module.
+- */
+-#define FTDI_R2000KU_TRUE_RNG	0xFB80  /* R2000KU TRUE RNG */
+-#define FTDI_ELV_UR100_PID	0xFB58	/* USB-RS232-Umsetzer (UR 100) */
+-#define FTDI_ELV_UM100_PID	0xFB5A	/* USB-Modul UM 100 */
+-#define FTDI_ELV_UO100_PID	0xFB5B	/* USB-Modul UO 100 */
+-#define FTDI_ELV_ALC8500_PID	0xF06E	/* ALC 8500 Expert */
+-/* Additional ELV PIDs that default to using the FTDI D2XX drivers on
+- * MS Windows, rather than the FTDI Virtual Com Port drivers.
+- * Maybe these will be easier to use with the libftdi/libusb user-space
+- * drivers, or possibly the Comedi drivers in some cases. */
+-#define FTDI_ELV_CLI7000_PID	0xFB59	/* Computer-Light-Interface (CLI 7000) */
+-#define FTDI_ELV_PPS7330_PID	0xFB5C	/* Processor-Power-Supply (PPS 7330) */
+-#define FTDI_ELV_TFM100_PID	0xFB5D	/* Temperartur-Feuchte Messgeraet (TFM 100) */
+-#define FTDI_ELV_UDF77_PID	0xFB5E	/* USB DCF Funkurh (UDF 77) */
+-#define FTDI_ELV_UIO88_PID	0xFB5F	/* USB-I/O Interface (UIO 88) */
+-#define FTDI_ELV_UAD8_PID	0xF068	/* USB-AD-Wandler (UAD 8) */
+-#define FTDI_ELV_UDA7_PID	0xF069	/* USB-DA-Wandler (UDA 7) */
+-#define FTDI_ELV_USI2_PID	0xF06A	/* USB-Schrittmotoren-Interface (USI 2) */
+-#define FTDI_ELV_T1100_PID	0xF06B	/* Thermometer (T 1100) */
+-#define FTDI_ELV_PCD200_PID	0xF06C	/* PC-Datenlogger (PCD 200) */
+-#define FTDI_ELV_ULA200_PID	0xF06D	/* USB-LCD-Ansteuerung (ULA 200) */
+-#define FTDI_ELV_FHZ1000PC_PID	0xF06F	/* FHZ 1000 PC */
+-#define FTDI_ELV_CSI8_PID	0xE0F0	/* Computer-Schalt-Interface (CSI 8) */
+-#define FTDI_ELV_EM1000DL_PID	0xE0F1	/* PC-Datenlogger fuer Energiemonitor (EM 1000 DL) */
+-#define FTDI_ELV_PCK100_PID	0xE0F2	/* PC-Kabeltester (PCK 100) */
+-#define FTDI_ELV_RFP500_PID	0xE0F3	/* HF-Leistungsmesser (RFP 500) */
+-#define FTDI_ELV_FS20SIG_PID	0xE0F4	/* Signalgeber (FS 20 SIG) */
+-#define FTDI_ELV_WS300PC_PID	0xE0F6	/* PC-Wetterstation (WS 300 PC) */
+-#define FTDI_ELV_FHZ1300PC_PID	0xE0E8	/* FHZ 1300 PC */
+-#define FTDI_ELV_WS500_PID	0xE0E9	/* PC-Wetterstation (WS 500) */
+-#define FTDI_ELV_HS485_PID	0xE0EA	/* USB to RS-485 adapter */
+-#define FTDI_ELV_EM1010PC_PID	0xE0EF	/* Engery monitor EM 1010 PC */
+-#define FTDI_PHI_FISCO_PID      0xE40B  /* PHI Fisco USB to Serial cable */
+-
+-/*
+- * Definitions for ID TECH (www.idt-net.com) devices
+- */
+-#define IDTECH_VID		0x0ACD	/* ID TECH Vendor ID */
+-#define IDTECH_IDT1221U_PID	0x0300	/* IDT1221U USB to RS-232 adapter */
+-
+-/*
+- * Definitions for Omnidirectional Control Technology, Inc. devices
+- */
+-#define OCT_VID			0x0B39	/* OCT vendor ID */
+-/* Note: OCT US101 is also rebadged as Dick Smith Electronics (NZ) XH6381 */
+-/* Also rebadged as Dick Smith Electronics (Aus) XH6451 */
+-/* Also rebadged as SIIG Inc. model US2308 hardware version 1 */
+-#define OCT_US101_PID		0x0421	/* OCT US101 USB to RS-232 */
+-
+-/* an infrared receiver for user access control with IR tags */
+-#define FTDI_PIEGROUP_PID	0xF208	/* Product Id */
+-
+-/*
+- * Definitions for Artemis astronomical USB based cameras
+- * Check it at http://www.artemisccd.co.uk/
+- */
+-#define FTDI_ARTEMIS_PID	0xDF28	/* All Artemis Cameras */
+-
+-/*
+- * Definitions for ATIK Instruments astronomical USB based cameras
+- * Check it at http://www.atik-instruments.com/
+- */
+-#define FTDI_ATIK_ATK16_PID	0xDF30	/* ATIK ATK-16 Grayscale Camera */
+-#define FTDI_ATIK_ATK16C_PID	0xDF32	/* ATIK ATK-16C Colour Camera */
+-#define FTDI_ATIK_ATK16HR_PID	0xDF31	/* ATIK ATK-16HR Grayscale Camera */
+-#define FTDI_ATIK_ATK16HRC_PID	0xDF33	/* ATIK ATK-16HRC Colour Camera */
+-#define FTDI_ATIK_ATK16IC_PID   0xDF35  /* ATIK ATK-16IC Grayscale Camera */
+-
+-/*
+- * Protego product ids
+- */
+-#define PROTEGO_SPECIAL_1	0xFC70	/* special/unknown device */
+-#define PROTEGO_R2X0		0xFC71	/* R200-USB TRNG unit (R210, R220, and R230) */
+-#define PROTEGO_SPECIAL_3	0xFC72	/* special/unknown device */
+-#define PROTEGO_SPECIAL_4	0xFC73	/* special/unknown device */
+-
+-/*
+- * Gude Analog- und Digitalsysteme GmbH
+- */
+-#define FTDI_GUDEADS_E808_PID    0xE808
+-#define FTDI_GUDEADS_E809_PID    0xE809
+-#define FTDI_GUDEADS_E80A_PID    0xE80A
+-#define FTDI_GUDEADS_E80B_PID    0xE80B
+-#define FTDI_GUDEADS_E80C_PID    0xE80C
+-#define FTDI_GUDEADS_E80D_PID    0xE80D
+-#define FTDI_GUDEADS_E80E_PID    0xE80E
+-#define FTDI_GUDEADS_E80F_PID    0xE80F
+-#define FTDI_GUDEADS_E888_PID    0xE888  /* Expert ISDN Control USB */
+-#define FTDI_GUDEADS_E889_PID    0xE889  /* USB RS-232 OptoBridge */
+-#define FTDI_GUDEADS_E88A_PID    0xE88A
+-#define FTDI_GUDEADS_E88B_PID    0xE88B
+-#define FTDI_GUDEADS_E88C_PID    0xE88C
+-#define FTDI_GUDEADS_E88D_PID    0xE88D
+-#define FTDI_GUDEADS_E88E_PID    0xE88E
+-#define FTDI_GUDEADS_E88F_PID    0xE88F
+-
+-/*
+- * Linx Technologies product ids
+- */
+-#define LINX_SDMUSBQSS_PID	0xF448	/* Linx SDM-USB-QS-S */
+-#define LINX_MASTERDEVEL2_PID   0xF449   /* Linx Master Development 2.0 */
+-#define LINX_FUTURE_0_PID   0xF44A   /* Linx future device */
+-#define LINX_FUTURE_1_PID   0xF44B   /* Linx future device */
+-#define LINX_FUTURE_2_PID   0xF44C   /* Linx future device */
+-
+-/* CCS Inc. ICDU/ICDU40 product ID - the FT232BM is used in an in-circuit-debugger */
+-/* unit for PIC16's/PIC18's */
+-#define FTDI_CCSICDU20_0_PID    0xF9D0
+-#define FTDI_CCSICDU40_1_PID    0xF9D1
+-#define FTDI_CCSMACHX_2_PID     0xF9D2
+-#define FTDI_CCSLOAD_N_GO_3_PID 0xF9D3
+-#define FTDI_CCSICDU64_4_PID    0xF9D4
+-#define FTDI_CCSPRIME8_5_PID    0xF9D5
+-
+-/* Inside Accesso contactless reader (http://www.insidefr.com) */
+-#define INSIDE_ACCESSO		0xFAD0
+-
+-/*
+- * Intrepid Control Systems (http://www.intrepidcs.com/) ValueCAN and NeoVI
+- */
+-#define INTREPID_VID		0x093C
+-#define INTREPID_VALUECAN_PID	0x0601
+-#define INTREPID_NEOVI_PID	0x0701
+-
+-/*
+- * Falcom Wireless Communications GmbH
+- */
+-#define FALCOM_VID		0x0F94	/* Vendor Id */
+-#define FALCOM_TWIST_PID	0x0001	/* Falcom Twist USB GPRS modem */
+-#define FALCOM_SAMBA_PID	0x0005	/* Falcom Samba USB GPRS modem */
+-
+-/*
+- * SUUNTO product ids
+- */
+-#define FTDI_SUUNTO_SPORTS_PID	0xF680	/* Suunto Sports instrument */
+-
+-/*
+- * Oceanic product ids
+- */
+-#define FTDI_OCEANIC_PID	0xF460  /* Oceanic dive instrument */
+-
+-/*
+- * TTi (Thurlby Thandar Instruments)
+- */
+-#define TTI_VID			0x103E	/* Vendor Id */
+-#define TTI_QL355P_PID		0x03E8	/* TTi QL355P power supply */
+-
+-/*
+- * Definitions for B&B Electronics products.
+- */
+-#define BANDB_VID		0x0856	/* B&B Electronics Vendor ID */
+-#define BANDB_USOTL4_PID	0xAC01	/* USOTL4 Isolated RS-485 Converter */
+-#define BANDB_USTL4_PID		0xAC02	/* USTL4 RS-485 Converter */
+-#define BANDB_USO9ML2_PID	0xAC03	/* USO9ML2 Isolated RS-232 Converter */
+-#define BANDB_USOPTL4_PID	0xAC11
+-#define BANDB_USPTL4_PID	0xAC12
+-#define BANDB_USO9ML2DR_2_PID	0xAC16
+-#define BANDB_USO9ML2DR_PID	0xAC17
+-#define BANDB_USOPTL4DR2_PID	0xAC18	/* USOPTL4R-2 2-port Isolated RS-232 Converter */
+-#define BANDB_USOPTL4DR_PID	0xAC19
+-#define BANDB_485USB9F_2W_PID	0xAC25
+-#define BANDB_485USB9F_4W_PID	0xAC26
+-#define BANDB_232USB9M_PID	0xAC27
+-#define BANDB_485USBTB_2W_PID	0xAC33
+-#define BANDB_485USBTB_4W_PID	0xAC34
+-#define BANDB_TTL5USB9M_PID	0xAC49
+-#define BANDB_TTL3USB9M_PID	0xAC50
+-#define BANDB_ZZ_PROG1_USB_PID	0xBA02
+-
+-/*
+- * RM Michaelides CANview USB (http://www.rmcan.com)
+- * CAN fieldbus interface adapter, added by port GmbH www.port.de)
+- * Ian Abbott changed the macro names for consistency.
+- */
+-#define FTDI_RM_CANVIEW_PID	0xfd60	/* Product Id */
+-
+-/*
+- * EVER Eco Pro UPS (http://www.ever.com.pl/)
+- */
+-
+-#define	EVER_ECO_PRO_CDS	0xe520	/* RS-232 converter */
+-
+-/*
+- * 4N-GALAXY.DE PIDs for CAN-USB, USB-RS232, USB-RS422, USB-RS485,
+- * USB-TTY activ, USB-TTY passiv.  Some PIDs are used by several devices
+- * and I'm not entirely sure which are used by which.
+- */
+-#define FTDI_4N_GALAXY_DE_1_PID	0xF3C0
+-#define FTDI_4N_GALAXY_DE_2_PID	0xF3C1
+-
+-/*
+- * Mobility Electronics products.
+- */
+-#define MOBILITY_VID			0x1342
+-#define MOBILITY_USB_SERIAL_PID		0x0202	/* EasiDock USB 200 serial */
+-
+-/*
+- * microHAM product IDs (http://www.microham.com).
+- * Submitted by Justin Burket (KL1RL) <zorton@jtan.com>
+- * and Mike Studer (K6EEP) <k6eep@hamsoftware.org>.
+- * Ian Abbott <abbotti@mev.co.uk> added a few more from the driver INF file.
+- */
+-#define FTDI_MHAM_KW_PID 0xEEE8		/* USB-KW interface */
+-#define FTDI_MHAM_YS_PID 0xEEE9		/* USB-YS interface */
+-#define FTDI_MHAM_Y6_PID 0xEEEA		/* USB-Y6 interface */
+-#define FTDI_MHAM_Y8_PID 0xEEEB		/* USB-Y8 interface */
+-#define FTDI_MHAM_IC_PID 0xEEEC		/* USB-IC interface */
+-#define FTDI_MHAM_DB9_PID 0xEEED	/* USB-DB9 interface */
+-#define FTDI_MHAM_RS232_PID 0xEEEE	/* USB-RS232 interface */
+-#define FTDI_MHAM_Y9_PID 0xEEEF		/* USB-Y9 interface */
+-
+-/*
+- * Active Robots product ids.
+- */
+-#define FTDI_ACTIVE_ROBOTS_PID	0xE548	/* USB comms board */
+-
+-/*
+- * Xsens Technologies BV products (http://www.xsens.com).
+- */
+-#define XSENS_CONVERTER_0_PID	0xD388
+-#define XSENS_CONVERTER_1_PID	0xD389
+-#define XSENS_CONVERTER_2_PID	0xD38A
+-#define XSENS_CONVERTER_3_PID	0xD38B
+-#define XSENS_CONVERTER_4_PID	0xD38C
+-#define XSENS_CONVERTER_5_PID	0xD38D
+-#define XSENS_CONVERTER_6_PID	0xD38E
+-#define XSENS_CONVERTER_7_PID	0xD38F
+-
+-/*
+- * Teratronik product ids.
+- * Submitted by O. Wölfelschneider.
+- */
+-#define FTDI_TERATRONIK_VCP_PID	 0xEC88	/* Teratronik device (preferring VCP driver on windows) */
+-#define FTDI_TERATRONIK_D2XX_PID 0xEC89	/* Teratronik device (preferring D2XX driver on windows) */
+-
+-/*
+- * Evolution Robotics products (http://www.evolution.com/).
+- * Submitted by Shawn M. Lavelle.
+- */
+-#define EVOLUTION_VID		0xDEEE	/* Vendor ID */
+-#define EVOLUTION_ER1_PID	0x0300	/* ER1 Control Module */
+-#define EVO_8U232AM_PID	0x02FF	/* Evolution robotics RCM2 (FT232AM)*/
+-#define EVO_HYBRID_PID		0x0302	/* Evolution robotics RCM4 PID (FT232BM)*/
+-#define EVO_RCM4_PID		0x0303	/* Evolution robotics RCM4 PID */
+-
+-/* Pyramid Computer GmbH */
+-#define FTDI_PYRAMID_PID	0xE6C8	/* Pyramid Appliance Display */
+-
+-/*
+- * NDI (www.ndigital.com) product ids
+- */
+-#define FTDI_NDI_HUC_PID		0xDA70	/* NDI Host USB Converter */
+-#define FTDI_NDI_SPECTRA_SCU_PID	0xDA71	/* NDI Spectra SCU */
+-#define FTDI_NDI_FUTURE_2_PID		0xDA72	/* NDI future device #2 */
+-#define FTDI_NDI_FUTURE_3_PID		0xDA73	/* NDI future device #3 */
+-#define FTDI_NDI_AURORA_SCU_PID		0xDA74	/* NDI Aurora SCU */
+-
+-/*
+- * Posiflex inc retail equipment (http://www.posiflex.com.tw)
+- */
+-#define POSIFLEX_VID		0x0d3a  /* Vendor ID */
+-#define POSIFLEX_PP7000_PID	0x0300  /* PP-7000II thermal printer */
+-
+-/*
+- * Westrex International devices submitted by Cory Lee
+- */
+-#define FTDI_WESTREX_MODEL_777_PID	0xDC00	/* Model 777 */
+-#define FTDI_WESTREX_MODEL_8900F_PID	0xDC01	/* Model 8900F */
+-
+-/*
+- * RR-CirKits LocoBuffer USB (http://www.rr-cirkits.com)
+- */
+-#define FTDI_RRCIRKITS_LOCOBUFFER_PID	0xc7d0	/* LocoBuffer USB */
+-
+-/*
+- * Eclo (http://www.eclo.pt/) product IDs.
+- * PID 0xEA90 submitted by Martin Grill.
+- */
+-#define FTDI_ECLO_COM_1WIRE_PID	0xEA90	/* COM to 1-Wire USB adaptor */
+-
+-/*
+- * Papouch products (http://www.papouch.com/)
+- * Submitted by Folkert van Heusden
+- */
+-
+-#define PAPOUCH_VID			0x5050	/* Vendor ID */
+-#define PAPOUCH_TMU_PID			0x0400	/* TMU USB Thermometer */
+-#define PAPOUCH_QUIDO4x4_PID		0x0900	/* Quido 4/4 Module */
+-
+-/*
+- * ACG Identification Technologies GmbH products (http://www.acg.de/).
+- * Submitted by anton -at- goto10 -dot- org.
+  */
+-#define FTDI_ACG_HFDUAL_PID		0xDD20	/* HF Dual ISO Reader (RFID) */
+-
+-/*
+- * Yost Engineering, Inc. products (www.yostengineering.com).
+- * PID 0xE050 submitted by Aaron Prose.
+- */
+-#define FTDI_YEI_SERVOCENTER31_PID	0xE050	/* YEI ServoCenter3.1 USB */
+-
+-/*
+- * ThorLabs USB motor drivers
+- */
+-#define FTDI_THORLABS_PID		0xfaf0 /* ThorLabs USB motor drivers */
+-
+-/*
+- * Testo products (http://www.testo.com/)
+- * Submitted by Colin Leroy
+- */
+-#define TESTO_VID			0x128D
+-#define TESTO_USB_INTERFACE_PID		0x0001
+-
+-/*
+- * Gamma Scout (http://gamma-scout.com/). Submitted by rsc@runtux.com.
+- */
+-#define FTDI_GAMMA_SCOUT_PID		0xD678	/* Gamma Scout online */
+-
+-/*
+- * Tactrix OpenPort (ECU) devices.
+- * OpenPort 1.3M submitted by Donour Sizemore.
+- * OpenPort 1.3S and 1.3U submitted by Ian Abbott.
+- */
+-#define FTDI_TACTRIX_OPENPORT_13M_PID	0xCC48	/* OpenPort 1.3 Mitsubishi */
+-#define FTDI_TACTRIX_OPENPORT_13S_PID	0xCC49	/* OpenPort 1.3 Subaru */
+-#define FTDI_TACTRIX_OPENPORT_13U_PID	0xCC4A	/* OpenPort 1.3 Universal */
+-
+-/*
+- * Telldus Technologies
+- */
+-#define TELLDUS_VID			0x1781	/* Vendor ID */
+-#define TELLDUS_TELLSTICK_PID		0x0C30	/* RF control dongle 433 MHz using FT232RL */
+-
+-/*
+- * IBS elektronik product ids
+- * Submitted by Thomas Schleusener
+- */
+-#define FTDI_IBS_US485_PID	0xff38  /* IBS US485 (USB<-->RS422/485 interface) */
+-#define FTDI_IBS_PICPRO_PID	0xff39  /* IBS PIC-Programmer */
+-#define FTDI_IBS_PCMCIA_PID	0xff3a  /* IBS Card reader for PCMCIA SRAM-cards */
+-#define FTDI_IBS_PK1_PID	0xff3b  /* IBS PK1 - Particel counter */
+-#define FTDI_IBS_RS232MON_PID	0xff3c  /* IBS RS232 - Monitor */
+-#define FTDI_IBS_APP70_PID	0xff3d  /* APP 70 (dust monitoring system) */
+-#define FTDI_IBS_PEDO_PID	0xff3e  /* IBS PEDO-Modem (RF modem 868.35 MHz) */
+-#define FTDI_IBS_PROD_PID	0xff3f  /* future device */
+-
+-/*
+- *  MaxStream devices	www.maxstream.net
+- */
+-#define FTDI_MAXSTREAM_PID	0xEE18	/* Xbee PKG-U Module */
+-
+-/* Olimex */
+-#define OLIMEX_VID			0x15BA
+-#define OLIMEX_ARM_USB_OCD_PID		0x0003
+-
+-/* Luminary Micro Stellaris Boards, VID = FTDI_VID */
+-/* FTDI 2332C Dual channel device, side A=245 FIFO (JTAG), Side B=RS232 UART */
+-#define LMI_LM3S_DEVEL_BOARD_PID	0xbcd8
+-#define LMI_LM3S_EVAL_BOARD_PID		0xbcd9
+-
+-/* www.elsterelectricity.com Elster Unicom III Optical Probe */
+-#define FTDI_ELSTER_UNICOM_PID		0xE700 /* Product Id */
+-
+-/*
+- * The Mobility Lab (TML)
+- * Submitted by Pierre Castella
+- */
+-#define TML_VID			0x1B91	/* Vendor ID */
+-#define TML_USB_SERIAL_PID	0x0064	/* USB - Serial Converter */
+-
+-/* Propox devices */
+-#define FTDI_PROPOX_JTAGCABLEII_PID	0xD738
+-
+-/* Rig Expert Ukraine devices */
+-#define FTDI_REU_TINY_PID		0xED22	/* RigExpert Tiny */
+-
+-/* Domintell products  http://www.domintell.com */
+-#define FTDI_DOMINTELL_DGQG_PID	0xEF50	/* Master */
+-#define FTDI_DOMINTELL_DUSB_PID	0xEF51	/* DUSB01 module */
+-
+-/* Alti-2 products  http://www.alti-2.com */
+-#define ALTI2_VID	0x1BC9
+-#define ALTI2_N3_PID	0x6001	/* Neptune 3 */
+ 
+ /* Commands */
+ #define FTDI_SIO_RESET 		0 /* Reset the port */
+@@ -910,86 +40,6 @@
+ #define INTERFACE_C		3
+ #define INTERFACE_D		4
+ 
+-/*
+- * FIC / OpenMoko, Inc. http://wiki.openmoko.org/wiki/Neo1973_Debug_Board_v3
+- * Submitted by Harald Welte <laforge@openmoko.org>
+- */
+-#define	FIC_VID			0x1457
+-#define	FIC_NEO1973_DEBUG_PID	0x5118
+-
+-/*
+- * RATOC REX-USB60F
+- */
+-#define RATOC_VENDOR_ID		0x0584
+-#define RATOC_PRODUCT_ID_USB60F	0xb020
+-
+-/*
+- * DIEBOLD BCS SE923
+- */
+-#define DIEBOLD_BCS_SE923_PID	0xfb99
+-
+-/*
+- * Atmel STK541
+- */
+-#define ATMEL_VID		0x03eb /* Vendor ID */
+-#define STK541_PID		0x2109 /* Zigbee Controller */
+-
+-/*
+- * Dresden Elektronic Sensor Terminal Board
+- */
+-#define DE_VID			0x1cf1 /* Vendor ID */
+-#define STB_PID			0x0001 /* Sensor Terminal Board */
+-#define WHT_PID			0x0004 /* Wireless Handheld Terminal */
+-
+-/*
+- * Blackfin gnICE JTAG
+- * http://docs.blackfin.uclinux.org/doku.php?id=hw:jtag:gnice
+- */
+-#define ADI_VID 		0x0456
+-#define ADI_GNICE_PID 		0xF000
+-#define ADI_GNICEPLUS_PID 	0xF001
+-
+-/*
+- * JETI SPECTROMETER SPECBOS 1201
+- * http://www.jeti.com/products/sys/scb/scb1201.php
+- */
+-#define JETI_VID		0x0c6c
+-#define JETI_SPC1201_PID	0x04b2
+-
+-/*
+- * Marvell SheevaPlug
+- */
+-#define MARVELL_VID		0x9e88
+-#define MARVELL_SHEEVAPLUG_PID	0x9e8f
+-
+-#define FTDI_TURTELIZER_PID	0xBDC8 /* JTAG/RS-232 adapter by egnite GmBH */
+-
+-/*
+- * GN Otometrics (http://www.otometrics.com)
+- * Submitted by Ville Sundberg.
+- */
+-#define GN_OTOMETRICS_VID	0x0c33	/* Vendor ID */
+-#define AURICAL_USB_PID		0x0010	/* Aurical USB Audiometer */
+-
+-/*
+- * Bayer Ascensia Contour blood glucose meter USB-converter cable.
+- * http://winglucofacts.com/cables/
+- */
+-#define BAYER_VID                      0x1A79
+-#define BAYER_CONTOUR_CABLE_PID        0x6001
+-
+-/*
+- * Marvell OpenRD Base, Client
+- * http://www.open-rd.org
+- * OpenRD Base, Client use VID 0x0403
+- */
+-#define MARVELL_OPENRD_PID	0x9e90
+-
+-/*
+- * Hameg HO820 and HO870 interface (using VID 0x0403)
+- */
+-#define        HAMEG_HO820_PID         0xed74
+-#define        HAMEG_HO870_PID         0xed71
+ 
+ /*
+  *   BmRequestType:  1100 0000b
+@@ -1504,4 +554,3 @@ typedef enum {
+  * B2..7	Length of message - (not including Byte 0)
+  *
+  */
+-
+diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
+new file mode 100644
+index 0000000..d10b5a8
+--- /dev/null
++++ b/drivers/usb/serial/ftdi_sio_ids.h
+@@ -0,0 +1,1019 @@
++/*
++ * vendor/product IDs (VID/PID) of devices using FTDI USB serial converters.
++ * Please keep numerically sorted within individual areas, thanks!
++ *
++ * Philipp Gühring - pg@futureware.at - added the Device ID of the USB relais
++ * from Rudolf Gugler
++ *
++ */
++
++
++/**********************************/
++/***** devices using FTDI VID *****/
++/**********************************/
++
++
++#define FTDI_VID	0x0403	/* Vendor Id */
++
++
++/*** "original" FTDI device PIDs ***/
++
++#define FTDI_8U232AM_PID 0x6001 /* Similar device to SIO above */
++#define FTDI_8U232AM_ALT_PID 0x6006 /* FTDI's alternate PID for above */
++#define FTDI_8U2232C_PID 0x6010 /* Dual channel device */
++#define FTDI_4232H_PID 0x6011 /* Quad channel hi-speed device */
++#define FTDI_SIO_PID	0x8372	/* Product Id SIO application of 8U100AX  */
++#define FTDI_232RL_PID  0xFBFA  /* Product ID for FT232RL */
++
++
++/*** third-party PIDs (using FTDI_VID) ***/
++
++/*
++ * Marvell OpenRD Base, Client
++ * http://www.open-rd.org
++ * OpenRD Base, Client use VID 0x0403
++ */
++#define MARVELL_OPENRD_PID	0x9e90
++
++/* www.candapter.com Ewert Energy Systems CANdapter device */
++#define FTDI_CANDAPTER_PID 0x9F80 /* Product Id */
++
++#define FTDI_NXTCAM_PID		0xABB8 /* NXTCam for Mindstorms NXT */
++
++/* OOCDlink by Joern Kaipf <joernk@web.de>
++ * (http://www.joernonline.de/dw/doku.php?id=start&idx=projects:oocdlink) */
++#define FTDI_OOCDLINK_PID	0xbaf8	/* Amontec JTAGkey */
++
++/* Luminary Micro Stellaris Boards, VID = FTDI_VID */
++/* FTDI 2332C Dual channel device, side A=245 FIFO (JTAG), Side B=RS232 UART */
++#define LMI_LM3S_DEVEL_BOARD_PID	0xbcd8
++#define LMI_LM3S_EVAL_BOARD_PID		0xbcd9
++
++#define FTDI_TURTELIZER_PID	0xBDC8 /* JTAG/RS-232 adapter by egnite GmBH */
++
++/* OpenDCC (www.opendcc.de) product id */
++#define FTDI_OPENDCC_PID	0xBFD8
++#define FTDI_OPENDCC_SNIFFER_PID	0xBFD9
++#define FTDI_OPENDCC_THROTTLE_PID	0xBFDA
++#define FTDI_OPENDCC_GATEWAY_PID	0xBFDB
++
++/*
++ * RR-CirKits LocoBuffer USB (http://www.rr-cirkits.com)
++ */
++#define FTDI_RRCIRKITS_LOCOBUFFER_PID	0xc7d0	/* LocoBuffer USB */
++
++/* DMX4ALL DMX Interfaces */
++#define FTDI_DMX4ALL 0xC850
++
++/*
++ * ASK.fr devices
++ */
++#define FTDI_ASK_RDR400_PID	0xC991	/* ASK RDR 400 series card reader */
++
++/* www.starting-point-systems.com µChameleon device */
++#define FTDI_MICRO_CHAMELEON_PID	0xCAA0	/* Product Id */
++
++/*
++ * Tactrix OpenPort (ECU) devices.
++ * OpenPort 1.3M submitted by Donour Sizemore.
++ * OpenPort 1.3S and 1.3U submitted by Ian Abbott.
++ */
++#define FTDI_TACTRIX_OPENPORT_13M_PID	0xCC48	/* OpenPort 1.3 Mitsubishi */
++#define FTDI_TACTRIX_OPENPORT_13S_PID	0xCC49	/* OpenPort 1.3 Subaru */
++#define FTDI_TACTRIX_OPENPORT_13U_PID	0xCC4A	/* OpenPort 1.3 Universal */
++
++/* SCS HF Radio Modems PID's (http://www.scs-ptc.com) */
++/* the VID is the standard ftdi vid (FTDI_VID) */
++#define FTDI_SCS_DEVICE_0_PID 0xD010    /* SCS PTC-IIusb */
++#define FTDI_SCS_DEVICE_1_PID 0xD011    /* SCS Tracker / DSP TNC */
++#define FTDI_SCS_DEVICE_2_PID 0xD012
++#define FTDI_SCS_DEVICE_3_PID 0xD013
++#define FTDI_SCS_DEVICE_4_PID 0xD014
++#define FTDI_SCS_DEVICE_5_PID 0xD015
++#define FTDI_SCS_DEVICE_6_PID 0xD016
++#define FTDI_SCS_DEVICE_7_PID 0xD017
++
++/* iPlus device */
++#define FTDI_IPLUS_PID 0xD070 /* Product Id */
++#define FTDI_IPLUS2_PID 0xD071 /* Product Id */
++
++/*
++ * Gamma Scout (http://gamma-scout.com/). Submitted by rsc@runtux.com.
++ */
++#define FTDI_GAMMA_SCOUT_PID		0xD678	/* Gamma Scout online */
++
++/* Propox devices */
++#define FTDI_PROPOX_JTAGCABLEII_PID	0xD738
++
++/*
++ * Xsens Technologies BV products (http://www.xsens.com).
++ */
++#define XSENS_CONVERTER_0_PID	0xD388
++#define XSENS_CONVERTER_1_PID	0xD389
++#define XSENS_CONVERTER_2_PID	0xD38A
++#define XSENS_CONVERTER_3_PID	0xD38B
++#define XSENS_CONVERTER_4_PID	0xD38C
++#define XSENS_CONVERTER_5_PID	0xD38D
++#define XSENS_CONVERTER_6_PID	0xD38E
++#define XSENS_CONVERTER_7_PID	0xD38F
++
++/*
++ * NDI (www.ndigital.com) product ids
++ */
++#define FTDI_NDI_HUC_PID		0xDA70	/* NDI Host USB Converter */
++#define FTDI_NDI_SPECTRA_SCU_PID	0xDA71	/* NDI Spectra SCU */
++#define FTDI_NDI_FUTURE_2_PID		0xDA72	/* NDI future device #2 */
++#define FTDI_NDI_FUTURE_3_PID		0xDA73	/* NDI future device #3 */
++#define FTDI_NDI_AURORA_SCU_PID		0xDA74	/* NDI Aurora SCU */
++
++/*
++ * Westrex International devices submitted by Cory Lee
++ */
++#define FTDI_WESTREX_MODEL_777_PID	0xDC00	/* Model 777 */
++#define FTDI_WESTREX_MODEL_8900F_PID	0xDC01	/* Model 8900F */
++
++/*
++ * ACG Identification Technologies GmbH products (http://www.acg.de/).
++ * Submitted by anton -at- goto10 -dot- org.
++ */
++#define FTDI_ACG_HFDUAL_PID		0xDD20	/* HF Dual ISO Reader (RFID) */
++
++/*
++ * Definitions for Artemis astronomical USB based cameras
++ * Check it at http://www.artemisccd.co.uk/
++ */
++#define FTDI_ARTEMIS_PID	0xDF28	/* All Artemis Cameras */
++
++/*
++ * Definitions for ATIK Instruments astronomical USB based cameras
++ * Check it at http://www.atik-instruments.com/
++ */
++#define FTDI_ATIK_ATK16_PID	0xDF30	/* ATIK ATK-16 Grayscale Camera */
++#define FTDI_ATIK_ATK16C_PID	0xDF32	/* ATIK ATK-16C Colour Camera */
++#define FTDI_ATIK_ATK16HR_PID	0xDF31	/* ATIK ATK-16HR Grayscale Camera */
++#define FTDI_ATIK_ATK16HRC_PID	0xDF33	/* ATIK ATK-16HRC Colour Camera */
++#define FTDI_ATIK_ATK16IC_PID   0xDF35  /* ATIK ATK-16IC Grayscale Camera */
++
++/*
++ * Yost Engineering, Inc. products (www.yostengineering.com).
++ * PID 0xE050 submitted by Aaron Prose.
++ */
++#define FTDI_YEI_SERVOCENTER31_PID	0xE050	/* YEI ServoCenter3.1 USB */
++
++/*
++ * ELV USB devices submitted by Christian Abt of ELV (www.elv.de).
++ * All of these devices use FTDI's vendor ID (0x0403).
++ * Further IDs taken from ELV Windows .inf file.
++ *
++ * The previously included PID for the UO 100 module was incorrect.
++ * In fact, that PID was for ELV's UR 100 USB-RS232 converter (0xFB58).
++ *
++ * Armin Laeuger originally sent the PID for the UM 100 module.
++ */
++#define FTDI_ELV_USR_PID	0xE000	/* ELV Universal-Sound-Recorder */
++#define FTDI_ELV_MSM1_PID	0xE001	/* ELV Mini-Sound-Modul */
++#define FTDI_ELV_KL100_PID	0xE002	/* ELV Kfz-Leistungsmesser KL 100 */
++#define FTDI_ELV_WS550_PID	0xE004	/* WS 550 */
++#define FTDI_ELV_EC3000_PID	0xE006	/* ENERGY CONTROL 3000 USB */
++#define FTDI_ELV_WS888_PID	0xE008	/* WS 888 */
++#define FTDI_ELV_TWS550_PID	0xE009	/* Technoline WS 550 */
++#define FTDI_ELV_FEM_PID	0xE00A	/* Funk Energie Monitor */
++#define FTDI_ELV_FHZ1300PC_PID	0xE0E8	/* FHZ 1300 PC */
++#define FTDI_ELV_WS500_PID	0xE0E9	/* PC-Wetterstation (WS 500) */
++#define FTDI_ELV_HS485_PID	0xE0EA	/* USB to RS-485 adapter */
++#define FTDI_ELV_UMS100_PID	0xE0EB	/* ELV USB Master-Slave Schaltsteckdose UMS 100 */
++#define FTDI_ELV_TFD128_PID	0xE0EC	/* ELV Temperatur-Feuchte-Datenlogger TFD 128 */
++#define FTDI_ELV_FM3RX_PID	0xE0ED	/* ELV Messwertuebertragung FM3 RX */
++#define FTDI_ELV_WS777_PID	0xE0EE	/* Conrad WS 777 */
++#define FTDI_ELV_EM1010PC_PID	0xE0EF	/* Engery monitor EM 1010 PC */
++#define FTDI_ELV_CSI8_PID	0xE0F0	/* Computer-Schalt-Interface (CSI 8) */
++#define FTDI_ELV_EM1000DL_PID	0xE0F1	/* PC-Datenlogger fuer Energiemonitor (EM 1000 DL) */
++#define FTDI_ELV_PCK100_PID	0xE0F2	/* PC-Kabeltester (PCK 100) */
++#define FTDI_ELV_RFP500_PID	0xE0F3	/* HF-Leistungsmesser (RFP 500) */
++#define FTDI_ELV_FS20SIG_PID	0xE0F4	/* Signalgeber (FS 20 SIG) */
++#define FTDI_ELV_UTP8_PID	0xE0F5	/* ELV UTP 8 */
++#define FTDI_ELV_WS300PC_PID	0xE0F6	/* PC-Wetterstation (WS 300 PC) */
++#define FTDI_ELV_WS444PC_PID	0xE0F7	/* Conrad WS 444 PC */
++#define FTDI_PHI_FISCO_PID      0xE40B  /* PHI Fisco USB to Serial cable */
++#define FTDI_ELV_UAD8_PID	0xF068	/* USB-AD-Wandler (UAD 8) */
++#define FTDI_ELV_UDA7_PID	0xF069	/* USB-DA-Wandler (UDA 7) */
++#define FTDI_ELV_USI2_PID	0xF06A	/* USB-Schrittmotoren-Interface (USI 2) */
++#define FTDI_ELV_T1100_PID	0xF06B	/* Thermometer (T 1100) */
++#define FTDI_ELV_PCD200_PID	0xF06C	/* PC-Datenlogger (PCD 200) */
++#define FTDI_ELV_ULA200_PID	0xF06D	/* USB-LCD-Ansteuerung (ULA 200) */
++#define FTDI_ELV_ALC8500_PID	0xF06E	/* ALC 8500 Expert */
++#define FTDI_ELV_FHZ1000PC_PID	0xF06F	/* FHZ 1000 PC */
++#define FTDI_ELV_UR100_PID	0xFB58	/* USB-RS232-Umsetzer (UR 100) */
++#define FTDI_ELV_UM100_PID	0xFB5A	/* USB-Modul UM 100 */
++#define FTDI_ELV_UO100_PID	0xFB5B	/* USB-Modul UO 100 */
++/* Additional ELV PIDs that default to using the FTDI D2XX drivers on
++ * MS Windows, rather than the FTDI Virtual Com Port drivers.
++ * Maybe these will be easier to use with the libftdi/libusb user-space
++ * drivers, or possibly the Comedi drivers in some cases. */
++#define FTDI_ELV_CLI7000_PID	0xFB59	/* Computer-Light-Interface (CLI 7000) */
++#define FTDI_ELV_PPS7330_PID	0xFB5C	/* Processor-Power-Supply (PPS 7330) */
++#define FTDI_ELV_TFM100_PID	0xFB5D	/* Temperartur-Feuchte Messgeraet (TFM 100) */
++#define FTDI_ELV_UDF77_PID	0xFB5E	/* USB DCF Funkurh (UDF 77) */
++#define FTDI_ELV_UIO88_PID	0xFB5F	/* USB-I/O Interface (UIO 88) */
++
++/*
++ * EVER Eco Pro UPS (http://www.ever.com.pl/)
++ */
++
++#define	EVER_ECO_PRO_CDS	0xe520	/* RS-232 converter */
++
++/*
++ * Active Robots product ids.
++ */
++#define FTDI_ACTIVE_ROBOTS_PID	0xE548	/* USB comms board */
++
++/* Pyramid Computer GmbH */
++#define FTDI_PYRAMID_PID	0xE6C8	/* Pyramid Appliance Display */
++
++/* www.elsterelectricity.com Elster Unicom III Optical Probe */
++#define FTDI_ELSTER_UNICOM_PID		0xE700 /* Product Id */
++
++/*
++ * Gude Analog- und Digitalsysteme GmbH
++ */
++#define FTDI_GUDEADS_E808_PID    0xE808
++#define FTDI_GUDEADS_E809_PID    0xE809
++#define FTDI_GUDEADS_E80A_PID    0xE80A
++#define FTDI_GUDEADS_E80B_PID    0xE80B
++#define FTDI_GUDEADS_E80C_PID    0xE80C
++#define FTDI_GUDEADS_E80D_PID    0xE80D
++#define FTDI_GUDEADS_E80E_PID    0xE80E
++#define FTDI_GUDEADS_E80F_PID    0xE80F
++#define FTDI_GUDEADS_E888_PID    0xE888  /* Expert ISDN Control USB */
++#define FTDI_GUDEADS_E889_PID    0xE889  /* USB RS-232 OptoBridge */
++#define FTDI_GUDEADS_E88A_PID    0xE88A
++#define FTDI_GUDEADS_E88B_PID    0xE88B
++#define FTDI_GUDEADS_E88C_PID    0xE88C
++#define FTDI_GUDEADS_E88D_PID    0xE88D
++#define FTDI_GUDEADS_E88E_PID    0xE88E
++#define FTDI_GUDEADS_E88F_PID    0xE88F
++
++/*
++ * Eclo (http://www.eclo.pt/) product IDs.
++ * PID 0xEA90 submitted by Martin Grill.
++ */
++#define FTDI_ECLO_COM_1WIRE_PID	0xEA90	/* COM to 1-Wire USB adaptor */
++
++/* TNC-X USB-to-packet-radio adapter, versions prior to 3.0 (DLP module) */
++#define FTDI_TNC_X_PID		0xEBE0
++
++/*
++ * Teratronik product ids.
++ * Submitted by O. Wölfelschneider.
++ */
++#define FTDI_TERATRONIK_VCP_PID	 0xEC88	/* Teratronik device (preferring VCP driver on windows) */
++#define FTDI_TERATRONIK_D2XX_PID 0xEC89	/* Teratronik device (preferring D2XX driver on windows) */
++
++/* Rig Expert Ukraine devices */
++#define FTDI_REU_TINY_PID		0xED22	/* RigExpert Tiny */
++
++/*
++ * Hameg HO820 and HO870 interface (using VID 0x0403)
++ */
++#define        HAMEG_HO820_PID         0xed74
++#define        HAMEG_HO870_PID         0xed71
++
++/*
++ *  MaxStream devices	www.maxstream.net
++ */
++#define FTDI_MAXSTREAM_PID	0xEE18	/* Xbee PKG-U Module */
++
++/*
++ * microHAM product IDs (http://www.microham.com).
++ * Submitted by Justin Burket (KL1RL) <zorton@jtan.com>
++ * and Mike Studer (K6EEP) <k6eep@hamsoftware.org>.
++ * Ian Abbott <abbotti@mev.co.uk> added a few more from the driver INF file.
++ */
++#define FTDI_MHAM_KW_PID 0xEEE8		/* USB-KW interface */
++#define FTDI_MHAM_YS_PID 0xEEE9		/* USB-YS interface */
++#define FTDI_MHAM_Y6_PID 0xEEEA		/* USB-Y6 interface */
++#define FTDI_MHAM_Y8_PID 0xEEEB		/* USB-Y8 interface */
++#define FTDI_MHAM_IC_PID 0xEEEC		/* USB-IC interface */
++#define FTDI_MHAM_DB9_PID 0xEEED	/* USB-DB9 interface */
++#define FTDI_MHAM_RS232_PID 0xEEEE	/* USB-RS232 interface */
++#define FTDI_MHAM_Y9_PID 0xEEEF		/* USB-Y9 interface */
++
++/* Domintell products  http://www.domintell.com */
++#define FTDI_DOMINTELL_DGQG_PID	0xEF50	/* Master */
++#define FTDI_DOMINTELL_DUSB_PID	0xEF51	/* DUSB01 module */
++
++/*
++ * The following are the values for the Perle Systems
++ * UltraPort USB serial converters
++ */
++#define FTDI_PERLE_ULTRAPORT_PID 0xF0C0	/* Perle UltraPort Product Id */
++
++/* Sprog II (Andrew Crosland's SprogII DCC interface) */
++#define FTDI_SPROG_II		0xF0C8
++
++/* an infrared receiver for user access control with IR tags */
++#define FTDI_PIEGROUP_PID	0xF208	/* Product Id */
++
++/* ACT Solutions HomePro ZWave interface
++   (http://www.act-solutions.com/HomePro.htm) */
++#define FTDI_ACTZWAVE_PID	0xF2D0
++
++/*
++ * 4N-GALAXY.DE PIDs for CAN-USB, USB-RS232, USB-RS422, USB-RS485,
++ * USB-TTY activ, USB-TTY passiv.  Some PIDs are used by several devices
++ * and I'm not entirely sure which are used by which.
++ */
++#define FTDI_4N_GALAXY_DE_1_PID	0xF3C0
++#define FTDI_4N_GALAXY_DE_2_PID	0xF3C1
++
++/*
++ * Linx Technologies product ids
++ */
++#define LINX_SDMUSBQSS_PID	0xF448	/* Linx SDM-USB-QS-S */
++#define LINX_MASTERDEVEL2_PID   0xF449   /* Linx Master Development 2.0 */
++#define LINX_FUTURE_0_PID   0xF44A   /* Linx future device */
++#define LINX_FUTURE_1_PID   0xF44B   /* Linx future device */
++#define LINX_FUTURE_2_PID   0xF44C   /* Linx future device */
++
++/*
++ * Oceanic product ids
++ */
++#define FTDI_OCEANIC_PID	0xF460  /* Oceanic dive instrument */
++
++/*
++ * SUUNTO product ids
++ */
++#define FTDI_SUUNTO_SPORTS_PID	0xF680	/* Suunto Sports instrument */
++
++/* USB-UIRT - An infrared receiver and transmitter using the 8U232AM chip */
++/* http://home.earthlink.net/~jrhees/USBUIRT/index.htm */
++#define FTDI_USB_UIRT_PID	0xF850	/* Product Id */
++
++/* CCS Inc. ICDU/ICDU40 product ID -
++ * the FT232BM is used in an in-circuit-debugger unit for PIC16's/PIC18's */
++#define FTDI_CCSICDU20_0_PID    0xF9D0
++#define FTDI_CCSICDU40_1_PID    0xF9D1
++#define FTDI_CCSMACHX_2_PID     0xF9D2
++#define FTDI_CCSLOAD_N_GO_3_PID 0xF9D3
++#define FTDI_CCSICDU64_4_PID    0xF9D4
++#define FTDI_CCSPRIME8_5_PID    0xF9D5
++
++/*
++ * The following are the values for the Matrix Orbital LCD displays,
++ * which are the FT232BM ( similar to the 8U232AM )
++ */
++#define FTDI_MTXORB_0_PID      0xFA00  /* Matrix Orbital Product Id */
++#define FTDI_MTXORB_1_PID      0xFA01  /* Matrix Orbital Product Id */
++#define FTDI_MTXORB_2_PID      0xFA02  /* Matrix Orbital Product Id */
++#define FTDI_MTXORB_3_PID      0xFA03  /* Matrix Orbital Product Id */
++#define FTDI_MTXORB_4_PID      0xFA04  /* Matrix Orbital Product Id */
++#define FTDI_MTXORB_5_PID      0xFA05  /* Matrix Orbital Product Id */
++#define FTDI_MTXORB_6_PID      0xFA06  /* Matrix Orbital Product Id */
++
++/*
++ * Home Electronics (www.home-electro.com) USB gadgets
++ */
++#define FTDI_HE_TIRA1_PID	0xFA78	/* Tira-1 IR transceiver */
++
++/* Inside Accesso contactless reader (http://www.insidefr.com) */
++#define INSIDE_ACCESSO		0xFAD0
++
++/*
++ * ThorLabs USB motor drivers
++ */
++#define FTDI_THORLABS_PID		0xfaf0 /* ThorLabs USB motor drivers */
++
++/*
++ * Protego product ids
++ */
++#define PROTEGO_SPECIAL_1	0xFC70	/* special/unknown device */
++#define PROTEGO_R2X0		0xFC71	/* R200-USB TRNG unit (R210, R220, and R230) */
++#define PROTEGO_SPECIAL_3	0xFC72	/* special/unknown device */
++#define PROTEGO_SPECIAL_4	0xFC73	/* special/unknown device */
++
++/*
++ * DSS-20 Sync Station for Sony Ericsson P800
++ */
++#define FTDI_DSS20_PID          0xFC82
++
++/* www.irtrans.de device */
++#define FTDI_IRTRANS_PID 0xFC60 /* Product Id */
++
++/*
++ * RM Michaelides CANview USB (http://www.rmcan.com) (FTDI_VID)
++ * CAN fieldbus interface adapter, added by port GmbH www.port.de)
++ * Ian Abbott changed the macro names for consistency.
++ */
++#define FTDI_RM_CANVIEW_PID	0xfd60	/* Product Id */
++/* www.thoughttechnology.com/ TT-USB provide with procomp use ftdi_sio */
++#define FTDI_TTUSB_PID 0xFF20 /* Product Id */
++
++#define FTDI_USBX_707_PID 0xF857	/* ADSTech IR Blaster USBX-707 (FTDI_VID) */
++
++#define FTDI_RELAIS_PID	0xFA10  /* Relais device from Rudolf Gugler */
++
++/*
++ * PCDJ use ftdi based dj-controllers. The following PID is
++ * for their DAC-2 device http://www.pcdjhardware.com/DAC2.asp
++ * (the VID is the standard ftdi vid (FTDI_VID), PID sent by Wouter Paesen)
++ */
++#define FTDI_PCDJ_DAC2_PID 0xFA88
++
++#define FTDI_R2000KU_TRUE_RNG	0xFB80  /* R2000KU TRUE RNG (FTDI_VID) */
++
++/*
++ * DIEBOLD BCS SE923 (FTDI_VID)
++ */
++#define DIEBOLD_BCS_SE923_PID	0xfb99
++
++/* www.crystalfontz.com devices
++ * - thanx for providing free devices for evaluation !
++ * they use the ftdi chipset for the USB interface
++ * and the vendor id is the same
++ */
++#define FTDI_XF_632_PID 0xFC08	/* 632: 16x2 Character Display */
++#define FTDI_XF_634_PID 0xFC09	/* 634: 20x4 Character Display */
++#define FTDI_XF_547_PID 0xFC0A	/* 547: Two line Display */
++#define FTDI_XF_633_PID 0xFC0B	/* 633: 16x2 Character Display with Keys */
++#define FTDI_XF_631_PID 0xFC0C	/* 631: 20x2 Character Display */
++#define FTDI_XF_635_PID 0xFC0D	/* 635: 20x4 Character Display */
++#define FTDI_XF_640_PID 0xFC0E	/* 640: Two line Display */
++#define FTDI_XF_642_PID 0xFC0F	/* 642: Two line Display */
++
++/*
++ * Video Networks Limited / Homechoice in the UK use an ftdi-based device
++ * for their 1Mb broadband internet service.  The following PID is exhibited
++ * by the usb device supplied (the VID is the standard ftdi vid (FTDI_VID)
++ */
++#define FTDI_VNHCPCUSB_D_PID 0xfe38 /* Product Id */
++
++/* AlphaMicro Components AMC-232USB01 device (FTDI_VID) */
++#define FTDI_AMC232_PID 0xFF00 /* Product Id */
++
++/*
++ * IBS elektronik product ids (FTDI_VID)
++ * Submitted by Thomas Schleusener
++ */
++#define FTDI_IBS_US485_PID	0xff38  /* IBS US485 (USB<-->RS422/485 interface) */
++#define FTDI_IBS_PICPRO_PID	0xff39  /* IBS PIC-Programmer */
++#define FTDI_IBS_PCMCIA_PID	0xff3a  /* IBS Card reader for PCMCIA SRAM-cards */
++#define FTDI_IBS_PK1_PID	0xff3b  /* IBS PK1 - Particel counter */
++#define FTDI_IBS_RS232MON_PID	0xff3c  /* IBS RS232 - Monitor */
++#define FTDI_IBS_APP70_PID	0xff3d  /* APP 70 (dust monitoring system) */
++#define FTDI_IBS_PEDO_PID	0xff3e  /* IBS PEDO-Modem (RF modem 868.35 MHz) */
++#define FTDI_IBS_PROD_PID	0xff3f  /* future device */
++/* www.canusb.com Lawicel CANUSB device (FTDI_VID) */
++#define FTDI_CANUSB_PID 0xFFA8 /* Product Id */
++
++
++
++/********************************/
++/** third-party VID/PID combos **/
++/********************************/
++
++
++
++/*
++ * Atmel STK541
++ */
++#define ATMEL_VID		0x03eb /* Vendor ID */
++#define STK541_PID		0x2109 /* Zigbee Controller */
++
++/*
++ * Blackfin gnICE JTAG
++ * http://docs.blackfin.uclinux.org/doku.php?id=hw:jtag:gnice
++ */
++#define ADI_VID 		0x0456
++#define ADI_GNICE_PID 		0xF000
++#define ADI_GNICEPLUS_PID 	0xF001
++
++/*
++ * RATOC REX-USB60F
++ */
++#define RATOC_VENDOR_ID		0x0584
++#define RATOC_PRODUCT_ID_USB60F	0xb020
++
++/*
++ * Contec products (http://www.contec.com)
++ * Submitted by Daniel Sangorrin
++ */
++#define CONTEC_VID		0x06CE	/* Vendor ID */
++#define CONTEC_COM1USBH_PID	0x8311	/* COM-1(USB)H */
++
++/*
++ * Definitions for B&B Electronics products.
++ */
++#define BANDB_VID		0x0856	/* B&B Electronics Vendor ID */
++#define BANDB_USOTL4_PID	0xAC01	/* USOTL4 Isolated RS-485 Converter */
++#define BANDB_USTL4_PID		0xAC02	/* USTL4 RS-485 Converter */
++#define BANDB_USO9ML2_PID	0xAC03	/* USO9ML2 Isolated RS-232 Converter */
++#define BANDB_USOPTL4_PID	0xAC11
++#define BANDB_USPTL4_PID	0xAC12
++#define BANDB_USO9ML2DR_2_PID	0xAC16
++#define BANDB_USO9ML2DR_PID	0xAC17
++#define BANDB_USOPTL4DR2_PID	0xAC18	/* USOPTL4R-2 2-port Isolated RS-232 Converter */
++#define BANDB_USOPTL4DR_PID	0xAC19
++#define BANDB_485USB9F_2W_PID	0xAC25
++#define BANDB_485USB9F_4W_PID	0xAC26
++#define BANDB_232USB9M_PID	0xAC27
++#define BANDB_485USBTB_2W_PID	0xAC33
++#define BANDB_485USBTB_4W_PID	0xAC34
++#define BANDB_TTL5USB9M_PID	0xAC49
++#define BANDB_TTL3USB9M_PID	0xAC50
++#define BANDB_ZZ_PROG1_USB_PID	0xBA02
++
++/*
++ * Intrepid Control Systems (http://www.intrepidcs.com/) ValueCAN and NeoVI
++ */
++#define INTREPID_VID		0x093C
++#define INTREPID_VALUECAN_PID	0x0601
++#define INTREPID_NEOVI_PID	0x0701
++
++/*
++ * Definitions for ID TECH (www.idt-net.com) devices
++ */
++#define IDTECH_VID		0x0ACD	/* ID TECH Vendor ID */
++#define IDTECH_IDT1221U_PID	0x0300	/* IDT1221U USB to RS-232 adapter */
++
++/*
++ * Definitions for Omnidirectional Control Technology, Inc. devices
++ */
++#define OCT_VID			0x0B39	/* OCT vendor ID */
++/* Note: OCT US101 is also rebadged as Dick Smith Electronics (NZ) XH6381 */
++/* Also rebadged as Dick Smith Electronics (Aus) XH6451 */
++/* Also rebadged as SIIG Inc. model US2308 hardware version 1 */
++#define OCT_US101_PID		0x0421	/* OCT US101 USB to RS-232 */
++
++/*
++ * Icom ID-1 digital transceiver
++ */
++
++#define ICOM_ID1_VID            0x0C26
++#define ICOM_ID1_PID            0x0004
++
++/*
++ * GN Otometrics (http://www.otometrics.com)
++ * Submitted by Ville Sundberg.
++ */
++#define GN_OTOMETRICS_VID	0x0c33	/* Vendor ID */
++#define AURICAL_USB_PID		0x0010	/* Aurical USB Audiometer */
++
++/*
++ * The following are the values for the Sealevel SeaLINK+ adapters.
++ * (Original list sent by Tuan Hoang.  Ian Abbott renamed the macros and
++ * removed some PIDs that don't seem to match any existing products.)
++ */
++#define SEALEVEL_VID		0x0c52	/* Sealevel Vendor ID */
++#define SEALEVEL_2101_PID	0x2101	/* SeaLINK+232 (2101/2105) */
++#define SEALEVEL_2102_PID	0x2102	/* SeaLINK+485 (2102) */
++#define SEALEVEL_2103_PID	0x2103	/* SeaLINK+232I (2103) */
++#define SEALEVEL_2104_PID	0x2104	/* SeaLINK+485I (2104) */
++#define SEALEVEL_2106_PID	0x9020	/* SeaLINK+422 (2106) */
++#define SEALEVEL_2201_1_PID	0x2211	/* SeaPORT+2/232 (2201) Port 1 */
++#define SEALEVEL_2201_2_PID	0x2221	/* SeaPORT+2/232 (2201) Port 2 */
++#define SEALEVEL_2202_1_PID	0x2212	/* SeaPORT+2/485 (2202) Port 1 */
++#define SEALEVEL_2202_2_PID	0x2222	/* SeaPORT+2/485 (2202) Port 2 */
++#define SEALEVEL_2203_1_PID	0x2213	/* SeaPORT+2 (2203) Port 1 */
++#define SEALEVEL_2203_2_PID	0x2223	/* SeaPORT+2 (2203) Port 2 */
++#define SEALEVEL_2401_1_PID	0x2411	/* SeaPORT+4/232 (2401) Port 1 */
++#define SEALEVEL_2401_2_PID	0x2421	/* SeaPORT+4/232 (2401) Port 2 */
++#define SEALEVEL_2401_3_PID	0x2431	/* SeaPORT+4/232 (2401) Port 3 */
++#define SEALEVEL_2401_4_PID	0x2441	/* SeaPORT+4/232 (2401) Port 4 */
++#define SEALEVEL_2402_1_PID	0x2412	/* SeaPORT+4/485 (2402) Port 1 */
++#define SEALEVEL_2402_2_PID	0x2422	/* SeaPORT+4/485 (2402) Port 2 */
++#define SEALEVEL_2402_3_PID	0x2432	/* SeaPORT+4/485 (2402) Port 3 */
++#define SEALEVEL_2402_4_PID	0x2442	/* SeaPORT+4/485 (2402) Port 4 */
++#define SEALEVEL_2403_1_PID	0x2413	/* SeaPORT+4 (2403) Port 1 */
++#define SEALEVEL_2403_2_PID	0x2423	/* SeaPORT+4 (2403) Port 2 */
++#define SEALEVEL_2403_3_PID	0x2433	/* SeaPORT+4 (2403) Port 3 */
++#define SEALEVEL_2403_4_PID	0x2443	/* SeaPORT+4 (2403) Port 4 */
++#define SEALEVEL_2801_1_PID	0X2811	/* SeaLINK+8/232 (2801) Port 1 */
++#define SEALEVEL_2801_2_PID	0X2821	/* SeaLINK+8/232 (2801) Port 2 */
++#define SEALEVEL_2801_3_PID	0X2831	/* SeaLINK+8/232 (2801) Port 3 */
++#define SEALEVEL_2801_4_PID	0X2841	/* SeaLINK+8/232 (2801) Port 4 */
++#define SEALEVEL_2801_5_PID	0X2851	/* SeaLINK+8/232 (2801) Port 5 */
++#define SEALEVEL_2801_6_PID	0X2861	/* SeaLINK+8/232 (2801) Port 6 */
++#define SEALEVEL_2801_7_PID	0X2871	/* SeaLINK+8/232 (2801) Port 7 */
++#define SEALEVEL_2801_8_PID	0X2881	/* SeaLINK+8/232 (2801) Port 8 */
++#define SEALEVEL_2802_1_PID	0X2812	/* SeaLINK+8/485 (2802) Port 1 */
++#define SEALEVEL_2802_2_PID	0X2822	/* SeaLINK+8/485 (2802) Port 2 */
++#define SEALEVEL_2802_3_PID	0X2832	/* SeaLINK+8/485 (2802) Port 3 */
++#define SEALEVEL_2802_4_PID	0X2842	/* SeaLINK+8/485 (2802) Port 4 */
++#define SEALEVEL_2802_5_PID	0X2852	/* SeaLINK+8/485 (2802) Port 5 */
++#define SEALEVEL_2802_6_PID	0X2862	/* SeaLINK+8/485 (2802) Port 6 */
++#define SEALEVEL_2802_7_PID	0X2872	/* SeaLINK+8/485 (2802) Port 7 */
++#define SEALEVEL_2802_8_PID	0X2882	/* SeaLINK+8/485 (2802) Port 8 */
++#define SEALEVEL_2803_1_PID	0X2813	/* SeaLINK+8 (2803) Port 1 */
++#define SEALEVEL_2803_2_PID	0X2823 	/* SeaLINK+8 (2803) Port 2 */
++#define SEALEVEL_2803_3_PID	0X2833 	/* SeaLINK+8 (2803) Port 3 */
++#define SEALEVEL_2803_4_PID	0X2843 	/* SeaLINK+8 (2803) Port 4 */
++#define SEALEVEL_2803_5_PID	0X2853 	/* SeaLINK+8 (2803) Port 5 */
++#define SEALEVEL_2803_6_PID	0X2863 	/* SeaLINK+8 (2803) Port 6 */
++#define SEALEVEL_2803_7_PID	0X2873 	/* SeaLINK+8 (2803) Port 7 */
++#define SEALEVEL_2803_8_PID	0X2883 	/* SeaLINK+8 (2803) Port 8 */
++
++/*
++ * JETI SPECTROMETER SPECBOS 1201
++ * http://www.jeti.com/products/sys/scb/scb1201.php
++ */
++#define JETI_VID		0x0c6c
++#define JETI_SPC1201_PID	0x04b2
++
++/*
++ * FTDI USB UART chips used in construction projects from the
++ * Elektor Electronics magazine (http://elektor-electronics.co.uk)
++ */
++#define ELEKTOR_VID		0x0C7D
++#define ELEKTOR_FT323R_PID	0x0005	/* RFID-Reader, issue 09-2006 */
++
++/*
++ * Posiflex inc retail equipment (http://www.posiflex.com.tw)
++ */
++#define POSIFLEX_VID		0x0d3a  /* Vendor ID */
++#define POSIFLEX_PP7000_PID	0x0300  /* PP-7000II thermal printer */
++
++/*
++ * The following are the values for two KOBIL chipcard terminals.
++ */
++#define KOBIL_VID		0x0d46	/* KOBIL Vendor ID */
++#define KOBIL_CONV_B1_PID	0x2020	/* KOBIL Konverter for B1 */
++#define KOBIL_CONV_KAAN_PID	0x2021	/* KOBIL_Konverter for KAAN */
++
++#define FTDI_NF_RIC_VID	0x0DCD	/* Vendor Id */
++#define FTDI_NF_RIC_PID	0x0001	/* Product Id */
++
++/*
++ * Falcom Wireless Communications GmbH
++ */
++#define FALCOM_VID		0x0F94	/* Vendor Id */
++#define FALCOM_TWIST_PID	0x0001	/* Falcom Twist USB GPRS modem */
++#define FALCOM_SAMBA_PID	0x0005	/* Falcom Samba USB GPRS modem */
++
++/* Larsen and Brusgaard AltiTrack/USBtrack  */
++#define LARSENBRUSGAARD_VID		0x0FD8
++#define LB_ALTITRACK_PID		0x0001
++
++/*
++ * TTi (Thurlby Thandar Instruments)
++ */
++#define TTI_VID			0x103E	/* Vendor Id */
++#define TTI_QL355P_PID		0x03E8	/* TTi QL355P power supply */
++
++/* Interbiometrics USB I/O Board */
++/* Developed for Interbiometrics by Rudolf Gugler */
++#define INTERBIOMETRICS_VID              0x1209
++#define INTERBIOMETRICS_IOBOARD_PID      0x1002
++#define INTERBIOMETRICS_MINI_IOBOARD_PID 0x1006
++
++/*
++ * Testo products (http://www.testo.com/)
++ * Submitted by Colin Leroy
++ */
++#define TESTO_VID			0x128D
++#define TESTO_USB_INTERFACE_PID		0x0001
++
++/*
++ * Mobility Electronics products.
++ */
++#define MOBILITY_VID			0x1342
++#define MOBILITY_USB_SERIAL_PID		0x0202	/* EasiDock USB 200 serial */
++
++/*
++ * FIC / OpenMoko, Inc. http://wiki.openmoko.org/wiki/Neo1973_Debug_Board_v3
++ * Submitted by Harald Welte <laforge@openmoko.org>
++ */
++#define	FIC_VID			0x1457
++#define	FIC_NEO1973_DEBUG_PID	0x5118
++
++/* Olimex */
++#define OLIMEX_VID			0x15BA
++#define OLIMEX_ARM_USB_OCD_PID		0x0003
++
++/*
++ * Telldus Technologies
++ */
++#define TELLDUS_VID			0x1781	/* Vendor ID */
++#define TELLDUS_TELLSTICK_PID		0x0C30	/* RF control dongle 433 MHz using FT232RL */
++
++/*
++ * Bayer Ascensia Contour blood glucose meter USB-converter cable.
++ * http://winglucofacts.com/cables/
++ */
++#define BAYER_VID                      0x1A79
++#define BAYER_CONTOUR_CABLE_PID        0x6001
++
++/*
++ * The following are the values for the Matrix Orbital FTDI Range
++ * Anything in this range will use an FT232RL.
++ */
++#define MTXORB_VID			0x1B3D
++#define MTXORB_FTDI_RANGE_0100_PID	0x0100
++#define MTXORB_FTDI_RANGE_0101_PID	0x0101
++#define MTXORB_FTDI_RANGE_0102_PID	0x0102
++#define MTXORB_FTDI_RANGE_0103_PID	0x0103
++#define MTXORB_FTDI_RANGE_0104_PID	0x0104
++#define MTXORB_FTDI_RANGE_0105_PID	0x0105
++#define MTXORB_FTDI_RANGE_0106_PID	0x0106
++#define MTXORB_FTDI_RANGE_0107_PID	0x0107
++#define MTXORB_FTDI_RANGE_0108_PID	0x0108
++#define MTXORB_FTDI_RANGE_0109_PID	0x0109
++#define MTXORB_FTDI_RANGE_010A_PID	0x010A
++#define MTXORB_FTDI_RANGE_010B_PID	0x010B
++#define MTXORB_FTDI_RANGE_010C_PID	0x010C
++#define MTXORB_FTDI_RANGE_010D_PID	0x010D
++#define MTXORB_FTDI_RANGE_010E_PID	0x010E
++#define MTXORB_FTDI_RANGE_010F_PID	0x010F
++#define MTXORB_FTDI_RANGE_0110_PID	0x0110
++#define MTXORB_FTDI_RANGE_0111_PID	0x0111
++#define MTXORB_FTDI_RANGE_0112_PID	0x0112
++#define MTXORB_FTDI_RANGE_0113_PID	0x0113
++#define MTXORB_FTDI_RANGE_0114_PID	0x0114
++#define MTXORB_FTDI_RANGE_0115_PID	0x0115
++#define MTXORB_FTDI_RANGE_0116_PID	0x0116
++#define MTXORB_FTDI_RANGE_0117_PID	0x0117
++#define MTXORB_FTDI_RANGE_0118_PID	0x0118
++#define MTXORB_FTDI_RANGE_0119_PID	0x0119
++#define MTXORB_FTDI_RANGE_011A_PID	0x011A
++#define MTXORB_FTDI_RANGE_011B_PID	0x011B
++#define MTXORB_FTDI_RANGE_011C_PID	0x011C
++#define MTXORB_FTDI_RANGE_011D_PID	0x011D
++#define MTXORB_FTDI_RANGE_011E_PID	0x011E
++#define MTXORB_FTDI_RANGE_011F_PID	0x011F
++#define MTXORB_FTDI_RANGE_0120_PID	0x0120
++#define MTXORB_FTDI_RANGE_0121_PID	0x0121
++#define MTXORB_FTDI_RANGE_0122_PID	0x0122
++#define MTXORB_FTDI_RANGE_0123_PID	0x0123
++#define MTXORB_FTDI_RANGE_0124_PID	0x0124
++#define MTXORB_FTDI_RANGE_0125_PID	0x0125
++#define MTXORB_FTDI_RANGE_0126_PID	0x0126
++#define MTXORB_FTDI_RANGE_0127_PID	0x0127
++#define MTXORB_FTDI_RANGE_0128_PID	0x0128
++#define MTXORB_FTDI_RANGE_0129_PID	0x0129
++#define MTXORB_FTDI_RANGE_012A_PID	0x012A
++#define MTXORB_FTDI_RANGE_012B_PID	0x012B
++#define MTXORB_FTDI_RANGE_012C_PID	0x012C
++#define MTXORB_FTDI_RANGE_012D_PID	0x012D
++#define MTXORB_FTDI_RANGE_012E_PID	0x012E
++#define MTXORB_FTDI_RANGE_012F_PID	0x012F
++#define MTXORB_FTDI_RANGE_0130_PID	0x0130
++#define MTXORB_FTDI_RANGE_0131_PID	0x0131
++#define MTXORB_FTDI_RANGE_0132_PID	0x0132
++#define MTXORB_FTDI_RANGE_0133_PID	0x0133
++#define MTXORB_FTDI_RANGE_0134_PID	0x0134
++#define MTXORB_FTDI_RANGE_0135_PID	0x0135
++#define MTXORB_FTDI_RANGE_0136_PID	0x0136
++#define MTXORB_FTDI_RANGE_0137_PID	0x0137
++#define MTXORB_FTDI_RANGE_0138_PID	0x0138
++#define MTXORB_FTDI_RANGE_0139_PID	0x0139
++#define MTXORB_FTDI_RANGE_013A_PID	0x013A
++#define MTXORB_FTDI_RANGE_013B_PID	0x013B
++#define MTXORB_FTDI_RANGE_013C_PID	0x013C
++#define MTXORB_FTDI_RANGE_013D_PID	0x013D
++#define MTXORB_FTDI_RANGE_013E_PID	0x013E
++#define MTXORB_FTDI_RANGE_013F_PID	0x013F
++#define MTXORB_FTDI_RANGE_0140_PID	0x0140
++#define MTXORB_FTDI_RANGE_0141_PID	0x0141
++#define MTXORB_FTDI_RANGE_0142_PID	0x0142
++#define MTXORB_FTDI_RANGE_0143_PID	0x0143
++#define MTXORB_FTDI_RANGE_0144_PID	0x0144
++#define MTXORB_FTDI_RANGE_0145_PID	0x0145
++#define MTXORB_FTDI_RANGE_0146_PID	0x0146
++#define MTXORB_FTDI_RANGE_0147_PID	0x0147
++#define MTXORB_FTDI_RANGE_0148_PID	0x0148
++#define MTXORB_FTDI_RANGE_0149_PID	0x0149
++#define MTXORB_FTDI_RANGE_014A_PID	0x014A
++#define MTXORB_FTDI_RANGE_014B_PID	0x014B
++#define MTXORB_FTDI_RANGE_014C_PID	0x014C
++#define MTXORB_FTDI_RANGE_014D_PID	0x014D
++#define MTXORB_FTDI_RANGE_014E_PID	0x014E
++#define MTXORB_FTDI_RANGE_014F_PID	0x014F
++#define MTXORB_FTDI_RANGE_0150_PID	0x0150
++#define MTXORB_FTDI_RANGE_0151_PID	0x0151
++#define MTXORB_FTDI_RANGE_0152_PID	0x0152
++#define MTXORB_FTDI_RANGE_0153_PID	0x0153
++#define MTXORB_FTDI_RANGE_0154_PID	0x0154
++#define MTXORB_FTDI_RANGE_0155_PID	0x0155
++#define MTXORB_FTDI_RANGE_0156_PID	0x0156
++#define MTXORB_FTDI_RANGE_0157_PID	0x0157
++#define MTXORB_FTDI_RANGE_0158_PID	0x0158
++#define MTXORB_FTDI_RANGE_0159_PID	0x0159
++#define MTXORB_FTDI_RANGE_015A_PID	0x015A
++#define MTXORB_FTDI_RANGE_015B_PID	0x015B
++#define MTXORB_FTDI_RANGE_015C_PID	0x015C
++#define MTXORB_FTDI_RANGE_015D_PID	0x015D
++#define MTXORB_FTDI_RANGE_015E_PID	0x015E
++#define MTXORB_FTDI_RANGE_015F_PID	0x015F
++#define MTXORB_FTDI_RANGE_0160_PID	0x0160
++#define MTXORB_FTDI_RANGE_0161_PID	0x0161
++#define MTXORB_FTDI_RANGE_0162_PID	0x0162
++#define MTXORB_FTDI_RANGE_0163_PID	0x0163
++#define MTXORB_FTDI_RANGE_0164_PID	0x0164
++#define MTXORB_FTDI_RANGE_0165_PID	0x0165
++#define MTXORB_FTDI_RANGE_0166_PID	0x0166
++#define MTXORB_FTDI_RANGE_0167_PID	0x0167
++#define MTXORB_FTDI_RANGE_0168_PID	0x0168
++#define MTXORB_FTDI_RANGE_0169_PID	0x0169
++#define MTXORB_FTDI_RANGE_016A_PID	0x016A
++#define MTXORB_FTDI_RANGE_016B_PID	0x016B
++#define MTXORB_FTDI_RANGE_016C_PID	0x016C
++#define MTXORB_FTDI_RANGE_016D_PID	0x016D
++#define MTXORB_FTDI_RANGE_016E_PID	0x016E
++#define MTXORB_FTDI_RANGE_016F_PID	0x016F
++#define MTXORB_FTDI_RANGE_0170_PID	0x0170
++#define MTXORB_FTDI_RANGE_0171_PID	0x0171
++#define MTXORB_FTDI_RANGE_0172_PID	0x0172
++#define MTXORB_FTDI_RANGE_0173_PID	0x0173
++#define MTXORB_FTDI_RANGE_0174_PID	0x0174
++#define MTXORB_FTDI_RANGE_0175_PID	0x0175
++#define MTXORB_FTDI_RANGE_0176_PID	0x0176
++#define MTXORB_FTDI_RANGE_0177_PID	0x0177
++#define MTXORB_FTDI_RANGE_0178_PID	0x0178
++#define MTXORB_FTDI_RANGE_0179_PID	0x0179
++#define MTXORB_FTDI_RANGE_017A_PID	0x017A
++#define MTXORB_FTDI_RANGE_017B_PID	0x017B
++#define MTXORB_FTDI_RANGE_017C_PID	0x017C
++#define MTXORB_FTDI_RANGE_017D_PID	0x017D
++#define MTXORB_FTDI_RANGE_017E_PID	0x017E
++#define MTXORB_FTDI_RANGE_017F_PID	0x017F
++#define MTXORB_FTDI_RANGE_0180_PID	0x0180
++#define MTXORB_FTDI_RANGE_0181_PID	0x0181
++#define MTXORB_FTDI_RANGE_0182_PID	0x0182
++#define MTXORB_FTDI_RANGE_0183_PID	0x0183
++#define MTXORB_FTDI_RANGE_0184_PID	0x0184
++#define MTXORB_FTDI_RANGE_0185_PID	0x0185
++#define MTXORB_FTDI_RANGE_0186_PID	0x0186
++#define MTXORB_FTDI_RANGE_0187_PID	0x0187
++#define MTXORB_FTDI_RANGE_0188_PID	0x0188
++#define MTXORB_FTDI_RANGE_0189_PID	0x0189
++#define MTXORB_FTDI_RANGE_018A_PID	0x018A
++#define MTXORB_FTDI_RANGE_018B_PID	0x018B
++#define MTXORB_FTDI_RANGE_018C_PID	0x018C
++#define MTXORB_FTDI_RANGE_018D_PID	0x018D
++#define MTXORB_FTDI_RANGE_018E_PID	0x018E
++#define MTXORB_FTDI_RANGE_018F_PID	0x018F
++#define MTXORB_FTDI_RANGE_0190_PID	0x0190
++#define MTXORB_FTDI_RANGE_0191_PID	0x0191
++#define MTXORB_FTDI_RANGE_0192_PID	0x0192
++#define MTXORB_FTDI_RANGE_0193_PID	0x0193
++#define MTXORB_FTDI_RANGE_0194_PID	0x0194
++#define MTXORB_FTDI_RANGE_0195_PID	0x0195
++#define MTXORB_FTDI_RANGE_0196_PID	0x0196
++#define MTXORB_FTDI_RANGE_0197_PID	0x0197
++#define MTXORB_FTDI_RANGE_0198_PID	0x0198
++#define MTXORB_FTDI_RANGE_0199_PID	0x0199
++#define MTXORB_FTDI_RANGE_019A_PID	0x019A
++#define MTXORB_FTDI_RANGE_019B_PID	0x019B
++#define MTXORB_FTDI_RANGE_019C_PID	0x019C
++#define MTXORB_FTDI_RANGE_019D_PID	0x019D
++#define MTXORB_FTDI_RANGE_019E_PID	0x019E
++#define MTXORB_FTDI_RANGE_019F_PID	0x019F
++#define MTXORB_FTDI_RANGE_01A0_PID	0x01A0
++#define MTXORB_FTDI_RANGE_01A1_PID	0x01A1
++#define MTXORB_FTDI_RANGE_01A2_PID	0x01A2
++#define MTXORB_FTDI_RANGE_01A3_PID	0x01A3
++#define MTXORB_FTDI_RANGE_01A4_PID	0x01A4
++#define MTXORB_FTDI_RANGE_01A5_PID	0x01A5
++#define MTXORB_FTDI_RANGE_01A6_PID	0x01A6
++#define MTXORB_FTDI_RANGE_01A7_PID	0x01A7
++#define MTXORB_FTDI_RANGE_01A8_PID	0x01A8
++#define MTXORB_FTDI_RANGE_01A9_PID	0x01A9
++#define MTXORB_FTDI_RANGE_01AA_PID	0x01AA
++#define MTXORB_FTDI_RANGE_01AB_PID	0x01AB
++#define MTXORB_FTDI_RANGE_01AC_PID	0x01AC
++#define MTXORB_FTDI_RANGE_01AD_PID	0x01AD
++#define MTXORB_FTDI_RANGE_01AE_PID	0x01AE
++#define MTXORB_FTDI_RANGE_01AF_PID	0x01AF
++#define MTXORB_FTDI_RANGE_01B0_PID	0x01B0
++#define MTXORB_FTDI_RANGE_01B1_PID	0x01B1
++#define MTXORB_FTDI_RANGE_01B2_PID	0x01B2
++#define MTXORB_FTDI_RANGE_01B3_PID	0x01B3
++#define MTXORB_FTDI_RANGE_01B4_PID	0x01B4
++#define MTXORB_FTDI_RANGE_01B5_PID	0x01B5
++#define MTXORB_FTDI_RANGE_01B6_PID	0x01B6
++#define MTXORB_FTDI_RANGE_01B7_PID	0x01B7
++#define MTXORB_FTDI_RANGE_01B8_PID	0x01B8
++#define MTXORB_FTDI_RANGE_01B9_PID	0x01B9
++#define MTXORB_FTDI_RANGE_01BA_PID	0x01BA
++#define MTXORB_FTDI_RANGE_01BB_PID	0x01BB
++#define MTXORB_FTDI_RANGE_01BC_PID	0x01BC
++#define MTXORB_FTDI_RANGE_01BD_PID	0x01BD
++#define MTXORB_FTDI_RANGE_01BE_PID	0x01BE
++#define MTXORB_FTDI_RANGE_01BF_PID	0x01BF
++#define MTXORB_FTDI_RANGE_01C0_PID	0x01C0
++#define MTXORB_FTDI_RANGE_01C1_PID	0x01C1
++#define MTXORB_FTDI_RANGE_01C2_PID	0x01C2
++#define MTXORB_FTDI_RANGE_01C3_PID	0x01C3
++#define MTXORB_FTDI_RANGE_01C4_PID	0x01C4
++#define MTXORB_FTDI_RANGE_01C5_PID	0x01C5
++#define MTXORB_FTDI_RANGE_01C6_PID	0x01C6
++#define MTXORB_FTDI_RANGE_01C7_PID	0x01C7
++#define MTXORB_FTDI_RANGE_01C8_PID	0x01C8
++#define MTXORB_FTDI_RANGE_01C9_PID	0x01C9
++#define MTXORB_FTDI_RANGE_01CA_PID	0x01CA
++#define MTXORB_FTDI_RANGE_01CB_PID	0x01CB
++#define MTXORB_FTDI_RANGE_01CC_PID	0x01CC
++#define MTXORB_FTDI_RANGE_01CD_PID	0x01CD
++#define MTXORB_FTDI_RANGE_01CE_PID	0x01CE
++#define MTXORB_FTDI_RANGE_01CF_PID	0x01CF
++#define MTXORB_FTDI_RANGE_01D0_PID	0x01D0
++#define MTXORB_FTDI_RANGE_01D1_PID	0x01D1
++#define MTXORB_FTDI_RANGE_01D2_PID	0x01D2
++#define MTXORB_FTDI_RANGE_01D3_PID	0x01D3
++#define MTXORB_FTDI_RANGE_01D4_PID	0x01D4
++#define MTXORB_FTDI_RANGE_01D5_PID	0x01D5
++#define MTXORB_FTDI_RANGE_01D6_PID	0x01D6
++#define MTXORB_FTDI_RANGE_01D7_PID	0x01D7
++#define MTXORB_FTDI_RANGE_01D8_PID	0x01D8
++#define MTXORB_FTDI_RANGE_01D9_PID	0x01D9
++#define MTXORB_FTDI_RANGE_01DA_PID	0x01DA
++#define MTXORB_FTDI_RANGE_01DB_PID	0x01DB
++#define MTXORB_FTDI_RANGE_01DC_PID	0x01DC
++#define MTXORB_FTDI_RANGE_01DD_PID	0x01DD
++#define MTXORB_FTDI_RANGE_01DE_PID	0x01DE
++#define MTXORB_FTDI_RANGE_01DF_PID	0x01DF
++#define MTXORB_FTDI_RANGE_01E0_PID	0x01E0
++#define MTXORB_FTDI_RANGE_01E1_PID	0x01E1
++#define MTXORB_FTDI_RANGE_01E2_PID	0x01E2
++#define MTXORB_FTDI_RANGE_01E3_PID	0x01E3
++#define MTXORB_FTDI_RANGE_01E4_PID	0x01E4
++#define MTXORB_FTDI_RANGE_01E5_PID	0x01E5
++#define MTXORB_FTDI_RANGE_01E6_PID	0x01E6
++#define MTXORB_FTDI_RANGE_01E7_PID	0x01E7
++#define MTXORB_FTDI_RANGE_01E8_PID	0x01E8
++#define MTXORB_FTDI_RANGE_01E9_PID	0x01E9
++#define MTXORB_FTDI_RANGE_01EA_PID	0x01EA
++#define MTXORB_FTDI_RANGE_01EB_PID	0x01EB
++#define MTXORB_FTDI_RANGE_01EC_PID	0x01EC
++#define MTXORB_FTDI_RANGE_01ED_PID	0x01ED
++#define MTXORB_FTDI_RANGE_01EE_PID	0x01EE
++#define MTXORB_FTDI_RANGE_01EF_PID	0x01EF
++#define MTXORB_FTDI_RANGE_01F0_PID	0x01F0
++#define MTXORB_FTDI_RANGE_01F1_PID	0x01F1
++#define MTXORB_FTDI_RANGE_01F2_PID	0x01F2
++#define MTXORB_FTDI_RANGE_01F3_PID	0x01F3
++#define MTXORB_FTDI_RANGE_01F4_PID	0x01F4
++#define MTXORB_FTDI_RANGE_01F5_PID	0x01F5
++#define MTXORB_FTDI_RANGE_01F6_PID	0x01F6
++#define MTXORB_FTDI_RANGE_01F7_PID	0x01F7
++#define MTXORB_FTDI_RANGE_01F8_PID	0x01F8
++#define MTXORB_FTDI_RANGE_01F9_PID	0x01F9
++#define MTXORB_FTDI_RANGE_01FA_PID	0x01FA
++#define MTXORB_FTDI_RANGE_01FB_PID	0x01FB
++#define MTXORB_FTDI_RANGE_01FC_PID	0x01FC
++#define MTXORB_FTDI_RANGE_01FD_PID	0x01FD
++#define MTXORB_FTDI_RANGE_01FE_PID	0x01FE
++#define MTXORB_FTDI_RANGE_01FF_PID	0x01FF
++
++
++
++/*
++ * The Mobility Lab (TML)
++ * Submitted by Pierre Castella
++ */
++#define TML_VID			0x1B91	/* Vendor ID */
++#define TML_USB_SERIAL_PID	0x0064	/* USB - Serial Converter */
++
++/* Alti-2 products  http://www.alti-2.com */
++#define ALTI2_VID	0x1BC9
++#define ALTI2_N3_PID	0x6001	/* Neptune 3 */
++
++/*
++ * Dresden Elektronic Sensor Terminal Board
++ */
++#define DE_VID			0x1cf1 /* Vendor ID */
++#define STB_PID			0x0001 /* Sensor Terminal Board */
++#define WHT_PID			0x0004 /* Wireless Handheld Terminal */
++
++/*
++ * Papouch products (http://www.papouch.com/)
++ * Submitted by Folkert van Heusden
++ */
++
++#define PAPOUCH_VID			0x5050	/* Vendor ID */
++#define PAPOUCH_TMU_PID			0x0400	/* TMU USB Thermometer */
++#define PAPOUCH_QUIDO4x4_PID		0x0900	/* Quido 4/4 Module */
++#define PAPOUCH_AD4USB_PID		0x8003	/* AD4USB Measurement Module */
++
++/*
++ * Marvell SheevaPlug
++ */
++#define MARVELL_VID		0x9e88
++#define MARVELL_SHEEVAPLUG_PID	0x9e8f
++
++/*
++ * Evolution Robotics products (http://www.evolution.com/).
++ * Submitted by Shawn M. Lavelle.
++ */
++#define EVOLUTION_VID		0xDEEE	/* Vendor ID */
++#define EVOLUTION_ER1_PID	0x0300	/* ER1 Control Module */
++#define EVO_8U232AM_PID	0x02FF	/* Evolution robotics RCM2 (FT232AM)*/
++#define EVO_HYBRID_PID		0x0302	/* Evolution robotics RCM4 PID (FT232BM)*/
++#define EVO_RCM4_PID		0x0303	/* Evolution robotics RCM4 PID */
++
++/*
++ * MJS Gadgets HD Radio / XM Radio / Sirius Radio interfaces (using VID 0x0403)
++ */
++#define MJSG_GENERIC_PID	0x9378
++#define MJSG_SR_RADIO_PID	0x9379
++#define MJSG_XM_RADIO_PID	0x937A
++#define MJSG_HD_RADIO_PID	0x937C
+diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
+index 5019325..3689077 100644
+--- a/drivers/usb/serial/sierra.c
++++ b/drivers/usb/serial/sierra.c
+@@ -567,14 +567,17 @@ static void sierra_indat_callback(struct urb *urb)
+ 	} else {
+ 		if (urb->actual_length) {
+ 			tty = tty_port_tty_get(&port->port);
+-
+-			tty_buffer_request_room(tty, urb->actual_length);
+-			tty_insert_flip_string(tty, data, urb->actual_length);
+-			tty_flip_buffer_push(tty);
+-
+-			tty_kref_put(tty);
+-			usb_serial_debug_data(debug, &port->dev, __func__,
+-				urb->actual_length, data);
++			if (tty) {
++				tty_buffer_request_room(tty,
++					urb->actual_length);
++				tty_insert_flip_string(tty, data,
++					urb->actual_length);
++				tty_flip_buffer_push(tty);
++
++				tty_kref_put(tty);
++				usb_serial_debug_data(debug, &port->dev,
++					__func__, urb->actual_length, data);
++			}
+ 		} else {
+ 			dev_dbg(&port->dev, "%s: empty read urb"
+ 				" received\n", __func__);
+diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
+index c932f90..4d0a208 100644
+--- a/drivers/usb/storage/unusual_devs.h
++++ b/drivers/usb/storage/unusual_devs.h
+@@ -1147,8 +1147,8 @@ UNUSUAL_DEV( 0x0af0, 0x7401, 0x0000, 0x0000,
+ 		0 ),
+ 
+ /* Reported by Jan Dumon <j.dumon@option.com>
+- * This device (wrongly) has a vendor-specific device descriptor.
+- * The entry is needed so usb-storage can bind to it's mass-storage
++ * These devices (wrongly) have a vendor-specific device descriptor.
++ * These entries are needed so usb-storage can bind to their mass-storage
+  * interface as an interface driver */
+ UNUSUAL_DEV( 0x0af0, 0x7501, 0x0000, 0x0000,
+ 		"Option",
+@@ -1156,6 +1156,90 @@ UNUSUAL_DEV( 0x0af0, 0x7501, 0x0000, 0x0000,
+ 		US_SC_DEVICE, US_PR_DEVICE, NULL,
+ 		0 ),
+ 
++UNUSUAL_DEV( 0x0af0, 0x7701, 0x0000, 0x0000,
++		"Option",
++		"GI 0451 SD-Card",
++		US_SC_DEVICE, US_PR_DEVICE, NULL,
++		0 ),
++
++UNUSUAL_DEV( 0x0af0, 0x7706, 0x0000, 0x0000,
++		"Option",
++		"GI 0451 SD-Card",
++		US_SC_DEVICE, US_PR_DEVICE, NULL,
++		0 ),
++
++UNUSUAL_DEV( 0x0af0, 0x7901, 0x0000, 0x0000,
++		"Option",
++		"GI 0452 SD-Card",
++		US_SC_DEVICE, US_PR_DEVICE, NULL,
++		0 ),
++
++UNUSUAL_DEV( 0x0af0, 0x7A01, 0x0000, 0x0000,
++		"Option",
++		"GI 0461 SD-Card",
++		US_SC_DEVICE, US_PR_DEVICE, NULL,
++		0 ),
++
++UNUSUAL_DEV( 0x0af0, 0x7A05, 0x0000, 0x0000,
++		"Option",
++		"GI 0461 SD-Card",
++		US_SC_DEVICE, US_PR_DEVICE, NULL,
++		0 ),
++
++UNUSUAL_DEV( 0x0af0, 0x8300, 0x0000, 0x0000,
++		"Option",
++		"GI 033x SD-Card",
++		US_SC_DEVICE, US_PR_DEVICE, NULL,
++		0 ),
++
++UNUSUAL_DEV( 0x0af0, 0x8302, 0x0000, 0x0000,
++		"Option",
++		"GI 033x SD-Card",
++		US_SC_DEVICE, US_PR_DEVICE, NULL,
++		0 ),
++
++UNUSUAL_DEV( 0x0af0, 0x8304, 0x0000, 0x0000,
++		"Option",
++		"GI 033x SD-Card",
++		US_SC_DEVICE, US_PR_DEVICE, NULL,
++		0 ),
++
++UNUSUAL_DEV( 0x0af0, 0xc100, 0x0000, 0x0000,
++		"Option",
++		"GI 070x SD-Card",
++		US_SC_DEVICE, US_PR_DEVICE, NULL,
++		0 ),
++
++UNUSUAL_DEV( 0x0af0, 0xd057, 0x0000, 0x0000,
++		"Option",
++		"GI 1505 SD-Card",
++		US_SC_DEVICE, US_PR_DEVICE, NULL,
++		0 ),
++
++UNUSUAL_DEV( 0x0af0, 0xd058, 0x0000, 0x0000,
++		"Option",
++		"GI 1509 SD-Card",
++		US_SC_DEVICE, US_PR_DEVICE, NULL,
++		0 ),
++
++UNUSUAL_DEV( 0x0af0, 0xd157, 0x0000, 0x0000,
++		"Option",
++		"GI 1515 SD-Card",
++		US_SC_DEVICE, US_PR_DEVICE, NULL,
++		0 ),
++
++UNUSUAL_DEV( 0x0af0, 0xd257, 0x0000, 0x0000,
++		"Option",
++		"GI 1215 SD-Card",
++		US_SC_DEVICE, US_PR_DEVICE, NULL,
++		0 ),
++
++UNUSUAL_DEV( 0x0af0, 0xd357, 0x0000, 0x0000,
++		"Option",
++		"GI 1505 SD-Card",
++		US_SC_DEVICE, US_PR_DEVICE, NULL,
++		0 ),
++
+ /* Reported by Ben Efros <ben@pc-doctor.com> */
+ UNUSUAL_DEV( 0x0bc2, 0x3010, 0x0000, 0x0000,
+ 		"Seagate",
+diff --git a/drivers/video/offb.c b/drivers/video/offb.c
+index 4d8c54c..b043ac8 100644
+--- a/drivers/video/offb.c
++++ b/drivers/video/offb.c
+@@ -282,8 +282,17 @@ static int offb_set_par(struct fb_info *info)
+ 	return 0;
+ }
+ 
++static void offb_destroy(struct fb_info *info)
++{
++	if (info->screen_base)
++		iounmap(info->screen_base);
++	release_mem_region(info->aperture_base, info->aperture_size);
++	framebuffer_release(info);
++}
++
+ static struct fb_ops offb_ops = {
+ 	.owner		= THIS_MODULE,
++	.fb_destroy	= offb_destroy,
+ 	.fb_setcolreg	= offb_setcolreg,
+ 	.fb_set_par	= offb_set_par,
+ 	.fb_blank	= offb_blank,
+@@ -482,10 +491,14 @@ static void __init offb_init_fb(const char *name, const char *full_name,
+ 	var->sync = 0;
+ 	var->vmode = FB_VMODE_NONINTERLACED;
+ 
++	/* set offb aperture size for generic probing */
++	info->aperture_base = address;
++	info->aperture_size = fix->smem_len;
++
+ 	info->fbops = &offb_ops;
+ 	info->screen_base = ioremap(address, fix->smem_len);
+ 	info->pseudo_palette = (void *) (info + 1);
+-	info->flags = FBINFO_DEFAULT | foreign_endian;
++	info->flags = FBINFO_DEFAULT | FBINFO_MISC_FIRMWARE | foreign_endian;
+ 
+ 	fb_alloc_cmap(&info->cmap, 256, 0);
+ 
+diff --git a/drivers/video/sunxvr500.c b/drivers/video/sunxvr500.c
+index 18b9507..4cd5049 100644
+--- a/drivers/video/sunxvr500.c
++++ b/drivers/video/sunxvr500.c
+@@ -400,6 +400,7 @@ static void __devexit e3d_pci_unregister(struct pci_dev *pdev)
+ 
+ static struct pci_device_id e3d_pci_table[] = {
+ 	{	PCI_DEVICE(PCI_VENDOR_ID_3DLABS, 0x7a0),	},
++	{	PCI_DEVICE(0x1091, 0x7a0),			},
+ 	{	PCI_DEVICE(PCI_VENDOR_ID_3DLABS, 0x7a2),	},
+ 	{	.vendor = PCI_VENDOR_ID_3DLABS,
+ 		.device = PCI_ANY_ID,
+diff --git a/drivers/watchdog/bfin_wdt.c b/drivers/watchdog/bfin_wdt.c
+index c7b3f9d..2159e66 100644
+--- a/drivers/watchdog/bfin_wdt.c
++++ b/drivers/watchdog/bfin_wdt.c
+@@ -1,9 +1,8 @@
+ /*
+  * Blackfin On-Chip Watchdog Driver
+- *  Supports BF53[123]/BF53[467]/BF54[2489]/BF561
+  *
+  * Originally based on softdog.c
+- * Copyright 2006-2007 Analog Devices Inc.
++ * Copyright 2006-2010 Analog Devices Inc.
+  * Copyright 2006-2007 Michele d'Amico
+  * Copyright 1996 Alan Cox <alan@lxorguk.ukuu.org.uk>
+  *
+@@ -137,13 +136,15 @@ static int bfin_wdt_running(void)
+  */
+ static int bfin_wdt_set_timeout(unsigned long t)
+ {
+-	u32 cnt;
++	u32 cnt, max_t, sclk;
+ 	unsigned long flags;
+ 
+-	stampit();
++	sclk = get_sclk();
++	max_t = -1 / sclk;
++	cnt = t * sclk;
++	stamp("maxtimeout=%us newtimeout=%lus (cnt=%#x)", max_t, t, cnt);
+ 
+-	cnt = t * get_sclk();
+-	if (cnt < get_sclk()) {
++	if (t > max_t) {
+ 		printk(KERN_WARNING PFX "timeout value is too large\n");
+ 		return -EINVAL;
+ 	}
+diff --git a/fs/exec.c b/fs/exec.c
+index da36c20..9b88366 100644
+--- a/fs/exec.c
++++ b/fs/exec.c
+@@ -638,7 +638,6 @@ int setup_arg_pages(struct linux_binprm *bprm,
+ 	 * will align it up.
+ 	 */
+ 	rlim_stack = rlimit(RLIMIT_STACK) & PAGE_MASK;
+-	rlim_stack = min(rlim_stack, stack_size);
+ #ifdef CONFIG_STACK_GROWSUP
+ 	if (stack_size + stack_expand > rlim_stack)
+ 		stack_base = vma->vm_start + rlim_stack;
+diff --git a/fs/file_table.c b/fs/file_table.c
+index 8eb4404..666c7ce 100644
+--- a/fs/file_table.c
++++ b/fs/file_table.c
+@@ -420,7 +420,9 @@ retry:
+ 			continue;
+ 		if (!(f->f_mode & FMODE_WRITE))
+ 			continue;
++		spin_lock(&f->f_lock);
+ 		f->f_mode &= ~FMODE_WRITE;
++		spin_unlock(&f->f_lock);
+ 		if (file_check_writeable(f) != 0)
+ 			continue;
+ 		file_release_write(f);
+diff --git a/fs/namei.c b/fs/namei.c
+index a2b3c28..b0afbd4 100644
+--- a/fs/namei.c
++++ b/fs/namei.c
+@@ -829,6 +829,17 @@ fail:
+ }
+ 
+ /*
++ * This is a temporary kludge to deal with "automount" symlinks; proper
++ * solution is to trigger them on follow_mount(), so that do_lookup()
++ * would DTRT.  To be killed before 2.6.34-final.
++ */
++static inline int follow_on_final(struct inode *inode, unsigned lookup_flags)
++{
++	return inode && unlikely(inode->i_op->follow_link) &&
++		((lookup_flags & LOOKUP_FOLLOW) || S_ISDIR(inode->i_mode));
++}
++
++/*
+  * Name resolution.
+  * This is the basic name resolution function, turning a pathname into
+  * the final dentry. We expect 'base' to be positive and a directory.
+@@ -964,8 +975,7 @@ last_component:
+ 		if (err)
+ 			break;
+ 		inode = next.dentry->d_inode;
+-		if ((lookup_flags & LOOKUP_FOLLOW)
+-		    && inode && inode->i_op->follow_link) {
++		if (follow_on_final(inode, lookup_flags)) {
+ 			err = do_follow_link(&next, nd);
+ 			if (err)
+ 				goto return_err;
+diff --git a/fs/nfs/dns_resolve.c b/fs/nfs/dns_resolve.c
+index f4d54ba..c1fd68b 100644
+--- a/fs/nfs/dns_resolve.c
++++ b/fs/nfs/dns_resolve.c
+@@ -36,6 +36,19 @@ struct nfs_dns_ent {
+ };
+ 
+ 
++static void nfs_dns_ent_update(struct cache_head *cnew,
++		struct cache_head *ckey)
++{
++	struct nfs_dns_ent *new;
++	struct nfs_dns_ent *key;
++
++	new = container_of(cnew, struct nfs_dns_ent, h);
++	key = container_of(ckey, struct nfs_dns_ent, h);
++
++	memcpy(&new->addr, &key->addr, key->addrlen);
++	new->addrlen = key->addrlen;
++}
++
+ static void nfs_dns_ent_init(struct cache_head *cnew,
+ 		struct cache_head *ckey)
+ {
+@@ -49,8 +62,7 @@ static void nfs_dns_ent_init(struct cache_head *cnew,
+ 	new->hostname = kstrndup(key->hostname, key->namelen, GFP_KERNEL);
+ 	if (new->hostname) {
+ 		new->namelen = key->namelen;
+-		memcpy(&new->addr, &key->addr, key->addrlen);
+-		new->addrlen = key->addrlen;
++		nfs_dns_ent_update(cnew, ckey);
+ 	} else {
+ 		new->namelen = 0;
+ 		new->addrlen = 0;
+@@ -234,7 +246,7 @@ static struct cache_detail nfs_dns_resolve = {
+ 	.cache_show = nfs_dns_show,
+ 	.match = nfs_dns_match,
+ 	.init = nfs_dns_ent_init,
+-	.update = nfs_dns_ent_init,
++	.update = nfs_dns_ent_update,
+ 	.alloc = nfs_dns_ent_alloc,
+ };
+ 
+diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
+index 2153f9b..6ad6282 100644
+--- a/fs/nfsd/nfs4state.c
++++ b/fs/nfsd/nfs4state.c
+@@ -2002,7 +2002,9 @@ nfs4_file_downgrade(struct file *filp, unsigned int share_access)
+ {
+ 	if (share_access & NFS4_SHARE_ACCESS_WRITE) {
+ 		drop_file_write_access(filp);
++		spin_lock(&filp->f_lock);
+ 		filp->f_mode = (filp->f_mode | FMODE_READ) & ~FMODE_WRITE;
++		spin_unlock(&filp->f_lock);
+ 	}
+ }
+ 
+diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
+index deb2b13..5fc918c 100644
+--- a/fs/ocfs2/aops.c
++++ b/fs/ocfs2/aops.c
+@@ -591,8 +591,9 @@ static int ocfs2_direct_IO_get_blocks(struct inode *inode, sector_t iblock,
+ 		goto bail;
+ 	}
+ 
+-	/* We should already CoW the refcounted extent. */
+-	BUG_ON(ext_flags & OCFS2_EXT_REFCOUNTED);
++	/* We should already CoW the refcounted extent in case of create. */
++	BUG_ON(create && (ext_flags & OCFS2_EXT_REFCOUNTED));
++
+ 	/*
+ 	 * get_more_blocks() expects us to describe a hole by clearing
+ 	 * the mapped bit on bh_result().
+diff --git a/fs/proc/base.c b/fs/proc/base.c
+index af643b5..6d71c67 100644
+--- a/fs/proc/base.c
++++ b/fs/proc/base.c
+@@ -2304,16 +2304,30 @@ static void *proc_self_follow_link(struct dentry *dentry, struct nameidata *nd)
+ {
+ 	struct pid_namespace *ns = dentry->d_sb->s_fs_info;
+ 	pid_t tgid = task_tgid_nr_ns(current, ns);
+-	char tmp[PROC_NUMBUF];
+-	if (!tgid)
+-		return ERR_PTR(-ENOENT);
+-	sprintf(tmp, "%d", task_tgid_nr_ns(current, ns));
+-	return ERR_PTR(vfs_follow_link(nd,tmp));
++	char *name = ERR_PTR(-ENOENT);
++	if (tgid) {
++		name = __getname();
++		if (!name)
++			name = ERR_PTR(-ENOMEM);
++		else
++			sprintf(name, "%d", tgid);
++	}
++	nd_set_link(nd, name);
++	return NULL;
++}
++
++static void proc_self_put_link(struct dentry *dentry, struct nameidata *nd,
++				void *cookie)
++{
++	char *s = nd_get_link(nd);
++	if (!IS_ERR(s))
++		__putname(s);
+ }
+ 
+ static const struct inode_operations proc_self_inode_operations = {
+ 	.readlink	= proc_self_readlink,
+ 	.follow_link	= proc_self_follow_link,
++	.put_link	= proc_self_put_link,
+ };
+ 
+ /*
+diff --git a/include/linux/fs.h b/include/linux/fs.h
+index 98ea200..692a3ee 100644
+--- a/include/linux/fs.h
++++ b/include/linux/fs.h
+@@ -87,6 +87,9 @@ struct inodes_stat_t {
+  */
+ #define FMODE_NOCMTIME		((__force fmode_t)2048)
+ 
++/* Expect random access pattern */
++#define FMODE_RANDOM		((__force fmode_t)4096)
++
+ /*
+  * The below are the various read and write types that we support. Some of
+  * them include behavioral modifiers that send information down to the
+diff --git a/include/linux/irq.h b/include/linux/irq.h
+index ae9653d..9e5f45a 100644
+--- a/include/linux/irq.h
++++ b/include/linux/irq.h
+@@ -400,7 +400,9 @@ static inline int irq_has_action(unsigned int irq)
+ 
+ /* Dynamic irq helper functions */
+ extern void dynamic_irq_init(unsigned int irq);
++void dynamic_irq_init_keep_chip_data(unsigned int irq);
+ extern void dynamic_irq_cleanup(unsigned int irq);
++void dynamic_irq_cleanup_keep_chip_data(unsigned int irq);
+ 
+ /* Set/get chip/data for an IRQ: */
+ extern int set_irq_chip(unsigned int irq, struct irq_chip *chip);
+diff --git a/include/linux/sched.h b/include/linux/sched.h
+index e48311e..70abfd3 100644
+--- a/include/linux/sched.h
++++ b/include/linux/sched.h
+@@ -864,7 +864,10 @@ static inline int sd_balance_for_mc_power(void)
+ 	if (sched_smt_power_savings)
+ 		return SD_POWERSAVINGS_BALANCE;
+ 
+-	return SD_PREFER_SIBLING;
++	if (!sched_mc_power_savings)
++		return SD_PREFER_SIBLING;
++
++	return 0;
+ }
+ 
+ static inline int sd_balance_for_package_power(void)
+diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
+index c166019..e570d19 100644
+--- a/kernel/irq/chip.c
++++ b/kernel/irq/chip.c
+@@ -18,11 +18,7 @@
+ 
+ #include "internals.h"
+ 
+-/**
+- *	dynamic_irq_init - initialize a dynamically allocated irq
+- *	@irq:	irq number to initialize
+- */
+-void dynamic_irq_init(unsigned int irq)
++static void dynamic_irq_init_x(unsigned int irq, bool keep_chip_data)
+ {
+ 	struct irq_desc *desc;
+ 	unsigned long flags;
+@@ -41,7 +37,8 @@ void dynamic_irq_init(unsigned int irq)
+ 	desc->depth = 1;
+ 	desc->msi_desc = NULL;
+ 	desc->handler_data = NULL;
+-	desc->chip_data = NULL;
++	if (!keep_chip_data)
++		desc->chip_data = NULL;
+ 	desc->action = NULL;
+ 	desc->irq_count = 0;
+ 	desc->irqs_unhandled = 0;
+@@ -55,10 +52,26 @@ void dynamic_irq_init(unsigned int irq)
+ }
+ 
+ /**
+- *	dynamic_irq_cleanup - cleanup a dynamically allocated irq
++ *	dynamic_irq_init - initialize a dynamically allocated irq
+  *	@irq:	irq number to initialize
+  */
+-void dynamic_irq_cleanup(unsigned int irq)
++void dynamic_irq_init(unsigned int irq)
++{
++	dynamic_irq_init_x(irq, false);
++}
++
++/**
++ *	dynamic_irq_init_keep_chip_data - initialize a dynamically allocated irq
++ *	@irq:	irq number to initialize
++ *
++ *	does not set irq_to_desc(irq)->chip_data to NULL
++ */
++void dynamic_irq_init_keep_chip_data(unsigned int irq)
++{
++	dynamic_irq_init_x(irq, true);
++}
++
++static void dynamic_irq_cleanup_x(unsigned int irq, bool keep_chip_data)
+ {
+ 	struct irq_desc *desc = irq_to_desc(irq);
+ 	unsigned long flags;
+@@ -77,7 +90,8 @@ void dynamic_irq_cleanup(unsigned int irq)
+ 	}
+ 	desc->msi_desc = NULL;
+ 	desc->handler_data = NULL;
+-	desc->chip_data = NULL;
++	if (!keep_chip_data)
++		desc->chip_data = NULL;
+ 	desc->handle_irq = handle_bad_irq;
+ 	desc->chip = &no_irq_chip;
+ 	desc->name = NULL;
+@@ -85,6 +99,26 @@ void dynamic_irq_cleanup(unsigned int irq)
+ 	spin_unlock_irqrestore(&desc->lock, flags);
+ }
+ 
++/**
++ *	dynamic_irq_cleanup - cleanup a dynamically allocated irq
++ *	@irq:	irq number to initialize
++ */
++void dynamic_irq_cleanup(unsigned int irq)
++{
++	dynamic_irq_cleanup_x(irq, false);
++}
++
++/**
++ *	dynamic_irq_cleanup_keep_chip_data - cleanup a dynamically allocated irq
++ *	@irq:	irq number to initialize
++ *
++ *	does not set irq_to_desc(irq)->chip_data to NULL
++ */
++void dynamic_irq_cleanup_keep_chip_data(unsigned int irq)
++{
++	dynamic_irq_cleanup_x(irq, true);
++}
++
+ 
+ /**
+  *	set_irq_chip - set the irq chip for an irq
+diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c
+index 36cb168..fc9ed15 100644
+--- a/kernel/power/snapshot.c
++++ b/kernel/power/snapshot.c
+@@ -1181,7 +1181,7 @@ static void free_unnecessary_pages(void)
+ 
+ 	memory_bm_position_reset(&copy_bm);
+ 
+-	while (to_free_normal > 0 && to_free_highmem > 0) {
++	while (to_free_normal > 0 || to_free_highmem > 0) {
+ 		unsigned long pfn = memory_bm_next_pfn(&copy_bm);
+ 		struct page *page = pfn_to_page(pfn);
+ 
+diff --git a/kernel/sched.c b/kernel/sched.c
+index 60d74cc..380e1fa 100644
+--- a/kernel/sched.c
++++ b/kernel/sched.c
+@@ -4098,12 +4098,23 @@ find_busiest_queue(struct sched_group *group, enum cpu_idle_type idle,
+ 			continue;
+ 
+ 		rq = cpu_rq(i);
+-		wl = weighted_cpuload(i) * SCHED_LOAD_SCALE;
+-		wl /= power;
++		wl = weighted_cpuload(i);
+ 
++		/*
++		 * When comparing with imbalance, use weighted_cpuload()
++		 * which is not scaled with the cpu power.
++		 */
+ 		if (capacity && rq->nr_running == 1 && wl > imbalance)
+ 			continue;
+ 
++		/*
++		 * For the load comparisons with the other cpu's, consider
++		 * the weighted_cpuload() scaled with the cpu power, so that
++		 * the load can be moved away from the cpu that is potentially
++		 * running at a lower capacity.
++		 */
++		wl = (wl * SCHED_LOAD_SCALE) / power;
++
+ 		if (wl > max_load) {
+ 			max_load = wl;
+ 			busiest = rq;
+@@ -5998,7 +6009,7 @@ void rt_mutex_setprio(struct task_struct *p, int prio)
+ 	unsigned long flags;
+ 	int oldprio, on_rq, running;
+ 	struct rq *rq;
+-	const struct sched_class *prev_class = p->sched_class;
++	const struct sched_class *prev_class;
+ 
+ 	BUG_ON(prio < 0 || prio > MAX_PRIO);
+ 
+@@ -6006,6 +6017,7 @@ void rt_mutex_setprio(struct task_struct *p, int prio)
+ 	update_rq_clock(rq);
+ 
+ 	oldprio = p->prio;
++	prev_class = p->sched_class;
+ 	on_rq = p->se.on_rq;
+ 	running = task_current(rq, p);
+ 	if (on_rq)
+@@ -6233,7 +6245,7 @@ static int __sched_setscheduler(struct task_struct *p, int policy,
+ {
+ 	int retval, oldprio, oldpolicy = -1, on_rq, running;
+ 	unsigned long flags;
+-	const struct sched_class *prev_class = p->sched_class;
++	const struct sched_class *prev_class;
+ 	struct rq *rq;
+ 	int reset_on_fork;
+ 
+@@ -6347,6 +6359,7 @@ recheck:
+ 	p->sched_reset_on_fork = reset_on_fork;
+ 
+ 	oldprio = p->prio;
++	prev_class = p->sched_class;
+ 	__setscheduler(rq, p, policy, param->sched_priority);
+ 
+ 	if (running)
+diff --git a/lib/idr.c b/lib/idr.c
+index 80ca9ac..eda7ba3 100644
+--- a/lib/idr.c
++++ b/lib/idr.c
+@@ -156,10 +156,12 @@ static int sub_alloc(struct idr *idp, int *starting_id, struct idr_layer **pa)
+ 			id = (id | ((1 << (IDR_BITS * l)) - 1)) + 1;
+ 
+ 			/* if already at the top layer, we need to grow */
+-			if (!(p = pa[l])) {
++			if (id >= 1 << (idp->layers * IDR_BITS)) {
+ 				*starting_id = id;
+ 				return IDR_NEED_TO_GROW;
+ 			}
++			p = pa[l];
++			BUG_ON(!p);
+ 
+ 			/* If we need to go up one layer, continue the
+ 			 * loop; otherwise, restart from the top.
+diff --git a/mm/fadvise.c b/mm/fadvise.c
+index e433592..8d723c9 100644
+--- a/mm/fadvise.c
++++ b/mm/fadvise.c
+@@ -77,12 +77,20 @@ SYSCALL_DEFINE(fadvise64_64)(int fd, loff_t offset, loff_t len, int advice)
+ 	switch (advice) {
+ 	case POSIX_FADV_NORMAL:
+ 		file->f_ra.ra_pages = bdi->ra_pages;
++		spin_lock(&file->f_lock);
++		file->f_mode &= ~FMODE_RANDOM;
++		spin_unlock(&file->f_lock);
+ 		break;
+ 	case POSIX_FADV_RANDOM:
+-		file->f_ra.ra_pages = 0;
++		spin_lock(&file->f_lock);
++		file->f_mode |= FMODE_RANDOM;
++		spin_unlock(&file->f_lock);
+ 		break;
+ 	case POSIX_FADV_SEQUENTIAL:
+ 		file->f_ra.ra_pages = bdi->ra_pages * 2;
++		spin_lock(&file->f_lock);
++		file->f_mode &= ~FMODE_RANDOM;
++		spin_unlock(&file->f_lock);
+ 		break;
+ 	case POSIX_FADV_WILLNEED:
+ 		if (!mapping->a_ops->readpage) {
+diff --git a/mm/oom_kill.c b/mm/oom_kill.c
+index 9092b43..83cd9bb 100644
+--- a/mm/oom_kill.c
++++ b/mm/oom_kill.c
+@@ -426,6 +426,8 @@ static int oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order,
+ 	list_for_each_entry(c, &p->children, sibling) {
+ 		if (c->mm == p->mm)
+ 			continue;
++		if (mem && !task_in_mem_cgroup(c, mem))
++			continue;
+ 		if (!oom_kill_task(c))
+ 			return 0;
+ 	}
+diff --git a/mm/readahead.c b/mm/readahead.c
+index aa1aa23..8f40b47 100644
+--- a/mm/readahead.c
++++ b/mm/readahead.c
+@@ -501,6 +501,12 @@ void page_cache_sync_readahead(struct address_space *mapping,
+ 	if (!ra->ra_pages)
+ 		return;
+ 
++	/* be dumb */
++	if (filp->f_mode & FMODE_RANDOM) {
++		force_page_cache_readahead(mapping, filp, offset, req_size);
++		return;
++	}
++
+ 	/* do read-ahead */
+ 	ondemand_readahead(mapping, ra, filp, false, offset, req_size);
+ }
+diff --git a/mm/slab.c b/mm/slab.c
+index 7dfa481..5d1a782 100644
+--- a/mm/slab.c
++++ b/mm/slab.c
+@@ -971,13 +971,11 @@ static struct array_cache **alloc_alien_cache(int node, int limit, gfp_t gfp)
+ 
+ 	if (limit > 1)
+ 		limit = 12;
+-	ac_ptr = kmalloc_node(memsize, gfp, node);
++	ac_ptr = kzalloc_node(memsize, gfp, node);
+ 	if (ac_ptr) {
+ 		for_each_node(i) {
+-			if (i == node || !node_online(i)) {
+-				ac_ptr[i] = NULL;
++			if (i == node || !node_online(i))
+ 				continue;
+-			}
+ 			ac_ptr[i] = alloc_arraycache(node, limit, 0xbaadf00d, gfp);
+ 			if (!ac_ptr[i]) {
+ 				for (i--; i >= 0; i--)
+diff --git a/net/core/dev.c b/net/core/dev.c
+index 584046e..74d0cce 100644
+--- a/net/core/dev.c
++++ b/net/core/dev.c
+@@ -2630,7 +2630,7 @@ int napi_frags_finish(struct napi_struct *napi, struct sk_buff *skb, int ret)
+ 	switch (ret) {
+ 	case GRO_NORMAL:
+ 	case GRO_HELD:
+-		skb->protocol = eth_type_trans(skb, napi->dev);
++		skb->protocol = eth_type_trans(skb, skb->dev);
+ 
+ 		if (ret == GRO_NORMAL)
+ 			return netif_receive_skb(skb);
+diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
+index 427ded8..d5617d4 100644
+--- a/net/core/net-sysfs.c
++++ b/net/core/net-sysfs.c
+@@ -366,7 +366,8 @@ static ssize_t wireless_show(struct device *d, char *buf,
+ 	const struct iw_statistics *iw;
+ 	ssize_t ret = -EINVAL;
+ 
+-	rtnl_lock();
++	if (!rtnl_trylock())
++		return restart_syscall();
+ 	if (dev_isalive(dev)) {
+ 		iw = get_wireless_stats(dev);
+ 		if (iw)
+diff --git a/net/core/scm.c b/net/core/scm.c
+index b7ba91b..9b26463 100644
+--- a/net/core/scm.c
++++ b/net/core/scm.c
+@@ -156,6 +156,8 @@ int __scm_send(struct socket *sock, struct msghdr *msg, struct scm_cookie *p)
+ 		switch (cmsg->cmsg_type)
+ 		{
+ 		case SCM_RIGHTS:
++			if (!sock->ops || sock->ops->family != PF_UNIX)
++				goto error;
+ 			err=scm_fp_copy(cmsg, &p->fp);
+ 			if (err<0)
+ 				goto error;
+diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
+index 0030e73..cc35645 100644
+--- a/net/ipv4/devinet.c
++++ b/net/ipv4/devinet.c
+@@ -1351,14 +1351,19 @@ static int devinet_sysctl_forward(ctl_table *ctl, int write,
+ {
+ 	int *valp = ctl->data;
+ 	int val = *valp;
++	loff_t pos = *ppos;
+ 	int ret = proc_dointvec(ctl, write, buffer, lenp, ppos);
+ 
+ 	if (write && *valp != val) {
+ 		struct net *net = ctl->extra2;
+ 
+ 		if (valp != &IPV4_DEVCONF_DFLT(net, FORWARDING)) {
+-			if (!rtnl_trylock())
++			if (!rtnl_trylock()) {
++				/* Restore the original values before restarting */
++				*valp = val;
++				*ppos = pos;
+ 				return restart_syscall();
++			}
+ 			if (valp == &IPV4_DEVCONF_ALL(net, FORWARDING)) {
+ 				inet_forward_change(net);
+ 			} else if (*valp) {
+diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
+index d41e5de..169da93 100644
+--- a/net/ipv4/igmp.c
++++ b/net/ipv4/igmp.c
+@@ -946,7 +946,6 @@ int igmp_rcv(struct sk_buff *skb)
+ 		break;
+ 	case IGMP_HOST_MEMBERSHIP_REPORT:
+ 	case IGMPV2_HOST_MEMBERSHIP_REPORT:
+-	case IGMPV3_HOST_MEMBERSHIP_REPORT:
+ 		/* Is it our report looped back? */
+ 		if (skb_rtable(skb)->fl.iif == 0)
+ 			break;
+@@ -960,6 +959,7 @@ int igmp_rcv(struct sk_buff *skb)
+ 		in_dev_put(in_dev);
+ 		return pim_rcv_v1(skb);
+ #endif
++	case IGMPV3_HOST_MEMBERSHIP_REPORT:
+ 	case IGMP_DVMRP:
+ 	case IGMP_TRACE:
+ 	case IGMP_HOST_LEAVE_MESSAGE:
+diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
+index 1fd0a3d..d1f77cc 100644
+--- a/net/ipv6/addrconf.c
++++ b/net/ipv6/addrconf.c
+@@ -504,8 +504,11 @@ static int addrconf_fixup_forwarding(struct ctl_table *table, int *p, int old)
+ 	if (p == &net->ipv6.devconf_dflt->forwarding)
+ 		return 0;
+ 
+-	if (!rtnl_trylock())
++	if (!rtnl_trylock()) {
++		/* Restore the original values before restarting */
++		*p = old;
+ 		return restart_syscall();
++	}
+ 
+ 	if (p == &net->ipv6.devconf_all->forwarding) {
+ 		__s32 newf = net->ipv6.devconf_all->forwarding;
+@@ -3991,12 +3994,15 @@ int addrconf_sysctl_forward(ctl_table *ctl, int write,
+ {
+ 	int *valp = ctl->data;
+ 	int val = *valp;
++	loff_t pos = *ppos;
+ 	int ret;
+ 
+ 	ret = proc_dointvec(ctl, write, buffer, lenp, ppos);
+ 
+ 	if (write)
+ 		ret = addrconf_fixup_forwarding(ctl, valp, val);
++	if (ret)
++		*ppos = pos;
+ 	return ret;
+ }
+ 
+@@ -4075,8 +4081,11 @@ static int addrconf_disable_ipv6(struct ctl_table *table, int *p, int old)
+ 	if (p == &net->ipv6.devconf_dflt->disable_ipv6)
+ 		return 0;
+ 
+-	if (!rtnl_trylock())
++	if (!rtnl_trylock()) {
++		/* Restore the original values before restarting */
++		*p = old;
+ 		return restart_syscall();
++	}
+ 
+ 	if (p == &net->ipv6.devconf_all->disable_ipv6) {
+ 		__s32 newf = net->ipv6.devconf_all->disable_ipv6;
+@@ -4095,12 +4104,15 @@ int addrconf_sysctl_disable(ctl_table *ctl, int write,
+ {
+ 	int *valp = ctl->data;
+ 	int val = *valp;
++	loff_t pos = *ppos;
+ 	int ret;
+ 
+ 	ret = proc_dointvec(ctl, write, buffer, lenp, ppos);
+ 
+ 	if (write)
+ 		ret = addrconf_disable_ipv6(ctl, valp, val);
++	if (ret)
++		*ppos = pos;
+ 	return ret;
+ }
+ 
+diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c
+index 4b6a539..bfc8737 100644
+--- a/net/ipv6/netfilter/nf_conntrack_reasm.c
++++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
+@@ -63,6 +63,7 @@ struct nf_ct_frag6_queue
+ 	struct inet_frag_queue	q;
+ 
+ 	__be32			id;		/* fragment id		*/
++	u32			user;
+ 	struct in6_addr		saddr;
+ 	struct in6_addr		daddr;
+ 
+diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c
+index 89e238b..9144ef0 100644
+--- a/net/mac80211/agg-tx.c
++++ b/net/mac80211/agg-tx.c
+@@ -177,7 +177,8 @@ static void sta_addba_resp_timer_expired(unsigned long data)
+ 
+ 	/* check if the TID waits for addBA response */
+ 	spin_lock_bh(&sta->lock);
+-	if ((*state & (HT_ADDBA_REQUESTED_MSK | HT_ADDBA_RECEIVED_MSK)) !=
++	if ((*state & (HT_ADDBA_REQUESTED_MSK | HT_ADDBA_RECEIVED_MSK |
++		       HT_AGG_STATE_REQ_STOP_BA_MSK)) !=
+ 						HT_ADDBA_REQUESTED_MSK) {
+ 		spin_unlock_bh(&sta->lock);
+ 		*state = HT_AGG_STATE_IDLE;
+diff --git a/net/netfilter/xt_recent.c b/net/netfilter/xt_recent.c
+index eb0ceb8..1a3b650 100644
+--- a/net/netfilter/xt_recent.c
++++ b/net/netfilter/xt_recent.c
+@@ -173,10 +173,10 @@ recent_entry_init(struct recent_table *t, const union nf_inet_addr *addr,
+ 
+ static void recent_entry_update(struct recent_table *t, struct recent_entry *e)
+ {
++	e->index %= ip_pkt_list_tot;
+ 	e->stamps[e->index++] = jiffies;
+ 	if (e->index > e->nstamps)
+ 		e->nstamps = e->index;
+-	e->index %= ip_pkt_list_tot;
+ 	list_move_tail(&e->lru_list, &t->lru_list);
+ }
+ 
+@@ -260,7 +260,7 @@ recent_mt(const struct sk_buff *skb, const struct xt_match_param *par)
+ 		for (i = 0; i < e->nstamps; i++) {
+ 			if (info->seconds && time_after(time, e->stamps[i]))
+ 				continue;
+-			if (++hits >= info->hit_count) {
++			if (info->hit_count && ++hits >= info->hit_count) {
+ 				ret = !ret;
+ 				break;
+ 			}
+diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c
+index 0266cca..dafd341 100644
+--- a/net/sunrpc/svc_xprt.c
++++ b/net/sunrpc/svc_xprt.c
+@@ -901,11 +901,8 @@ void svc_delete_xprt(struct svc_xprt *xprt)
+ 	if (test_bit(XPT_TEMP, &xprt->xpt_flags))
+ 		serv->sv_tmpcnt--;
+ 
+-	for (dr = svc_deferred_dequeue(xprt); dr;
+-	     dr = svc_deferred_dequeue(xprt)) {
+-		svc_xprt_put(xprt);
++	while ((dr = svc_deferred_dequeue(xprt)) != NULL)
+ 		kfree(dr);
+-	}
+ 
+ 	svc_xprt_put(xprt);
+ 	spin_unlock_bh(&serv->sv_lock);
+diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
+index 37c5475..5cdbf7c 100644
+--- a/net/sunrpc/xprtsock.c
++++ b/net/sunrpc/xprtsock.c
+@@ -1926,6 +1926,11 @@ static void xs_tcp_setup_socket(struct rpc_xprt *xprt,
+ 	case -EALREADY:
+ 		xprt_clear_connecting(xprt);
+ 		return;
++	case -EINVAL:
++		/* Happens, for instance, if the user specified a link
++		 * local IPv6 address without a scope-id.
++		 */
++		goto out;
+ 	}
+ out_eagain:
+ 	status = -EAGAIN;
+diff --git a/security/selinux/ss/ebitmap.c b/security/selinux/ss/ebitmap.c
+index 68c7348..04b6145 100644
+--- a/security/selinux/ss/ebitmap.c
++++ b/security/selinux/ss/ebitmap.c
+@@ -128,7 +128,7 @@ int ebitmap_netlbl_export(struct ebitmap *ebmap,
+ 			cmap_idx = delta / NETLBL_CATMAP_MAPSIZE;
+ 			cmap_sft = delta % NETLBL_CATMAP_MAPSIZE;
+ 			c_iter->bitmap[cmap_idx]
+-				|= e_iter->maps[cmap_idx] << cmap_sft;
++				|= e_iter->maps[i] << cmap_sft;
+ 		}
+ 		e_iter = e_iter->next;
+ 	}
+diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
+index ab73edf..7ba779d 100644
+--- a/sound/core/pcm_native.c
++++ b/sound/core/pcm_native.c
+@@ -314,10 +314,10 @@ int snd_pcm_hw_refine(struct snd_pcm_substream *substream,
+ 	if (!params->info)
+ 		params->info = hw->info & ~SNDRV_PCM_INFO_FIFO_IN_FRAMES;
+ 	if (!params->fifo_size) {
+-		if (snd_mask_min(&params->masks[SNDRV_PCM_HW_PARAM_FORMAT]) ==
+-		    snd_mask_max(&params->masks[SNDRV_PCM_HW_PARAM_FORMAT]) &&
+-                    snd_mask_min(&params->masks[SNDRV_PCM_HW_PARAM_CHANNELS]) ==
+-                    snd_mask_max(&params->masks[SNDRV_PCM_HW_PARAM_CHANNELS])) {
++		m = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT);
++		i = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
++		if (snd_mask_min(m) == snd_mask_max(m) &&
++                    snd_interval_min(i) == snd_interval_max(i)) {
+ 			changed = substream->ops->ioctl(substream,
+ 					SNDRV_PCM_IOCTL1_FIFO_SIZE, params);
+ 			if (changed < 0)
+diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
+index fec8724..673cec3 100644
+--- a/sound/pci/hda/hda_intel.c
++++ b/sound/pci/hda/hda_intel.c
+@@ -2224,7 +2224,12 @@ static int azx_dev_free(struct snd_device *device)
+ static struct snd_pci_quirk position_fix_list[] __devinitdata = {
+ 	SND_PCI_QUIRK(0x1028, 0x01cc, "Dell D820", POS_FIX_LPIB),
+ 	SND_PCI_QUIRK(0x1028, 0x01de, "Dell Precision 390", POS_FIX_LPIB),
++	SND_PCI_QUIRK(0x103c, 0x306d, "HP dv3", POS_FIX_LPIB),
++	SND_PCI_QUIRK(0x1106, 0x3288, "ASUS M2V-MX SE", POS_FIX_LPIB),
+ 	SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", POS_FIX_LPIB),
++	SND_PCI_QUIRK(0x1028, 0x01f6, "Dell Latitude 131L", POS_FIX_LPIB),
++	SND_PCI_QUIRK(0x1462, 0x1002, "MSI Wind U115", POS_FIX_LPIB),
++	SND_PCI_QUIRK(0x1565, 0x820f, "Biostar Microtech", POS_FIX_LPIB),
+ 	{}
+ };
+ 
+diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
+index 2d603f6..2377e75 100644
+--- a/sound/pci/hda/patch_analog.c
++++ b/sound/pci/hda/patch_analog.c
+@@ -1003,7 +1003,7 @@ static struct snd_pci_quirk ad1986a_cfg_tbl[] = {
+ 	SND_PCI_QUIRK(0x1043, 0x81cb, "ASUS M2N", AD1986A_3STACK),
+ 	SND_PCI_QUIRK(0x1043, 0x8234, "ASUS M2N", AD1986A_3STACK),
+ 	SND_PCI_QUIRK(0x10de, 0xcb84, "ASUS A8N-VM", AD1986A_3STACK),
+-	SND_PCI_QUIRK(0x1179, 0xff40, "Toshiba", AD1986A_LAPTOP_EAPD),
++	SND_PCI_QUIRK(0x1179, 0xff40, "Toshiba Satellite L40-10Q", AD1986A_3STACK),
+ 	SND_PCI_QUIRK(0x144d, 0xb03c, "Samsung R55", AD1986A_3STACK),
+ 	SND_PCI_QUIRK(0x144d, 0xc01e, "FSC V2060", AD1986A_LAPTOP),
+ 	SND_PCI_QUIRK(0x144d, 0xc024, "Samsung P50", AD1986A_SAMSUNG_P50),
+diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c
+index 8a332d2..03d6aea 100644
+--- a/sound/pci/via82xx.c
++++ b/sound/pci/via82xx.c
+@@ -1791,6 +1791,12 @@ static struct ac97_quirk ac97_quirks[] = {
+ 		.type = AC97_TUNE_HP_ONLY
+ 	},
+ 	{
++		.subvendor = 0x110a,
++		.subdevice = 0x0079,
++		.name = "Fujitsu Siemens D1289",
++		.type = AC97_TUNE_HP_ONLY
++	},
++	{
+ 		.subvendor = 0x1019,
+ 		.subdevice = 0x0a81,
+ 		.name = "ECS K7VTA3",
+diff --git a/sound/soc/codecs/ak4104.c b/sound/soc/codecs/ak4104.c
+index 4d47bc4..10c7550 100644
+--- a/sound/soc/codecs/ak4104.c
++++ b/sound/soc/codecs/ak4104.c
+@@ -90,12 +90,10 @@ static int ak4104_spi_write(struct snd_soc_codec *codec, unsigned int reg,
+ 	if (reg >= codec->reg_cache_size)
+ 		return -EINVAL;
+ 
+-	reg &= AK4104_REG_MASK;
+-	reg |= AK4104_WRITE;
+-
+ 	/* only write to the hardware if value has changed */
+ 	if (cache[reg] != value) {
+-		u8 tmp[2] = { reg, value };
++		u8 tmp[2] = { (reg & AK4104_REG_MASK) | AK4104_WRITE, value };
++
+ 		if (spi_write(spi, tmp, sizeof(tmp))) {
+ 			dev_err(&spi->dev, "SPI write failed\n");
+ 			return -EIO;
+diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
+index f26a125..79633ea 100644
+--- a/sound/usb/usbaudio.c
++++ b/sound/usb/usbaudio.c
+@@ -3326,6 +3326,32 @@ static int snd_usb_cm6206_boot_quirk(struct usb_device *dev)
+ }
+ 
+ /*
++ * This call will put the synth in "USB send" mode, i.e it will send MIDI
++ * messages through USB (this is disabled at startup). The synth will
++ * acknowledge by sending a sysex on endpoint 0x85 and by displaying a USB
++ * sign on its LCD. Values here are chosen based on sniffing USB traffic
++ * under Windows.
++ */
++static int snd_usb_accessmusic_boot_quirk(struct usb_device *dev)
++{
++	int err, actual_length;
++
++	/* "midi send" enable */
++	static const u8 seq[] = { 0x4e, 0x73, 0x52, 0x01 };
++
++	void *buf = kmemdup(seq, ARRAY_SIZE(seq), GFP_KERNEL);
++	if (!buf)
++		return -ENOMEM;
++	err = usb_interrupt_msg(dev, usb_sndintpipe(dev, 0x05), buf,
++			ARRAY_SIZE(seq), &actual_length, 1000);
++	kfree(buf);
++	if (err < 0)
++		return err;
++
++	return 0;
++}
++
++/*
+  * Setup quirks
+  */
+ #define AUDIOPHILE_SET			0x01 /* if set, parse device_setup */
+@@ -3616,6 +3642,12 @@ static void *snd_usb_audio_probe(struct usb_device *dev,
+ 			goto __err_val;
+ 	}
+ 
++	/* Access Music VirusTI Desktop */
++	if (id == USB_ID(0x133e, 0x0815)) {
++		if (snd_usb_accessmusic_boot_quirk(dev) < 0)
++			goto __err_val;
++	}
++
+ 	/*
+ 	 * found a config.  now register to ALSA
+ 	 */
+diff --git a/sound/usb/usbmidi.c b/sound/usb/usbmidi.c
+index 0eff19c..b8958f9 100644
+--- a/sound/usb/usbmidi.c
++++ b/sound/usb/usbmidi.c
+@@ -1360,6 +1360,12 @@ static struct port_info {
+ 	EXTERNAL_PORT(0x086a, 0x0001, 8, "%s Broadcast"),
+ 	EXTERNAL_PORT(0x086a, 0x0002, 8, "%s Broadcast"),
+ 	EXTERNAL_PORT(0x086a, 0x0003, 4, "%s Broadcast"),
++	/* Access Music Virus TI */
++	EXTERNAL_PORT(0x133e, 0x0815, 0, "%s MIDI"),
++	PORT_INFO(0x133e, 0x0815, 1, "%s Synth", 0,
++		SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC |
++		SNDRV_SEQ_PORT_TYPE_HARDWARE |
++		SNDRV_SEQ_PORT_TYPE_SYNTHESIZER),
+ };
+ 
+ static struct port_info *find_port_info(struct snd_usb_midi* umidi, int number)
+diff --git a/sound/usb/usbquirks.h b/sound/usb/usbquirks.h
+index f6f201e..391e02f 100644
+--- a/sound/usb/usbquirks.h
++++ b/sound/usb/usbquirks.h
+@@ -2050,6 +2050,33 @@ YAMAHA_DEVICE(0x7010, "UB99"),
+ 	}
+ },
+ 
++/* Access Music devices */
++{
++	/* VirusTI Desktop */
++	USB_DEVICE_VENDOR_SPEC(0x133e, 0x0815),
++	.driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) {
++		.ifnum = QUIRK_ANY_INTERFACE,
++		.type = QUIRK_COMPOSITE,
++		.data = &(const struct snd_usb_audio_quirk[]) {
++			{
++				.ifnum = 3,
++				.type = QUIRK_MIDI_FIXED_ENDPOINT,
++				.data = &(const struct snd_usb_midi_endpoint_info) {
++					.out_cables = 0x0003,
++					.in_cables  = 0x0003
++				}
++			},
++			{
++				.ifnum = 4,
++				.type = QUIRK_IGNORE_INTERFACE
++			},
++			{
++				.ifnum = -1
++			}
++		}
++	}
++},
++
+ /* */
+ {
+ 	/* aka. Serato Scratch Live DJ Box */




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-04-01 12:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-01 12:10 [gentoo-commits] linux-patches r1689 - genpatches-2.6/trunk/2.6.32 Mike Pagano (mpagano)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox