diff options
150 files changed, 1274 insertions, 634 deletions
diff --git a/.gitignore b/.gitignore index 3b8b9b33be38..7e9932e55475 100644 --- a/.gitignore +++ b/.gitignore | |||
@@ -29,6 +29,7 @@ modules.builtin | |||
29 | *.bz2 | 29 | *.bz2 |
30 | *.lzma | 30 | *.lzma |
31 | *.xz | 31 | *.xz |
32 | *.lz4 | ||
32 | *.lzo | 33 | *.lzo |
33 | *.patch | 34 | *.patch |
34 | *.gcno | 35 | *.gcno |
diff --git a/Documentation/DocBook/device-drivers.tmpl b/Documentation/DocBook/device-drivers.tmpl index cbfdf5486639..fe397f90a34f 100644 --- a/Documentation/DocBook/device-drivers.tmpl +++ b/Documentation/DocBook/device-drivers.tmpl | |||
@@ -84,7 +84,7 @@ X!Iinclude/linux/kobject.h | |||
84 | 84 | ||
85 | <sect1><title>Kernel utility functions</title> | 85 | <sect1><title>Kernel utility functions</title> |
86 | !Iinclude/linux/kernel.h | 86 | !Iinclude/linux/kernel.h |
87 | !Ekernel/printk.c | 87 | !Ekernel/printk/printk.c |
88 | !Ekernel/panic.c | 88 | !Ekernel/panic.c |
89 | !Ekernel/sys.c | 89 | !Ekernel/sys.c |
90 | !Ekernel/rcupdate.c | 90 | !Ekernel/rcupdate.c |
diff --git a/MAINTAINERS b/MAINTAINERS index a26b10e52aea..d83f70ffdbed 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -2871,7 +2871,7 @@ F: drivers/media/usb/dvb-usb-v2/dvb_usb* | |||
2871 | F: drivers/media/usb/dvb-usb-v2/usb_urb.c | 2871 | F: drivers/media/usb/dvb-usb-v2/usb_urb.c |
2872 | 2872 | ||
2873 | DYNAMIC DEBUG | 2873 | DYNAMIC DEBUG |
2874 | M: Jason Baron <jbaron@redhat.com> | 2874 | M: Jason Baron <jbaron@akamai.com> |
2875 | S: Maintained | 2875 | S: Maintained |
2876 | F: lib/dynamic_debug.c | 2876 | F: lib/dynamic_debug.c |
2877 | F: include/linux/dynamic_debug.h | 2877 | F: include/linux/dynamic_debug.h |
diff --git a/arch/arc/include/asm/entry.h b/arch/arc/include/asm/entry.h index 8943c028d4bb..df57611652e5 100644 --- a/arch/arc/include/asm/entry.h +++ b/arch/arc/include/asm/entry.h | |||
@@ -38,6 +38,7 @@ | |||
38 | #include <asm/ptrace.h> | 38 | #include <asm/ptrace.h> |
39 | #include <asm/processor.h> /* For VMALLOC_START */ | 39 | #include <asm/processor.h> /* For VMALLOC_START */ |
40 | #include <asm/thread_info.h> /* For THREAD_SIZE */ | 40 | #include <asm/thread_info.h> /* For THREAD_SIZE */ |
41 | #include <asm/mmu.h> | ||
41 | 42 | ||
42 | /* Note on the LD/ST addr modes with addr reg wback | 43 | /* Note on the LD/ST addr modes with addr reg wback |
43 | * | 44 | * |
diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c index f71c37edca26..c9770ba5c7df 100644 --- a/arch/arm/xen/enlighten.c +++ b/arch/arm/xen/enlighten.c | |||
@@ -172,7 +172,7 @@ static void __init xen_percpu_init(void *unused) | |||
172 | enable_percpu_irq(xen_events_irq, 0); | 172 | enable_percpu_irq(xen_events_irq, 0); |
173 | } | 173 | } |
174 | 174 | ||
175 | static void xen_restart(char str, const char *cmd) | 175 | static void xen_restart(enum reboot_mode reboot_mode, const char *cmd) |
176 | { | 176 | { |
177 | struct sched_shutdown r = { .reason = SHUTDOWN_reboot }; | 177 | struct sched_shutdown r = { .reason = SHUTDOWN_reboot }; |
178 | int rc; | 178 | int rc; |
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index c3abed332301..e12764c2a9d0 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig | |||
@@ -114,6 +114,7 @@ config BCM47XX | |||
114 | select FW_CFE | 114 | select FW_CFE |
115 | select HW_HAS_PCI | 115 | select HW_HAS_PCI |
116 | select IRQ_CPU | 116 | select IRQ_CPU |
117 | select SYS_HAS_CPU_MIPS32_R1 | ||
117 | select NO_EXCEPT_FILL | 118 | select NO_EXCEPT_FILL |
118 | select SYS_SUPPORTS_32BIT_KERNEL | 119 | select SYS_SUPPORTS_32BIT_KERNEL |
119 | select SYS_SUPPORTS_LITTLE_ENDIAN | 120 | select SYS_SUPPORTS_LITTLE_ENDIAN |
diff --git a/arch/mips/bcm47xx/Kconfig b/arch/mips/bcm47xx/Kconfig index ba611927749b..2b8b118398c4 100644 --- a/arch/mips/bcm47xx/Kconfig +++ b/arch/mips/bcm47xx/Kconfig | |||
@@ -2,7 +2,6 @@ if BCM47XX | |||
2 | 2 | ||
3 | config BCM47XX_SSB | 3 | config BCM47XX_SSB |
4 | bool "SSB Support for Broadcom BCM47XX" | 4 | bool "SSB Support for Broadcom BCM47XX" |
5 | select SYS_HAS_CPU_MIPS32_R1 | ||
6 | select SSB | 5 | select SSB |
7 | select SSB_DRIVER_MIPS | 6 | select SSB_DRIVER_MIPS |
8 | select SSB_DRIVER_EXTIF | 7 | select SSB_DRIVER_EXTIF |
diff --git a/arch/mips/include/asm/mach-generic/spaces.h b/arch/mips/include/asm/mach-generic/spaces.h index 5b2f2e68e57f..9488fa5f8866 100644 --- a/arch/mips/include/asm/mach-generic/spaces.h +++ b/arch/mips/include/asm/mach-generic/spaces.h | |||
@@ -25,8 +25,12 @@ | |||
25 | #else | 25 | #else |
26 | #define CAC_BASE _AC(0x80000000, UL) | 26 | #define CAC_BASE _AC(0x80000000, UL) |
27 | #endif | 27 | #endif |
28 | #ifndef IO_BASE | ||
28 | #define IO_BASE _AC(0xa0000000, UL) | 29 | #define IO_BASE _AC(0xa0000000, UL) |
30 | #endif | ||
31 | #ifndef UNCAC_BASE | ||
29 | #define UNCAC_BASE _AC(0xa0000000, UL) | 32 | #define UNCAC_BASE _AC(0xa0000000, UL) |
33 | #endif | ||
30 | 34 | ||
31 | #ifndef MAP_BASE | 35 | #ifndef MAP_BASE |
32 | #ifdef CONFIG_KVM_GUEST | 36 | #ifdef CONFIG_KVM_GUEST |
diff --git a/arch/mips/include/uapi/asm/siginfo.h b/arch/mips/include/uapi/asm/siginfo.h index b7a23064841f..88e292b7719e 100644 --- a/arch/mips/include/uapi/asm/siginfo.h +++ b/arch/mips/include/uapi/asm/siginfo.h | |||
@@ -25,11 +25,12 @@ struct siginfo; | |||
25 | /* | 25 | /* |
26 | * Careful to keep union _sifields from shifting ... | 26 | * Careful to keep union _sifields from shifting ... |
27 | */ | 27 | */ |
28 | #if __SIZEOF_LONG__ == 4 | 28 | #if _MIPS_SZLONG == 32 |
29 | #define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int)) | 29 | #define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int)) |
30 | #endif | 30 | #elif _MIPS_SZLONG == 64 |
31 | #if __SIZEOF_LONG__ == 8 | ||
32 | #define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int)) | 31 | #define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int)) |
32 | #else | ||
33 | #error _MIPS_SZLONG neither 32 nor 64 | ||
33 | #endif | 34 | #endif |
34 | 35 | ||
35 | #include <asm-generic/siginfo.h> | 36 | #include <asm-generic/siginfo.h> |
diff --git a/arch/mips/kernel/bmips_vec.S b/arch/mips/kernel/bmips_vec.S index f739aedcb509..bd79c4f9bff4 100644 --- a/arch/mips/kernel/bmips_vec.S +++ b/arch/mips/kernel/bmips_vec.S | |||
@@ -54,7 +54,11 @@ LEAF(bmips_smp_movevec) | |||
54 | /* set up CPU1 CBR; move BASE to 0xa000_0000 */ | 54 | /* set up CPU1 CBR; move BASE to 0xa000_0000 */ |
55 | li k0, 0xff400000 | 55 | li k0, 0xff400000 |
56 | mtc0 k0, $22, 6 | 56 | mtc0 k0, $22, 6 |
57 | li k1, CKSEG1 | BMIPS_RELO_VECTOR_CONTROL_1 | 57 | /* set up relocation vector address based on thread ID */ |
58 | mfc0 k1, $22, 3 | ||
59 | srl k1, 16 | ||
60 | andi k1, 0x8000 | ||
61 | or k1, CKSEG1 | BMIPS_RELO_VECTOR_CONTROL_0 | ||
58 | or k0, k1 | 62 | or k0, k1 |
59 | li k1, 0xa0080000 | 63 | li k1, 0xa0080000 |
60 | sw k1, 0(k0) | 64 | sw k1, 0(k0) |
diff --git a/arch/mips/kernel/smp-bmips.c b/arch/mips/kernel/smp-bmips.c index c0bb4d59076a..159abc8842d2 100644 --- a/arch/mips/kernel/smp-bmips.c +++ b/arch/mips/kernel/smp-bmips.c | |||
@@ -79,15 +79,9 @@ static void __init bmips_smp_setup(void) | |||
79 | * MIPS interrupts 0,1 (SW INT 0,1) cross over to the other thread | 79 | * MIPS interrupts 0,1 (SW INT 0,1) cross over to the other thread |
80 | * MIPS interrupt 2 (HW INT 0) is the CPU0 L1 controller output | 80 | * MIPS interrupt 2 (HW INT 0) is the CPU0 L1 controller output |
81 | * MIPS interrupt 3 (HW INT 1) is the CPU1 L1 controller output | 81 | * MIPS interrupt 3 (HW INT 1) is the CPU1 L1 controller output |
82 | * | ||
83 | * If booting from TP1, leave the existing CMT interrupt routing | ||
84 | * such that TP0 responds to SW1 and TP1 responds to SW0. | ||
85 | */ | 82 | */ |
86 | if (boot_cpu == 0) | 83 | change_c0_brcm_cmt_intr(0xf8018000, |
87 | change_c0_brcm_cmt_intr(0xf8018000, | ||
88 | (0x02 << 27) | (0x03 << 15)); | 84 | (0x02 << 27) | (0x03 << 15)); |
89 | else | ||
90 | change_c0_brcm_cmt_intr(0xf8018000, (0x1d << 27)); | ||
91 | 85 | ||
92 | /* single core, 2 threads (2 pipelines) */ | 86 | /* single core, 2 threads (2 pipelines) */ |
93 | max_cpus = 2; | 87 | max_cpus = 2; |
@@ -202,9 +196,15 @@ static void bmips_init_secondary(void) | |||
202 | #if defined(CONFIG_CPU_BMIPS4350) || defined(CONFIG_CPU_BMIPS4380) | 196 | #if defined(CONFIG_CPU_BMIPS4350) || defined(CONFIG_CPU_BMIPS4380) |
203 | void __iomem *cbr = BMIPS_GET_CBR(); | 197 | void __iomem *cbr = BMIPS_GET_CBR(); |
204 | unsigned long old_vec; | 198 | unsigned long old_vec; |
199 | unsigned long relo_vector; | ||
200 | int boot_cpu; | ||
201 | |||
202 | boot_cpu = !!(read_c0_brcm_cmt_local() & (1 << 31)); | ||
203 | relo_vector = boot_cpu ? BMIPS_RELO_VECTOR_CONTROL_0 : | ||
204 | BMIPS_RELO_VECTOR_CONTROL_1; | ||
205 | 205 | ||
206 | old_vec = __raw_readl(cbr + BMIPS_RELO_VECTOR_CONTROL_1); | 206 | old_vec = __raw_readl(cbr + relo_vector); |
207 | __raw_writel(old_vec & ~0x20000000, cbr + BMIPS_RELO_VECTOR_CONTROL_1); | 207 | __raw_writel(old_vec & ~0x20000000, cbr + relo_vector); |
208 | 208 | ||
209 | clear_c0_cause(smp_processor_id() ? C_SW1 : C_SW0); | 209 | clear_c0_cause(smp_processor_id() ? C_SW1 : C_SW0); |
210 | #elif defined(CONFIG_CPU_BMIPS5000) | 210 | #elif defined(CONFIG_CPU_BMIPS5000) |
diff --git a/arch/mips/powertv/asic/asic_devices.c b/arch/mips/powertv/asic/asic_devices.c index 9f64c2387808..0238af1ba503 100644 --- a/arch/mips/powertv/asic/asic_devices.c +++ b/arch/mips/powertv/asic/asic_devices.c | |||
@@ -529,8 +529,7 @@ EXPORT_SYMBOL(asic_resource_get); | |||
529 | */ | 529 | */ |
530 | void platform_release_memory(void *ptr, int size) | 530 | void platform_release_memory(void *ptr, int size) |
531 | { | 531 | { |
532 | free_reserved_area((unsigned long)ptr, (unsigned long)(ptr + size), | 532 | free_reserved_area(ptr, ptr + size, -1, NULL); |
533 | -1, NULL); | ||
534 | } | 533 | } |
535 | EXPORT_SYMBOL(platform_release_memory); | 534 | EXPORT_SYMBOL(platform_release_memory); |
536 | 535 | ||
diff --git a/arch/x86/platform/ce4100/ce4100.c b/arch/x86/platform/ce4100/ce4100.c index 643b8b5eee86..8244f5ec2f4c 100644 --- a/arch/x86/platform/ce4100/ce4100.c +++ b/arch/x86/platform/ce4100/ce4100.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
13 | #include <linux/irq.h> | 13 | #include <linux/irq.h> |
14 | #include <linux/module.h> | 14 | #include <linux/module.h> |
15 | #include <linux/reboot.h> | ||
15 | #include <linux/serial_reg.h> | 16 | #include <linux/serial_reg.h> |
16 | #include <linux/serial_8250.h> | 17 | #include <linux/serial_8250.h> |
17 | #include <linux/reboot.h> | 18 | #include <linux/reboot.h> |
diff --git a/drivers/accessibility/braille/braille_console.c b/drivers/accessibility/braille/braille_console.c index d21167bfc865..dc34a5b8bcee 100644 --- a/drivers/accessibility/braille/braille_console.c +++ b/drivers/accessibility/braille/braille_console.c | |||
@@ -359,6 +359,9 @@ int braille_register_console(struct console *console, int index, | |||
359 | char *console_options, char *braille_options) | 359 | char *console_options, char *braille_options) |
360 | { | 360 | { |
361 | int ret; | 361 | int ret; |
362 | |||
363 | if (!(console->flags & CON_BRL)) | ||
364 | return 0; | ||
362 | if (!console_options) | 365 | if (!console_options) |
363 | /* Only support VisioBraille for now */ | 366 | /* Only support VisioBraille for now */ |
364 | console_options = "57600o8"; | 367 | console_options = "57600o8"; |
@@ -374,15 +377,17 @@ int braille_register_console(struct console *console, int index, | |||
374 | braille_co = console; | 377 | braille_co = console; |
375 | register_keyboard_notifier(&keyboard_notifier_block); | 378 | register_keyboard_notifier(&keyboard_notifier_block); |
376 | register_vt_notifier(&vt_notifier_block); | 379 | register_vt_notifier(&vt_notifier_block); |
377 | return 0; | 380 | return 1; |
378 | } | 381 | } |
379 | 382 | ||
380 | int braille_unregister_console(struct console *console) | 383 | int braille_unregister_console(struct console *console) |
381 | { | 384 | { |
382 | if (braille_co != console) | 385 | if (braille_co != console) |
383 | return -EINVAL; | 386 | return -EINVAL; |
387 | if (!(console->flags & CON_BRL)) | ||
388 | return 0; | ||
384 | unregister_keyboard_notifier(&keyboard_notifier_block); | 389 | unregister_keyboard_notifier(&keyboard_notifier_block); |
385 | unregister_vt_notifier(&vt_notifier_block); | 390 | unregister_vt_notifier(&vt_notifier_block); |
386 | braille_co = NULL; | 391 | braille_co = NULL; |
387 | return 0; | 392 | return 1; |
388 | } | 393 | } |
diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c index 7ef316fdc4d9..ac1b43a04285 100644 --- a/drivers/firewire/core-cdev.c +++ b/drivers/firewire/core-cdev.c | |||
@@ -54,6 +54,7 @@ | |||
54 | #define FW_CDEV_KERNEL_VERSION 5 | 54 | #define FW_CDEV_KERNEL_VERSION 5 |
55 | #define FW_CDEV_VERSION_EVENT_REQUEST2 4 | 55 | #define FW_CDEV_VERSION_EVENT_REQUEST2 4 |
56 | #define FW_CDEV_VERSION_ALLOCATE_REGION_END 4 | 56 | #define FW_CDEV_VERSION_ALLOCATE_REGION_END 4 |
57 | #define FW_CDEV_VERSION_AUTO_FLUSH_ISO_OVERFLOW 5 | ||
57 | 58 | ||
58 | struct client { | 59 | struct client { |
59 | u32 version; | 60 | u32 version; |
@@ -1005,6 +1006,8 @@ static int ioctl_create_iso_context(struct client *client, union ioctl_arg *arg) | |||
1005 | a->channel, a->speed, a->header_size, cb, client); | 1006 | a->channel, a->speed, a->header_size, cb, client); |
1006 | if (IS_ERR(context)) | 1007 | if (IS_ERR(context)) |
1007 | return PTR_ERR(context); | 1008 | return PTR_ERR(context); |
1009 | if (client->version < FW_CDEV_VERSION_AUTO_FLUSH_ISO_OVERFLOW) | ||
1010 | context->drop_overflow_headers = true; | ||
1008 | 1011 | ||
1009 | /* We only support one context at this time. */ | 1012 | /* We only support one context at this time. */ |
1010 | spin_lock_irq(&client->lock); | 1013 | spin_lock_irq(&client->lock); |
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index 9e1db6490b9a..afb701ec90ca 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c | |||
@@ -2749,8 +2749,11 @@ static void copy_iso_headers(struct iso_context *ctx, const u32 *dma_hdr) | |||
2749 | { | 2749 | { |
2750 | u32 *ctx_hdr; | 2750 | u32 *ctx_hdr; |
2751 | 2751 | ||
2752 | if (ctx->header_length + ctx->base.header_size > PAGE_SIZE) | 2752 | if (ctx->header_length + ctx->base.header_size > PAGE_SIZE) { |
2753 | if (ctx->base.drop_overflow_headers) | ||
2754 | return; | ||
2753 | flush_iso_completions(ctx); | 2755 | flush_iso_completions(ctx); |
2756 | } | ||
2754 | 2757 | ||
2755 | ctx_hdr = ctx->header + ctx->header_length; | 2758 | ctx_hdr = ctx->header + ctx->header_length; |
2756 | ctx->last_timestamp = (u16)le32_to_cpu((__force __le32)dma_hdr[0]); | 2759 | ctx->last_timestamp = (u16)le32_to_cpu((__force __le32)dma_hdr[0]); |
@@ -2910,8 +2913,11 @@ static int handle_it_packet(struct context *context, | |||
2910 | 2913 | ||
2911 | sync_it_packet_for_cpu(context, d); | 2914 | sync_it_packet_for_cpu(context, d); |
2912 | 2915 | ||
2913 | if (ctx->header_length + 4 > PAGE_SIZE) | 2916 | if (ctx->header_length + 4 > PAGE_SIZE) { |
2917 | if (ctx->base.drop_overflow_headers) | ||
2918 | return 1; | ||
2914 | flush_iso_completions(ctx); | 2919 | flush_iso_completions(ctx); |
2920 | } | ||
2915 | 2921 | ||
2916 | ctx_hdr = ctx->header + ctx->header_length; | 2922 | ctx_hdr = ctx->header + ctx->header_length; |
2917 | ctx->last_timestamp = le16_to_cpu(last->res_count); | 2923 | ctx->last_timestamp = le16_to_cpu(last->res_count); |
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c index eb760a218da4..232fa8fce26a 100644 --- a/drivers/firmware/dmi_scan.c +++ b/drivers/firmware/dmi_scan.c | |||
@@ -419,6 +419,13 @@ static void __init dmi_format_ids(char *buf, size_t len) | |||
419 | dmi_get_system_info(DMI_BIOS_DATE)); | 419 | dmi_get_system_info(DMI_BIOS_DATE)); |
420 | } | 420 | } |
421 | 421 | ||
422 | /* | ||
423 | * Check for DMI/SMBIOS headers in the system firmware image. Any | ||
424 | * SMBIOS header must start 16 bytes before the DMI header, so take a | ||
425 | * 32 byte buffer and check for DMI at offset 16 and SMBIOS at offset | ||
426 | * 0. If the DMI header is present, set dmi_ver accordingly (SMBIOS | ||
427 | * takes precedence) and return 0. Otherwise return 1. | ||
428 | */ | ||
422 | static int __init dmi_present(const u8 *buf) | 429 | static int __init dmi_present(const u8 *buf) |
423 | { | 430 | { |
424 | int smbios_ver; | 431 | int smbios_ver; |
@@ -506,6 +513,13 @@ void __init dmi_scan_machine(void) | |||
506 | if (p == NULL) | 513 | if (p == NULL) |
507 | goto error; | 514 | goto error; |
508 | 515 | ||
516 | /* | ||
517 | * Iterate over all possible DMI header addresses q. | ||
518 | * Maintain the 32 bytes around q in buf. On the | ||
519 | * first iteration, substitute zero for the | ||
520 | * out-of-range bytes so there is no chance of falsely | ||
521 | * detecting an SMBIOS header. | ||
522 | */ | ||
509 | memset(buf, 0, 16); | 523 | memset(buf, 0, 16); |
510 | for (q = p; q < p + 0x10000; q += 16) { | 524 | for (q = p; q < p + 0x10000; q += 16) { |
511 | memcpy_fromio(buf + 16, q, 16); | 525 | memcpy_fromio(buf + 16, q, 16); |
diff --git a/drivers/net/arcnet/arcnet.c b/drivers/net/arcnet/arcnet.c index a746ba272f04..a956053608f9 100644 --- a/drivers/net/arcnet/arcnet.c +++ b/drivers/net/arcnet/arcnet.c | |||
@@ -1007,7 +1007,7 @@ static void arcnet_rx(struct net_device *dev, int bufnum) | |||
1007 | 1007 | ||
1008 | soft = &pkt.soft.rfc1201; | 1008 | soft = &pkt.soft.rfc1201; |
1009 | 1009 | ||
1010 | lp->hw.copy_from_card(dev, bufnum, 0, &pkt, sizeof(ARC_HDR_SIZE)); | 1010 | lp->hw.copy_from_card(dev, bufnum, 0, &pkt, ARC_HDR_SIZE); |
1011 | if (pkt.hard.offset[0]) { | 1011 | if (pkt.hard.offset[0]) { |
1012 | ofs = pkt.hard.offset[0]; | 1012 | ofs = pkt.hard.offset[0]; |
1013 | length = 256 - ofs; | 1013 | length = 256 - ofs; |
diff --git a/drivers/net/can/usb/esd_usb2.c b/drivers/net/can/usb/esd_usb2.c index 6aa7b3266c80..ac6177d3befc 100644 --- a/drivers/net/can/usb/esd_usb2.c +++ b/drivers/net/can/usb/esd_usb2.c | |||
@@ -412,10 +412,20 @@ static void esd_usb2_read_bulk_callback(struct urb *urb) | |||
412 | 412 | ||
413 | switch (msg->msg.hdr.cmd) { | 413 | switch (msg->msg.hdr.cmd) { |
414 | case CMD_CAN_RX: | 414 | case CMD_CAN_RX: |
415 | if (msg->msg.rx.net >= dev->net_count) { | ||
416 | dev_err(dev->udev->dev.parent, "format error\n"); | ||
417 | break; | ||
418 | } | ||
419 | |||
415 | esd_usb2_rx_can_msg(dev->nets[msg->msg.rx.net], msg); | 420 | esd_usb2_rx_can_msg(dev->nets[msg->msg.rx.net], msg); |
416 | break; | 421 | break; |
417 | 422 | ||
418 | case CMD_CAN_TX: | 423 | case CMD_CAN_TX: |
424 | if (msg->msg.txdone.net >= dev->net_count) { | ||
425 | dev_err(dev->udev->dev.parent, "format error\n"); | ||
426 | break; | ||
427 | } | ||
428 | |||
419 | esd_usb2_tx_done_msg(dev->nets[msg->msg.txdone.net], | 429 | esd_usb2_tx_done_msg(dev->nets[msg->msg.txdone.net], |
420 | msg); | 430 | msg); |
421 | break; | 431 | break; |
diff --git a/drivers/net/can/usb/usb_8dev.c b/drivers/net/can/usb/usb_8dev.c index cbd388eea682..8becd3d838b5 100644 --- a/drivers/net/can/usb/usb_8dev.c +++ b/drivers/net/can/usb/usb_8dev.c | |||
@@ -779,6 +779,7 @@ static int usb_8dev_start(struct usb_8dev_priv *priv) | |||
779 | usb_unanchor_urb(urb); | 779 | usb_unanchor_urb(urb); |
780 | usb_free_coherent(priv->udev, RX_BUFFER_SIZE, buf, | 780 | usb_free_coherent(priv->udev, RX_BUFFER_SIZE, buf, |
781 | urb->transfer_dma); | 781 | urb->transfer_dma); |
782 | usb_free_urb(urb); | ||
782 | break; | 783 | break; |
783 | } | 784 | } |
784 | 785 | ||
diff --git a/drivers/net/ethernet/allwinner/Kconfig b/drivers/net/ethernet/allwinner/Kconfig index 53ad213e865b..d8d95d4cd45a 100644 --- a/drivers/net/ethernet/allwinner/Kconfig +++ b/drivers/net/ethernet/allwinner/Kconfig | |||
@@ -3,19 +3,20 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | config NET_VENDOR_ALLWINNER | 5 | config NET_VENDOR_ALLWINNER |
6 | bool "Allwinner devices" | 6 | bool "Allwinner devices" |
7 | default y | 7 | default y |
8 | depends on ARCH_SUNXI | ||
9 | ---help--- | ||
10 | If you have a network (Ethernet) card belonging to this | ||
11 | class, say Y and read the Ethernet-HOWTO, available from | ||
12 | <http://www.tldp.org/docs.html#howto>. | ||
13 | 8 | ||
14 | Note that the answer to this question doesn't directly | 9 | depends on ARCH_SUNXI |
15 | affect the kernel: saying N will just cause the configurator | 10 | ---help--- |
16 | to skip all the questions about Allwinner cards. If you say Y, | 11 | If you have a network (Ethernet) card belonging to this |
17 | you will be asked for your specific card in the following | 12 | class, say Y and read the Ethernet-HOWTO, available from |
18 | questions. | 13 | <http://www.tldp.org/docs.html#howto>. |
14 | |||
15 | Note that the answer to this question doesn't directly | ||
16 | affect the kernel: saying N will just cause the configurator | ||
17 | to skip all the questions about Allwinner cards. If you say Y, | ||
18 | you will be asked for your specific card in the following | ||
19 | questions. | ||
19 | 20 | ||
20 | if NET_VENDOR_ALLWINNER | 21 | if NET_VENDOR_ALLWINNER |
21 | 22 | ||
@@ -26,6 +27,7 @@ config SUN4I_EMAC | |||
26 | select CRC32 | 27 | select CRC32 |
27 | select MII | 28 | select MII |
28 | select PHYLIB | 29 | select PHYLIB |
30 | select MDIO_SUN4I | ||
29 | ---help--- | 31 | ---help--- |
30 | Support for Allwinner A10 EMAC ethernet driver. | 32 | Support for Allwinner A10 EMAC ethernet driver. |
31 | 33 | ||
diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c.h b/drivers/net/ethernet/atheros/atl1c/atl1c.h index b2bf324631dc..0f0556526ba9 100644 --- a/drivers/net/ethernet/atheros/atl1c/atl1c.h +++ b/drivers/net/ethernet/atheros/atl1c/atl1c.h | |||
@@ -520,6 +520,9 @@ struct atl1c_adapter { | |||
520 | struct net_device *netdev; | 520 | struct net_device *netdev; |
521 | struct pci_dev *pdev; | 521 | struct pci_dev *pdev; |
522 | struct napi_struct napi; | 522 | struct napi_struct napi; |
523 | struct page *rx_page; | ||
524 | unsigned int rx_page_offset; | ||
525 | unsigned int rx_frag_size; | ||
523 | struct atl1c_hw hw; | 526 | struct atl1c_hw hw; |
524 | struct atl1c_hw_stats hw_stats; | 527 | struct atl1c_hw_stats hw_stats; |
525 | struct mii_if_info mii; /* MII interface info */ | 528 | struct mii_if_info mii; /* MII interface info */ |
diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c index 786a87483298..a36a760ada28 100644 --- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c +++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c | |||
@@ -481,10 +481,15 @@ static int atl1c_set_mac_addr(struct net_device *netdev, void *p) | |||
481 | static void atl1c_set_rxbufsize(struct atl1c_adapter *adapter, | 481 | static void atl1c_set_rxbufsize(struct atl1c_adapter *adapter, |
482 | struct net_device *dev) | 482 | struct net_device *dev) |
483 | { | 483 | { |
484 | unsigned int head_size; | ||
484 | int mtu = dev->mtu; | 485 | int mtu = dev->mtu; |
485 | 486 | ||
486 | adapter->rx_buffer_len = mtu > AT_RX_BUF_SIZE ? | 487 | adapter->rx_buffer_len = mtu > AT_RX_BUF_SIZE ? |
487 | roundup(mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN, 8) : AT_RX_BUF_SIZE; | 488 | roundup(mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN, 8) : AT_RX_BUF_SIZE; |
489 | |||
490 | head_size = SKB_DATA_ALIGN(adapter->rx_buffer_len + NET_SKB_PAD) + | ||
491 | SKB_DATA_ALIGN(sizeof(struct skb_shared_info)); | ||
492 | adapter->rx_frag_size = roundup_pow_of_two(head_size); | ||
488 | } | 493 | } |
489 | 494 | ||
490 | static netdev_features_t atl1c_fix_features(struct net_device *netdev, | 495 | static netdev_features_t atl1c_fix_features(struct net_device *netdev, |
@@ -952,6 +957,10 @@ static void atl1c_free_ring_resources(struct atl1c_adapter *adapter) | |||
952 | kfree(adapter->tpd_ring[0].buffer_info); | 957 | kfree(adapter->tpd_ring[0].buffer_info); |
953 | adapter->tpd_ring[0].buffer_info = NULL; | 958 | adapter->tpd_ring[0].buffer_info = NULL; |
954 | } | 959 | } |
960 | if (adapter->rx_page) { | ||
961 | put_page(adapter->rx_page); | ||
962 | adapter->rx_page = NULL; | ||
963 | } | ||
955 | } | 964 | } |
956 | 965 | ||
957 | /** | 966 | /** |
@@ -1639,6 +1648,35 @@ static inline void atl1c_rx_checksum(struct atl1c_adapter *adapter, | |||
1639 | skb_checksum_none_assert(skb); | 1648 | skb_checksum_none_assert(skb); |
1640 | } | 1649 | } |
1641 | 1650 | ||
1651 | static struct sk_buff *atl1c_alloc_skb(struct atl1c_adapter *adapter) | ||
1652 | { | ||
1653 | struct sk_buff *skb; | ||
1654 | struct page *page; | ||
1655 | |||
1656 | if (adapter->rx_frag_size > PAGE_SIZE) | ||
1657 | return netdev_alloc_skb(adapter->netdev, | ||
1658 | adapter->rx_buffer_len); | ||
1659 | |||
1660 | page = adapter->rx_page; | ||
1661 | if (!page) { | ||
1662 | adapter->rx_page = page = alloc_page(GFP_ATOMIC); | ||
1663 | if (unlikely(!page)) | ||
1664 | return NULL; | ||
1665 | adapter->rx_page_offset = 0; | ||
1666 | } | ||
1667 | |||
1668 | skb = build_skb(page_address(page) + adapter->rx_page_offset, | ||
1669 | adapter->rx_frag_size); | ||
1670 | if (likely(skb)) { | ||
1671 | adapter->rx_page_offset += adapter->rx_frag_size; | ||
1672 | if (adapter->rx_page_offset >= PAGE_SIZE) | ||
1673 | adapter->rx_page = NULL; | ||
1674 | else | ||
1675 | get_page(page); | ||
1676 | } | ||
1677 | return skb; | ||
1678 | } | ||
1679 | |||
1642 | static int atl1c_alloc_rx_buffer(struct atl1c_adapter *adapter) | 1680 | static int atl1c_alloc_rx_buffer(struct atl1c_adapter *adapter) |
1643 | { | 1681 | { |
1644 | struct atl1c_rfd_ring *rfd_ring = &adapter->rfd_ring; | 1682 | struct atl1c_rfd_ring *rfd_ring = &adapter->rfd_ring; |
@@ -1660,7 +1698,7 @@ static int atl1c_alloc_rx_buffer(struct atl1c_adapter *adapter) | |||
1660 | while (next_info->flags & ATL1C_BUFFER_FREE) { | 1698 | while (next_info->flags & ATL1C_BUFFER_FREE) { |
1661 | rfd_desc = ATL1C_RFD_DESC(rfd_ring, rfd_next_to_use); | 1699 | rfd_desc = ATL1C_RFD_DESC(rfd_ring, rfd_next_to_use); |
1662 | 1700 | ||
1663 | skb = netdev_alloc_skb(adapter->netdev, adapter->rx_buffer_len); | 1701 | skb = atl1c_alloc_skb(adapter); |
1664 | if (unlikely(!skb)) { | 1702 | if (unlikely(!skb)) { |
1665 | if (netif_msg_rx_err(adapter)) | 1703 | if (netif_msg_rx_err(adapter)) |
1666 | dev_warn(&pdev->dev, "alloc rx buffer failed\n"); | 1704 | dev_warn(&pdev->dev, "alloc rx buffer failed\n"); |
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index d964f302ac94..ddebc7a5dda0 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c | |||
@@ -17625,7 +17625,8 @@ err_out_free_res: | |||
17625 | pci_release_regions(pdev); | 17625 | pci_release_regions(pdev); |
17626 | 17626 | ||
17627 | err_out_disable_pdev: | 17627 | err_out_disable_pdev: |
17628 | pci_disable_device(pdev); | 17628 | if (pci_is_enabled(pdev)) |
17629 | pci_disable_device(pdev); | ||
17629 | pci_set_drvdata(pdev, NULL); | 17630 | pci_set_drvdata(pdev, NULL); |
17630 | return err; | 17631 | return err; |
17631 | } | 17632 | } |
@@ -17773,7 +17774,8 @@ static pci_ers_result_t tg3_io_error_detected(struct pci_dev *pdev, | |||
17773 | 17774 | ||
17774 | rtnl_lock(); | 17775 | rtnl_lock(); |
17775 | 17776 | ||
17776 | if (!netif_running(netdev)) | 17777 | /* We probably don't have netdev yet */ |
17778 | if (!netdev || !netif_running(netdev)) | ||
17777 | goto done; | 17779 | goto done; |
17778 | 17780 | ||
17779 | tg3_phy_stop(tp); | 17781 | tg3_phy_stop(tp); |
diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h index 2b0a0ea4f8e7..ae236009f1a8 100644 --- a/drivers/net/ethernet/freescale/fec.h +++ b/drivers/net/ethernet/freescale/fec.h | |||
@@ -259,6 +259,7 @@ struct bufdesc_ex { | |||
259 | struct fec_enet_delayed_work { | 259 | struct fec_enet_delayed_work { |
260 | struct delayed_work delay_work; | 260 | struct delayed_work delay_work; |
261 | bool timeout; | 261 | bool timeout; |
262 | bool trig_tx; | ||
262 | }; | 263 | }; |
263 | 264 | ||
264 | /* The FEC buffer descriptors track the ring buffers. The rx_bd_base and | 265 | /* The FEC buffer descriptors track the ring buffers. The rx_bd_base and |
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index d3ad5ea711d3..77ea0db0bbfc 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c | |||
@@ -93,6 +93,20 @@ static void set_multicast_list(struct net_device *ndev); | |||
93 | #define FEC_QUIRK_HAS_CSUM (1 << 5) | 93 | #define FEC_QUIRK_HAS_CSUM (1 << 5) |
94 | /* Controller has hardware vlan support */ | 94 | /* Controller has hardware vlan support */ |
95 | #define FEC_QUIRK_HAS_VLAN (1 << 6) | 95 | #define FEC_QUIRK_HAS_VLAN (1 << 6) |
96 | /* ENET IP errata ERR006358 | ||
97 | * | ||
98 | * If the ready bit in the transmit buffer descriptor (TxBD[R]) is previously | ||
99 | * detected as not set during a prior frame transmission, then the | ||
100 | * ENET_TDAR[TDAR] bit is cleared at a later time, even if additional TxBDs | ||
101 | * were added to the ring and the ENET_TDAR[TDAR] bit is set. This results in | ||
102 | * If the ready bit in the transmit buffer descriptor (TxBD[R]) is previously | ||
103 | * detected as not set during a prior frame transmission, then the | ||
104 | * ENET_TDAR[TDAR] bit is cleared at a later time, even if additional TxBDs | ||
105 | * were added to the ring and the ENET_TDAR[TDAR] bit is set. This results in | ||
106 | * frames not being transmitted until there is a 0-to-1 transition on | ||
107 | * ENET_TDAR[TDAR]. | ||
108 | */ | ||
109 | #define FEC_QUIRK_ERR006358 (1 << 7) | ||
96 | 110 | ||
97 | static struct platform_device_id fec_devtype[] = { | 111 | static struct platform_device_id fec_devtype[] = { |
98 | { | 112 | { |
@@ -112,7 +126,7 @@ static struct platform_device_id fec_devtype[] = { | |||
112 | .name = "imx6q-fec", | 126 | .name = "imx6q-fec", |
113 | .driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT | | 127 | .driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT | |
114 | FEC_QUIRK_HAS_BUFDESC_EX | FEC_QUIRK_HAS_CSUM | | 128 | FEC_QUIRK_HAS_BUFDESC_EX | FEC_QUIRK_HAS_CSUM | |
115 | FEC_QUIRK_HAS_VLAN, | 129 | FEC_QUIRK_HAS_VLAN | FEC_QUIRK_ERR006358, |
116 | }, { | 130 | }, { |
117 | .name = "mvf600-fec", | 131 | .name = "mvf600-fec", |
118 | .driver_data = FEC_QUIRK_ENET_MAC, | 132 | .driver_data = FEC_QUIRK_ENET_MAC, |
@@ -275,16 +289,11 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *ndev) | |||
275 | struct fec_enet_private *fep = netdev_priv(ndev); | 289 | struct fec_enet_private *fep = netdev_priv(ndev); |
276 | const struct platform_device_id *id_entry = | 290 | const struct platform_device_id *id_entry = |
277 | platform_get_device_id(fep->pdev); | 291 | platform_get_device_id(fep->pdev); |
278 | struct bufdesc *bdp; | 292 | struct bufdesc *bdp, *bdp_pre; |
279 | void *bufaddr; | 293 | void *bufaddr; |
280 | unsigned short status; | 294 | unsigned short status; |
281 | unsigned int index; | 295 | unsigned int index; |
282 | 296 | ||
283 | if (!fep->link) { | ||
284 | /* Link is down or auto-negotiation is in progress. */ | ||
285 | return NETDEV_TX_BUSY; | ||
286 | } | ||
287 | |||
288 | /* Fill in a Tx ring entry */ | 297 | /* Fill in a Tx ring entry */ |
289 | bdp = fep->cur_tx; | 298 | bdp = fep->cur_tx; |
290 | 299 | ||
@@ -370,6 +379,15 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *ndev) | |||
370 | ebdp->cbd_esc |= BD_ENET_TX_PINS; | 379 | ebdp->cbd_esc |= BD_ENET_TX_PINS; |
371 | } | 380 | } |
372 | } | 381 | } |
382 | |||
383 | bdp_pre = fec_enet_get_prevdesc(bdp, fep->bufdesc_ex); | ||
384 | if ((id_entry->driver_data & FEC_QUIRK_ERR006358) && | ||
385 | !(bdp_pre->cbd_sc & BD_ENET_TX_READY)) { | ||
386 | fep->delay_work.trig_tx = true; | ||
387 | schedule_delayed_work(&(fep->delay_work.delay_work), | ||
388 | msecs_to_jiffies(1)); | ||
389 | } | ||
390 | |||
373 | /* If this was the last BD in the ring, start at the beginning again. */ | 391 | /* If this was the last BD in the ring, start at the beginning again. */ |
374 | if (status & BD_ENET_TX_WRAP) | 392 | if (status & BD_ENET_TX_WRAP) |
375 | bdp = fep->tx_bd_base; | 393 | bdp = fep->tx_bd_base; |
@@ -689,6 +707,11 @@ static void fec_enet_work(struct work_struct *work) | |||
689 | fec_restart(fep->netdev, fep->full_duplex); | 707 | fec_restart(fep->netdev, fep->full_duplex); |
690 | netif_wake_queue(fep->netdev); | 708 | netif_wake_queue(fep->netdev); |
691 | } | 709 | } |
710 | |||
711 | if (fep->delay_work.trig_tx) { | ||
712 | fep->delay_work.trig_tx = false; | ||
713 | writel(0, fep->hwp + FEC_X_DES_ACTIVE); | ||
714 | } | ||
692 | } | 715 | } |
693 | 716 | ||
694 | static void | 717 | static void |
@@ -2279,4 +2302,5 @@ static struct platform_driver fec_driver = { | |||
2279 | 2302 | ||
2280 | module_platform_driver(fec_driver); | 2303 | module_platform_driver(fec_driver); |
2281 | 2304 | ||
2305 | MODULE_ALIAS("platform:"DRIVER_NAME); | ||
2282 | MODULE_LICENSE("GPL"); | 2306 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index 6a0c1b66ce54..c1d72c03cb59 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c | |||
@@ -3739,9 +3739,8 @@ static void igb_set_rx_mode(struct net_device *netdev) | |||
3739 | rctl &= ~(E1000_RCTL_UPE | E1000_RCTL_MPE | E1000_RCTL_VFE); | 3739 | rctl &= ~(E1000_RCTL_UPE | E1000_RCTL_MPE | E1000_RCTL_VFE); |
3740 | 3740 | ||
3741 | if (netdev->flags & IFF_PROMISC) { | 3741 | if (netdev->flags & IFF_PROMISC) { |
3742 | u32 mrqc = rd32(E1000_MRQC); | ||
3743 | /* retain VLAN HW filtering if in VT mode */ | 3742 | /* retain VLAN HW filtering if in VT mode */ |
3744 | if (mrqc & E1000_MRQC_ENABLE_VMDQ) | 3743 | if (adapter->vfs_allocated_count) |
3745 | rctl |= E1000_RCTL_VFE; | 3744 | rctl |= E1000_RCTL_VFE; |
3746 | rctl |= (E1000_RCTL_UPE | E1000_RCTL_MPE); | 3745 | rctl |= (E1000_RCTL_UPE | E1000_RCTL_MPE); |
3747 | vmolr |= (E1000_VMOLR_ROPE | E1000_VMOLR_MPME); | 3746 | vmolr |= (E1000_VMOLR_ROPE | E1000_VMOLR_MPME); |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82598.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82598.c index ac780770863d..7a77f37a7cbc 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82598.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82598.c | |||
@@ -108,9 +108,8 @@ s32 ixgbe_dcb_config_tx_desc_arbiter_82598(struct ixgbe_hw *hw, | |||
108 | 108 | ||
109 | /* Enable arbiter */ | 109 | /* Enable arbiter */ |
110 | reg &= ~IXGBE_DPMCS_ARBDIS; | 110 | reg &= ~IXGBE_DPMCS_ARBDIS; |
111 | /* Enable DFP and Recycle mode */ | ||
112 | reg |= (IXGBE_DPMCS_TDPAC | IXGBE_DPMCS_TRM); | ||
113 | reg |= IXGBE_DPMCS_TSOEF; | 111 | reg |= IXGBE_DPMCS_TSOEF; |
112 | |||
114 | /* Configure Max TSO packet size 34KB including payload and headers */ | 113 | /* Configure Max TSO packet size 34KB including payload and headers */ |
115 | reg |= (0x4 << IXGBE_DPMCS_MTSOS_SHIFT); | 114 | reg |= (0x4 << IXGBE_DPMCS_MTSOS_SHIFT); |
116 | 115 | ||
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c index 712779fb12b7..b017818bccae 100644 --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c | |||
@@ -88,6 +88,8 @@ | |||
88 | #define MVNETA_TX_IN_PRGRS BIT(1) | 88 | #define MVNETA_TX_IN_PRGRS BIT(1) |
89 | #define MVNETA_TX_FIFO_EMPTY BIT(8) | 89 | #define MVNETA_TX_FIFO_EMPTY BIT(8) |
90 | #define MVNETA_RX_MIN_FRAME_SIZE 0x247c | 90 | #define MVNETA_RX_MIN_FRAME_SIZE 0x247c |
91 | #define MVNETA_SGMII_SERDES_CFG 0x24A0 | ||
92 | #define MVNETA_SGMII_SERDES_PROTO 0x0cc7 | ||
91 | #define MVNETA_TYPE_PRIO 0x24bc | 93 | #define MVNETA_TYPE_PRIO 0x24bc |
92 | #define MVNETA_FORCE_UNI BIT(21) | 94 | #define MVNETA_FORCE_UNI BIT(21) |
93 | #define MVNETA_TXQ_CMD_1 0x24e4 | 95 | #define MVNETA_TXQ_CMD_1 0x24e4 |
@@ -655,6 +657,8 @@ static void mvneta_port_sgmii_config(struct mvneta_port *pp) | |||
655 | val = mvreg_read(pp, MVNETA_GMAC_CTRL_2); | 657 | val = mvreg_read(pp, MVNETA_GMAC_CTRL_2); |
656 | val |= MVNETA_GMAC2_PSC_ENABLE; | 658 | val |= MVNETA_GMAC2_PSC_ENABLE; |
657 | mvreg_write(pp, MVNETA_GMAC_CTRL_2, val); | 659 | mvreg_write(pp, MVNETA_GMAC_CTRL_2, val); |
660 | |||
661 | mvreg_write(pp, MVNETA_SGMII_SERDES_CFG, MVNETA_SGMII_SERDES_PROTO); | ||
658 | } | 662 | } |
659 | 663 | ||
660 | /* Start the Ethernet port RX and TX activity */ | 664 | /* Start the Ethernet port RX and TX activity */ |
@@ -2728,28 +2732,24 @@ static int mvneta_probe(struct platform_device *pdev) | |||
2728 | 2732 | ||
2729 | pp = netdev_priv(dev); | 2733 | pp = netdev_priv(dev); |
2730 | 2734 | ||
2731 | pp->tx_done_timer.function = mvneta_tx_done_timer_callback; | ||
2732 | init_timer(&pp->tx_done_timer); | ||
2733 | clear_bit(MVNETA_F_TX_DONE_TIMER_BIT, &pp->flags); | ||
2734 | |||
2735 | pp->weight = MVNETA_RX_POLL_WEIGHT; | 2735 | pp->weight = MVNETA_RX_POLL_WEIGHT; |
2736 | pp->phy_node = phy_node; | 2736 | pp->phy_node = phy_node; |
2737 | pp->phy_interface = phy_mode; | 2737 | pp->phy_interface = phy_mode; |
2738 | 2738 | ||
2739 | pp->base = of_iomap(dn, 0); | ||
2740 | if (pp->base == NULL) { | ||
2741 | err = -ENOMEM; | ||
2742 | goto err_free_irq; | ||
2743 | } | ||
2744 | |||
2745 | pp->clk = devm_clk_get(&pdev->dev, NULL); | 2739 | pp->clk = devm_clk_get(&pdev->dev, NULL); |
2746 | if (IS_ERR(pp->clk)) { | 2740 | if (IS_ERR(pp->clk)) { |
2747 | err = PTR_ERR(pp->clk); | 2741 | err = PTR_ERR(pp->clk); |
2748 | goto err_unmap; | 2742 | goto err_free_irq; |
2749 | } | 2743 | } |
2750 | 2744 | ||
2751 | clk_prepare_enable(pp->clk); | 2745 | clk_prepare_enable(pp->clk); |
2752 | 2746 | ||
2747 | pp->base = of_iomap(dn, 0); | ||
2748 | if (pp->base == NULL) { | ||
2749 | err = -ENOMEM; | ||
2750 | goto err_clk; | ||
2751 | } | ||
2752 | |||
2753 | dt_mac_addr = of_get_mac_address(dn); | 2753 | dt_mac_addr = of_get_mac_address(dn); |
2754 | if (dt_mac_addr && is_valid_ether_addr(dt_mac_addr)) { | 2754 | if (dt_mac_addr && is_valid_ether_addr(dt_mac_addr)) { |
2755 | mac_from = "device tree"; | 2755 | mac_from = "device tree"; |
@@ -2766,6 +2766,9 @@ static int mvneta_probe(struct platform_device *pdev) | |||
2766 | } | 2766 | } |
2767 | 2767 | ||
2768 | pp->tx_done_timer.data = (unsigned long)dev; | 2768 | pp->tx_done_timer.data = (unsigned long)dev; |
2769 | pp->tx_done_timer.function = mvneta_tx_done_timer_callback; | ||
2770 | init_timer(&pp->tx_done_timer); | ||
2771 | clear_bit(MVNETA_F_TX_DONE_TIMER_BIT, &pp->flags); | ||
2769 | 2772 | ||
2770 | pp->tx_ring_size = MVNETA_MAX_TXD; | 2773 | pp->tx_ring_size = MVNETA_MAX_TXD; |
2771 | pp->rx_ring_size = MVNETA_MAX_RXD; | 2774 | pp->rx_ring_size = MVNETA_MAX_RXD; |
@@ -2776,7 +2779,7 @@ static int mvneta_probe(struct platform_device *pdev) | |||
2776 | err = mvneta_init(pp, phy_addr); | 2779 | err = mvneta_init(pp, phy_addr); |
2777 | if (err < 0) { | 2780 | if (err < 0) { |
2778 | dev_err(&pdev->dev, "can't init eth hal\n"); | 2781 | dev_err(&pdev->dev, "can't init eth hal\n"); |
2779 | goto err_clk; | 2782 | goto err_unmap; |
2780 | } | 2783 | } |
2781 | mvneta_port_power_up(pp, phy_mode); | 2784 | mvneta_port_power_up(pp, phy_mode); |
2782 | 2785 | ||
@@ -2806,10 +2809,10 @@ static int mvneta_probe(struct platform_device *pdev) | |||
2806 | 2809 | ||
2807 | err_deinit: | 2810 | err_deinit: |
2808 | mvneta_deinit(pp); | 2811 | mvneta_deinit(pp); |
2809 | err_clk: | ||
2810 | clk_disable_unprepare(pp->clk); | ||
2811 | err_unmap: | 2812 | err_unmap: |
2812 | iounmap(pp->base); | 2813 | iounmap(pp->base); |
2814 | err_clk: | ||
2815 | clk_disable_unprepare(pp->clk); | ||
2813 | err_free_irq: | 2816 | err_free_irq: |
2814 | irq_dispose_mapping(dev->irq); | 2817 | irq_dispose_mapping(dev->irq); |
2815 | err_free_netdev: | 2818 | err_free_netdev: |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c index 205753a04cfc..40374063c01e 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c | |||
@@ -1113,7 +1113,13 @@ void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, unsigned long vector) | |||
1113 | 1113 | ||
1114 | for (i = 0; i < (1 << cmd->log_sz); i++) { | 1114 | for (i = 0; i < (1 << cmd->log_sz); i++) { |
1115 | if (test_bit(i, &vector)) { | 1115 | if (test_bit(i, &vector)) { |
1116 | struct semaphore *sem; | ||
1117 | |||
1116 | ent = cmd->ent_arr[i]; | 1118 | ent = cmd->ent_arr[i]; |
1119 | if (ent->page_queue) | ||
1120 | sem = &cmd->pages_sem; | ||
1121 | else | ||
1122 | sem = &cmd->sem; | ||
1117 | ktime_get_ts(&ent->ts2); | 1123 | ktime_get_ts(&ent->ts2); |
1118 | memcpy(ent->out->first.data, ent->lay->out, sizeof(ent->lay->out)); | 1124 | memcpy(ent->out->first.data, ent->lay->out, sizeof(ent->lay->out)); |
1119 | dump_command(dev, ent, 0); | 1125 | dump_command(dev, ent, 0); |
@@ -1136,10 +1142,7 @@ void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, unsigned long vector) | |||
1136 | } else { | 1142 | } else { |
1137 | complete(&ent->done); | 1143 | complete(&ent->done); |
1138 | } | 1144 | } |
1139 | if (ent->page_queue) | 1145 | up(sem); |
1140 | up(&cmd->pages_sem); | ||
1141 | else | ||
1142 | up(&cmd->sem); | ||
1143 | } | 1146 | } |
1144 | } | 1147 | } |
1145 | } | 1148 | } |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/uar.c b/drivers/net/ethernet/mellanox/mlx5/core/uar.c index 71d4a3937200..68f5d9c77c7b 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/uar.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/uar.c | |||
@@ -164,6 +164,7 @@ int mlx5_alloc_uuars(struct mlx5_core_dev *dev, struct mlx5_uuar_info *uuari) | |||
164 | uuari->uars[i].map = ioremap(addr, PAGE_SIZE); | 164 | uuari->uars[i].map = ioremap(addr, PAGE_SIZE); |
165 | if (!uuari->uars[i].map) { | 165 | if (!uuari->uars[i].map) { |
166 | mlx5_cmd_free_uar(dev, uuari->uars[i].index); | 166 | mlx5_cmd_free_uar(dev, uuari->uars[i].index); |
167 | err = -ENOMEM; | ||
167 | goto out_count; | 168 | goto out_count; |
168 | } | 169 | } |
169 | mlx5_core_dbg(dev, "allocated uar index 0x%x, mmaped at %p\n", | 170 | mlx5_core_dbg(dev, "allocated uar index 0x%x, mmaped at %p\n", |
diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/Kconfig b/drivers/net/ethernet/oki-semi/pch_gbe/Kconfig index cb22341a14a8..a588ffde9700 100644 --- a/drivers/net/ethernet/oki-semi/pch_gbe/Kconfig +++ b/drivers/net/ethernet/oki-semi/pch_gbe/Kconfig | |||
@@ -4,7 +4,7 @@ | |||
4 | 4 | ||
5 | config PCH_GBE | 5 | config PCH_GBE |
6 | tristate "OKI SEMICONDUCTOR IOH(ML7223/ML7831) GbE" | 6 | tristate "OKI SEMICONDUCTOR IOH(ML7223/ML7831) GbE" |
7 | depends on PCI | 7 | depends on PCI && (X86 || COMPILE_TEST) |
8 | select MII | 8 | select MII |
9 | select PTP_1588_CLOCK_PCH | 9 | select PTP_1588_CLOCK_PCH |
10 | ---help--- | 10 | ---help--- |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h index b00cf5665eab..f4bb8f5d7453 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h | |||
@@ -1869,7 +1869,8 @@ static inline void qlcnic_free_mac_list(struct qlcnic_adapter *adapter) | |||
1869 | 1869 | ||
1870 | static inline void qlcnic_set_mac_filter_count(struct qlcnic_adapter *adapter) | 1870 | static inline void qlcnic_set_mac_filter_count(struct qlcnic_adapter *adapter) |
1871 | { | 1871 | { |
1872 | adapter->ahw->hw_ops->set_mac_filter_count(adapter); | 1872 | if (adapter->ahw->hw_ops->set_mac_filter_count) |
1873 | adapter->ahw->hw_ops->set_mac_filter_count(adapter); | ||
1873 | } | 1874 | } |
1874 | 1875 | ||
1875 | static inline void qlcnic_dev_request_reset(struct qlcnic_adapter *adapter, | 1876 | static inline void qlcnic_dev_request_reset(struct qlcnic_adapter *adapter, |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c index 0913c623a67e..bc483e1881a3 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c | |||
@@ -3014,8 +3014,8 @@ int qlcnic_83xx_get_settings(struct qlcnic_adapter *adapter, | |||
3014 | } | 3014 | } |
3015 | 3015 | ||
3016 | if (ahw->port_type == QLCNIC_XGBE) { | 3016 | if (ahw->port_type == QLCNIC_XGBE) { |
3017 | ecmd->supported = SUPPORTED_1000baseT_Full; | 3017 | ecmd->supported = SUPPORTED_10000baseT_Full; |
3018 | ecmd->advertising = ADVERTISED_1000baseT_Full; | 3018 | ecmd->advertising = ADVERTISED_10000baseT_Full; |
3019 | } else { | 3019 | } else { |
3020 | ecmd->supported = (SUPPORTED_10baseT_Half | | 3020 | ecmd->supported = (SUPPORTED_10baseT_Half | |
3021 | SUPPORTED_10baseT_Full | | 3021 | SUPPORTED_10baseT_Full | |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c index f41dfab1e9a3..51ab4b56fc91 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c | |||
@@ -2123,6 +2123,8 @@ int qlcnic_83xx_init(struct qlcnic_adapter *adapter, int pci_using_dac) | |||
2123 | set_bit(QLC_83XX_MBX_READY, &adapter->ahw->idc.status); | 2123 | set_bit(QLC_83XX_MBX_READY, &adapter->ahw->idc.status); |
2124 | qlcnic_83xx_clear_function_resources(adapter); | 2124 | qlcnic_83xx_clear_function_resources(adapter); |
2125 | 2125 | ||
2126 | INIT_DELAYED_WORK(&adapter->idc_aen_work, qlcnic_83xx_idc_aen_work); | ||
2127 | |||
2126 | /* register for NIC IDC AEN Events */ | 2128 | /* register for NIC IDC AEN Events */ |
2127 | qlcnic_83xx_register_nic_idc_func(adapter, 1); | 2129 | qlcnic_83xx_register_nic_idc_func(adapter, 1); |
2128 | 2130 | ||
@@ -2140,8 +2142,6 @@ int qlcnic_83xx_init(struct qlcnic_adapter *adapter, int pci_using_dac) | |||
2140 | if (adapter->nic_ops->init_driver(adapter)) | 2142 | if (adapter->nic_ops->init_driver(adapter)) |
2141 | return -EIO; | 2143 | return -EIO; |
2142 | 2144 | ||
2143 | INIT_DELAYED_WORK(&adapter->idc_aen_work, qlcnic_83xx_idc_aen_work); | ||
2144 | |||
2145 | /* Periodically monitor device status */ | 2145 | /* Periodically monitor device status */ |
2146 | qlcnic_83xx_idc_poll_dev_state(&adapter->fw_work.work); | 2146 | qlcnic_83xx_idc_poll_dev_state(&adapter->fw_work.work); |
2147 | 2147 | ||
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c index 700a46324d09..05a847e599c6 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c | |||
@@ -1540,7 +1540,7 @@ qlcnic_set_dump(struct net_device *netdev, struct ethtool_dump *val) | |||
1540 | return 0; | 1540 | return 0; |
1541 | case QLCNIC_SET_QUIESCENT: | 1541 | case QLCNIC_SET_QUIESCENT: |
1542 | case QLCNIC_RESET_QUIESCENT: | 1542 | case QLCNIC_RESET_QUIESCENT: |
1543 | state = QLCRD32(adapter, QLCNIC_CRB_DEV_STATE); | 1543 | state = QLC_SHARED_REG_RD32(adapter, QLCNIC_CRB_DEV_STATE); |
1544 | if (state == QLCNIC_DEV_FAILED || (state == QLCNIC_DEV_BADBAD)) | 1544 | if (state == QLCNIC_DEV_FAILED || (state == QLCNIC_DEV_BADBAD)) |
1545 | netdev_info(netdev, "Device in FAILED state\n"); | 1545 | netdev_info(netdev, "Device in FAILED state\n"); |
1546 | return 0; | 1546 | return 0; |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c index 5b5d2edf125d..4ed7e73d88d3 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c | |||
@@ -516,20 +516,18 @@ void __qlcnic_set_multi(struct net_device *netdev, u16 vlan) | |||
516 | if (netdev->flags & IFF_PROMISC) { | 516 | if (netdev->flags & IFF_PROMISC) { |
517 | if (!(adapter->flags & QLCNIC_PROMISC_DISABLED)) | 517 | if (!(adapter->flags & QLCNIC_PROMISC_DISABLED)) |
518 | mode = VPORT_MISS_MODE_ACCEPT_ALL; | 518 | mode = VPORT_MISS_MODE_ACCEPT_ALL; |
519 | } else if (netdev->flags & IFF_ALLMULTI) { | 519 | } else if ((netdev->flags & IFF_ALLMULTI) || |
520 | if (netdev_mc_count(netdev) > ahw->max_mc_count) { | 520 | (netdev_mc_count(netdev) > ahw->max_mc_count)) { |
521 | mode = VPORT_MISS_MODE_ACCEPT_MULTI; | 521 | mode = VPORT_MISS_MODE_ACCEPT_MULTI; |
522 | } else if (!netdev_mc_empty(netdev) && | 522 | } else if (!netdev_mc_empty(netdev) && |
523 | !qlcnic_sriov_vf_check(adapter)) { | 523 | !qlcnic_sriov_vf_check(adapter)) { |
524 | netdev_for_each_mc_addr(ha, netdev) | 524 | netdev_for_each_mc_addr(ha, netdev) |
525 | qlcnic_nic_add_mac(adapter, ha->addr, | 525 | qlcnic_nic_add_mac(adapter, ha->addr, vlan); |
526 | vlan); | ||
527 | } | ||
528 | if (mode != VPORT_MISS_MODE_ACCEPT_MULTI && | ||
529 | qlcnic_sriov_vf_check(adapter)) | ||
530 | qlcnic_vf_add_mc_list(netdev, vlan); | ||
531 | } | 526 | } |
532 | 527 | ||
528 | if (qlcnic_sriov_vf_check(adapter)) | ||
529 | qlcnic_vf_add_mc_list(netdev, vlan); | ||
530 | |||
533 | /* configure unicast MAC address, if there is not sufficient space | 531 | /* configure unicast MAC address, if there is not sufficient space |
534 | * to store all the unicast addresses then enable promiscuous mode | 532 | * to store all the unicast addresses then enable promiscuous mode |
535 | */ | 533 | */ |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c index d28336fc65ab..a2023090e866 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c | |||
@@ -142,7 +142,7 @@ void qlcnic_release_tx_buffers(struct qlcnic_adapter *adapter) | |||
142 | buffrag->length, PCI_DMA_TODEVICE); | 142 | buffrag->length, PCI_DMA_TODEVICE); |
143 | buffrag->dma = 0ULL; | 143 | buffrag->dma = 0ULL; |
144 | } | 144 | } |
145 | for (j = 0; j < cmd_buf->frag_count; j++) { | 145 | for (j = 1; j < cmd_buf->frag_count; j++) { |
146 | buffrag++; | 146 | buffrag++; |
147 | if (buffrag->dma) { | 147 | if (buffrag->dma) { |
148 | pci_unmap_page(adapter->pdev, buffrag->dma, | 148 | pci_unmap_page(adapter->pdev, buffrag->dma, |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c index 4528f8ec333b..cc78d3924c6a 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | |||
@@ -1383,6 +1383,8 @@ qlcnic_request_irq(struct qlcnic_adapter *adapter) | |||
1383 | if (adapter->ahw->diag_test == QLCNIC_INTERRUPT_TEST) { | 1383 | if (adapter->ahw->diag_test == QLCNIC_INTERRUPT_TEST) { |
1384 | if (qlcnic_82xx_check(adapter)) | 1384 | if (qlcnic_82xx_check(adapter)) |
1385 | handler = qlcnic_tmp_intr; | 1385 | handler = qlcnic_tmp_intr; |
1386 | else | ||
1387 | handler = qlcnic_83xx_tmp_intr; | ||
1386 | if (!QLCNIC_IS_MSI_FAMILY(adapter)) | 1388 | if (!QLCNIC_IS_MSI_FAMILY(adapter)) |
1387 | flags |= IRQF_SHARED; | 1389 | flags |= IRQF_SHARED; |
1388 | 1390 | ||
@@ -1531,12 +1533,12 @@ int __qlcnic_up(struct qlcnic_adapter *adapter, struct net_device *netdev) | |||
1531 | if (netdev->features & NETIF_F_LRO) | 1533 | if (netdev->features & NETIF_F_LRO) |
1532 | qlcnic_config_hw_lro(adapter, QLCNIC_LRO_ENABLED); | 1534 | qlcnic_config_hw_lro(adapter, QLCNIC_LRO_ENABLED); |
1533 | 1535 | ||
1536 | set_bit(__QLCNIC_DEV_UP, &adapter->state); | ||
1534 | qlcnic_napi_enable(adapter); | 1537 | qlcnic_napi_enable(adapter); |
1535 | 1538 | ||
1536 | qlcnic_linkevent_request(adapter, 1); | 1539 | qlcnic_linkevent_request(adapter, 1); |
1537 | 1540 | ||
1538 | adapter->ahw->reset_context = 0; | 1541 | adapter->ahw->reset_context = 0; |
1539 | set_bit(__QLCNIC_DEV_UP, &adapter->state); | ||
1540 | return 0; | 1542 | return 0; |
1541 | } | 1543 | } |
1542 | 1544 | ||
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c index ab8a6744d402..79e54efe07b9 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c | |||
@@ -1084,7 +1084,7 @@ flash_temp: | |||
1084 | tmpl_hdr = ahw->fw_dump.tmpl_hdr; | 1084 | tmpl_hdr = ahw->fw_dump.tmpl_hdr; |
1085 | tmpl_hdr->drv_cap_mask = QLCNIC_DUMP_MASK_DEF; | 1085 | tmpl_hdr->drv_cap_mask = QLCNIC_DUMP_MASK_DEF; |
1086 | 1086 | ||
1087 | if ((tmpl_hdr->version & 0xffffff) >= 0x20001) | 1087 | if ((tmpl_hdr->version & 0xfffff) >= 0x20001) |
1088 | ahw->fw_dump.use_pex_dma = true; | 1088 | ahw->fw_dump.use_pex_dma = true; |
1089 | else | 1089 | else |
1090 | ahw->fw_dump.use_pex_dma = false; | 1090 | ahw->fw_dump.use_pex_dma = false; |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c index 62380ce89905..56e85f98117f 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c | |||
@@ -762,6 +762,7 @@ static int qlcnic_sriov_alloc_bc_mbx_args(struct qlcnic_cmd_args *mbx, u32 type) | |||
762 | memset(mbx->rsp.arg, 0, sizeof(u32) * mbx->rsp.num); | 762 | memset(mbx->rsp.arg, 0, sizeof(u32) * mbx->rsp.num); |
763 | mbx->req.arg[0] = (type | (mbx->req.num << 16) | | 763 | mbx->req.arg[0] = (type | (mbx->req.num << 16) | |
764 | (3 << 29)); | 764 | (3 << 29)); |
765 | mbx->rsp.arg[0] = (type & 0xffff) | mbx->rsp.num << 16; | ||
765 | return 0; | 766 | return 0; |
766 | } | 767 | } |
767 | } | 768 | } |
@@ -813,6 +814,7 @@ static int qlcnic_sriov_prepare_bc_hdr(struct qlcnic_bc_trans *trans, | |||
813 | cmd->req.num = trans->req_pay_size / 4; | 814 | cmd->req.num = trans->req_pay_size / 4; |
814 | cmd->rsp.num = trans->rsp_pay_size / 4; | 815 | cmd->rsp.num = trans->rsp_pay_size / 4; |
815 | hdr = trans->rsp_hdr; | 816 | hdr = trans->rsp_hdr; |
817 | cmd->op_type = trans->req_hdr->op_type; | ||
816 | } | 818 | } |
817 | 819 | ||
818 | trans->trans_id = seq; | 820 | trans->trans_id = seq; |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c index ee0c1d307966..eb49cd65378c 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c | |||
@@ -635,12 +635,12 @@ static int qlcnic_sriov_pf_channel_cfg_cmd(struct qlcnic_bc_trans *trans, | |||
635 | struct qlcnic_cmd_args *cmd) | 635 | struct qlcnic_cmd_args *cmd) |
636 | { | 636 | { |
637 | struct qlcnic_vf_info *vf = trans->vf; | 637 | struct qlcnic_vf_info *vf = trans->vf; |
638 | struct qlcnic_adapter *adapter = vf->adapter; | 638 | struct qlcnic_vport *vp = vf->vp; |
639 | int err; | 639 | struct qlcnic_adapter *adapter; |
640 | u16 func = vf->pci_func; | 640 | u16 func = vf->pci_func; |
641 | int err; | ||
641 | 642 | ||
642 | cmd->rsp.arg[0] = trans->req_hdr->cmd_op; | 643 | adapter = vf->adapter; |
643 | cmd->rsp.arg[0] |= (1 << 16); | ||
644 | 644 | ||
645 | if (trans->req_hdr->cmd_op == QLCNIC_BC_CMD_CHANNEL_INIT) { | 645 | if (trans->req_hdr->cmd_op == QLCNIC_BC_CMD_CHANNEL_INIT) { |
646 | err = qlcnic_sriov_pf_config_vport(adapter, 1, func); | 646 | err = qlcnic_sriov_pf_config_vport(adapter, 1, func); |
@@ -650,6 +650,8 @@ static int qlcnic_sriov_pf_channel_cfg_cmd(struct qlcnic_bc_trans *trans, | |||
650 | qlcnic_sriov_pf_config_vport(adapter, 0, func); | 650 | qlcnic_sriov_pf_config_vport(adapter, 0, func); |
651 | } | 651 | } |
652 | } else { | 652 | } else { |
653 | if (vp->vlan_mode == QLC_GUEST_VLAN_MODE) | ||
654 | vp->vlan = 0; | ||
653 | err = qlcnic_sriov_pf_config_vport(adapter, 0, func); | 655 | err = qlcnic_sriov_pf_config_vport(adapter, 0, func); |
654 | } | 656 | } |
655 | 657 | ||
@@ -1183,7 +1185,7 @@ static int qlcnic_sriov_pf_get_acl_cmd(struct qlcnic_bc_trans *trans, | |||
1183 | u8 cmd_op, mode = vp->vlan_mode; | 1185 | u8 cmd_op, mode = vp->vlan_mode; |
1184 | 1186 | ||
1185 | cmd_op = trans->req_hdr->cmd_op; | 1187 | cmd_op = trans->req_hdr->cmd_op; |
1186 | cmd->rsp.arg[0] = (cmd_op & 0xffff) | 14 << 16 | 1 << 25; | 1188 | cmd->rsp.arg[0] |= 1 << 25; |
1187 | 1189 | ||
1188 | switch (mode) { | 1190 | switch (mode) { |
1189 | case QLC_GUEST_VLAN_MODE: | 1191 | case QLC_GUEST_VLAN_MODE: |
@@ -1561,6 +1563,7 @@ void qlcnic_sriov_pf_handle_flr(struct qlcnic_sriov *sriov, | |||
1561 | struct qlcnic_vf_info *vf) | 1563 | struct qlcnic_vf_info *vf) |
1562 | { | 1564 | { |
1563 | struct net_device *dev = vf->adapter->netdev; | 1565 | struct net_device *dev = vf->adapter->netdev; |
1566 | struct qlcnic_vport *vp = vf->vp; | ||
1564 | 1567 | ||
1565 | if (!test_and_clear_bit(QLC_BC_VF_STATE, &vf->state)) { | 1568 | if (!test_and_clear_bit(QLC_BC_VF_STATE, &vf->state)) { |
1566 | clear_bit(QLC_BC_VF_FLR, &vf->state); | 1569 | clear_bit(QLC_BC_VF_FLR, &vf->state); |
@@ -1573,6 +1576,9 @@ void qlcnic_sriov_pf_handle_flr(struct qlcnic_sriov *sriov, | |||
1573 | return; | 1576 | return; |
1574 | } | 1577 | } |
1575 | 1578 | ||
1579 | if (vp->vlan_mode == QLC_GUEST_VLAN_MODE) | ||
1580 | vp->vlan = 0; | ||
1581 | |||
1576 | qlcnic_sriov_schedule_flr(sriov, vf, qlcnic_sriov_pf_process_flr); | 1582 | qlcnic_sriov_schedule_flr(sriov, vf, qlcnic_sriov_pf_process_flr); |
1577 | netdev_info(dev, "FLR received for PCI func %d\n", vf->pci_func); | 1583 | netdev_info(dev, "FLR received for PCI func %d\n", vf->pci_func); |
1578 | } | 1584 | } |
@@ -1621,13 +1627,15 @@ int qlcnic_sriov_set_vf_mac(struct net_device *netdev, int vf, u8 *mac) | |||
1621 | { | 1627 | { |
1622 | struct qlcnic_adapter *adapter = netdev_priv(netdev); | 1628 | struct qlcnic_adapter *adapter = netdev_priv(netdev); |
1623 | struct qlcnic_sriov *sriov = adapter->ahw->sriov; | 1629 | struct qlcnic_sriov *sriov = adapter->ahw->sriov; |
1624 | int i, num_vfs = sriov->num_vfs; | 1630 | int i, num_vfs; |
1625 | struct qlcnic_vf_info *vf_info; | 1631 | struct qlcnic_vf_info *vf_info; |
1626 | u8 *curr_mac; | 1632 | u8 *curr_mac; |
1627 | 1633 | ||
1628 | if (!qlcnic_sriov_pf_check(adapter)) | 1634 | if (!qlcnic_sriov_pf_check(adapter)) |
1629 | return -EOPNOTSUPP; | 1635 | return -EOPNOTSUPP; |
1630 | 1636 | ||
1637 | num_vfs = sriov->num_vfs; | ||
1638 | |||
1631 | if (!is_valid_ether_addr(mac) || vf >= num_vfs) | 1639 | if (!is_valid_ether_addr(mac) || vf >= num_vfs) |
1632 | return -EINVAL; | 1640 | return -EINVAL; |
1633 | 1641 | ||
@@ -1741,6 +1749,7 @@ int qlcnic_sriov_set_vf_vlan(struct net_device *netdev, int vf, | |||
1741 | 1749 | ||
1742 | switch (vlan) { | 1750 | switch (vlan) { |
1743 | case 4095: | 1751 | case 4095: |
1752 | vp->vlan = 0; | ||
1744 | vp->vlan_mode = QLC_GUEST_VLAN_MODE; | 1753 | vp->vlan_mode = QLC_GUEST_VLAN_MODE; |
1745 | break; | 1754 | break; |
1746 | case 0: | 1755 | case 0: |
@@ -1759,6 +1768,29 @@ int qlcnic_sriov_set_vf_vlan(struct net_device *netdev, int vf, | |||
1759 | return 0; | 1768 | return 0; |
1760 | } | 1769 | } |
1761 | 1770 | ||
1771 | static inline __u32 qlcnic_sriov_get_vf_vlan(struct qlcnic_adapter *adapter, | ||
1772 | struct qlcnic_vport *vp, int vf) | ||
1773 | { | ||
1774 | __u32 vlan = 0; | ||
1775 | |||
1776 | switch (vp->vlan_mode) { | ||
1777 | case QLC_PVID_MODE: | ||
1778 | vlan = vp->vlan; | ||
1779 | break; | ||
1780 | case QLC_GUEST_VLAN_MODE: | ||
1781 | vlan = MAX_VLAN_ID; | ||
1782 | break; | ||
1783 | case QLC_NO_VLAN_MODE: | ||
1784 | vlan = 0; | ||
1785 | break; | ||
1786 | default: | ||
1787 | netdev_info(adapter->netdev, "Invalid VLAN mode = %d for VF %d\n", | ||
1788 | vp->vlan_mode, vf); | ||
1789 | } | ||
1790 | |||
1791 | return vlan; | ||
1792 | } | ||
1793 | |||
1762 | int qlcnic_sriov_get_vf_config(struct net_device *netdev, | 1794 | int qlcnic_sriov_get_vf_config(struct net_device *netdev, |
1763 | int vf, struct ifla_vf_info *ivi) | 1795 | int vf, struct ifla_vf_info *ivi) |
1764 | { | 1796 | { |
@@ -1774,7 +1806,7 @@ int qlcnic_sriov_get_vf_config(struct net_device *netdev, | |||
1774 | 1806 | ||
1775 | vp = sriov->vf_info[vf].vp; | 1807 | vp = sriov->vf_info[vf].vp; |
1776 | memcpy(&ivi->mac, vp->mac, ETH_ALEN); | 1808 | memcpy(&ivi->mac, vp->mac, ETH_ALEN); |
1777 | ivi->vlan = vp->vlan; | 1809 | ivi->vlan = qlcnic_sriov_get_vf_vlan(adapter, vp, vf); |
1778 | ivi->qos = vp->qos; | 1810 | ivi->qos = vp->qos; |
1779 | ivi->spoofchk = vp->spoofchk; | 1811 | ivi->spoofchk = vp->spoofchk; |
1780 | if (vp->max_tx_bw == MAX_BW) | 1812 | if (vp->max_tx_bw == MAX_BW) |
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index 4106a743ca74..880015cae6a3 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c | |||
@@ -6468,6 +6468,8 @@ static int rtl8169_close(struct net_device *dev) | |||
6468 | rtl8169_down(dev); | 6468 | rtl8169_down(dev); |
6469 | rtl_unlock_work(tp); | 6469 | rtl_unlock_work(tp); |
6470 | 6470 | ||
6471 | cancel_work_sync(&tp->wk.work); | ||
6472 | |||
6471 | free_irq(pdev->irq, dev); | 6473 | free_irq(pdev->irq, dev); |
6472 | 6474 | ||
6473 | dma_free_coherent(&pdev->dev, R8169_RX_RING_BYTES, tp->RxDescArray, | 6475 | dma_free_coherent(&pdev->dev, R8169_RX_RING_BYTES, tp->RxDescArray, |
@@ -6793,8 +6795,6 @@ static void rtl_remove_one(struct pci_dev *pdev) | |||
6793 | rtl8168_driver_stop(tp); | 6795 | rtl8168_driver_stop(tp); |
6794 | } | 6796 | } |
6795 | 6797 | ||
6796 | cancel_work_sync(&tp->wk.work); | ||
6797 | |||
6798 | netif_napi_del(&tp->napi); | 6798 | netif_napi_del(&tp->napi); |
6799 | 6799 | ||
6800 | unregister_netdev(dev); | 6800 | unregister_netdev(dev); |
diff --git a/drivers/net/ethernet/sfc/filter.c b/drivers/net/ethernet/sfc/filter.c index b74a60ab9ac7..2a469b27a506 100644 --- a/drivers/net/ethernet/sfc/filter.c +++ b/drivers/net/ethernet/sfc/filter.c | |||
@@ -1209,7 +1209,9 @@ int efx_filter_rfs(struct net_device *net_dev, const struct sk_buff *skb, | |||
1209 | EFX_BUG_ON_PARANOID(skb_headlen(skb) < nhoff + 4 * ip->ihl + 4); | 1209 | EFX_BUG_ON_PARANOID(skb_headlen(skb) < nhoff + 4 * ip->ihl + 4); |
1210 | ports = (const __be16 *)(skb->data + nhoff + 4 * ip->ihl); | 1210 | ports = (const __be16 *)(skb->data + nhoff + 4 * ip->ihl); |
1211 | 1211 | ||
1212 | efx_filter_init_rx(&spec, EFX_FILTER_PRI_HINT, 0, rxq_index); | 1212 | efx_filter_init_rx(&spec, EFX_FILTER_PRI_HINT, |
1213 | efx->rx_scatter ? EFX_FILTER_FLAG_RX_SCATTER : 0, | ||
1214 | rxq_index); | ||
1213 | rc = efx_filter_set_ipv4_full(&spec, ip->protocol, | 1215 | rc = efx_filter_set_ipv4_full(&spec, ip->protocol, |
1214 | ip->daddr, ports[1], ip->saddr, ports[0]); | 1216 | ip->daddr, ports[1], ip->saddr, ports[0]); |
1215 | if (rc) | 1217 | if (rc) |
diff --git a/drivers/net/phy/mdio-sun4i.c b/drivers/net/phy/mdio-sun4i.c index 61d3f4ebf52e..7f25e49ae37f 100644 --- a/drivers/net/phy/mdio-sun4i.c +++ b/drivers/net/phy/mdio-sun4i.c | |||
@@ -40,7 +40,7 @@ struct sun4i_mdio_data { | |||
40 | static int sun4i_mdio_read(struct mii_bus *bus, int mii_id, int regnum) | 40 | static int sun4i_mdio_read(struct mii_bus *bus, int mii_id, int regnum) |
41 | { | 41 | { |
42 | struct sun4i_mdio_data *data = bus->priv; | 42 | struct sun4i_mdio_data *data = bus->priv; |
43 | unsigned long start_jiffies; | 43 | unsigned long timeout_jiffies; |
44 | int value; | 44 | int value; |
45 | 45 | ||
46 | /* issue the phy address and reg */ | 46 | /* issue the phy address and reg */ |
@@ -49,10 +49,9 @@ static int sun4i_mdio_read(struct mii_bus *bus, int mii_id, int regnum) | |||
49 | writel(0x1, data->membase + EMAC_MAC_MCMD_REG); | 49 | writel(0x1, data->membase + EMAC_MAC_MCMD_REG); |
50 | 50 | ||
51 | /* Wait read complete */ | 51 | /* Wait read complete */ |
52 | start_jiffies = jiffies; | 52 | timeout_jiffies = jiffies + MDIO_TIMEOUT; |
53 | while (readl(data->membase + EMAC_MAC_MIND_REG) & 0x1) { | 53 | while (readl(data->membase + EMAC_MAC_MIND_REG) & 0x1) { |
54 | if (time_after(start_jiffies, | 54 | if (time_is_before_jiffies(timeout_jiffies)) |
55 | start_jiffies + MDIO_TIMEOUT)) | ||
56 | return -ETIMEDOUT; | 55 | return -ETIMEDOUT; |
57 | msleep(1); | 56 | msleep(1); |
58 | } | 57 | } |
@@ -69,7 +68,7 @@ static int sun4i_mdio_write(struct mii_bus *bus, int mii_id, int regnum, | |||
69 | u16 value) | 68 | u16 value) |
70 | { | 69 | { |
71 | struct sun4i_mdio_data *data = bus->priv; | 70 | struct sun4i_mdio_data *data = bus->priv; |
72 | unsigned long start_jiffies; | 71 | unsigned long timeout_jiffies; |
73 | 72 | ||
74 | /* issue the phy address and reg */ | 73 | /* issue the phy address and reg */ |
75 | writel((mii_id << 8) | regnum, data->membase + EMAC_MAC_MADR_REG); | 74 | writel((mii_id << 8) | regnum, data->membase + EMAC_MAC_MADR_REG); |
@@ -77,10 +76,9 @@ static int sun4i_mdio_write(struct mii_bus *bus, int mii_id, int regnum, | |||
77 | writel(0x1, data->membase + EMAC_MAC_MCMD_REG); | 76 | writel(0x1, data->membase + EMAC_MAC_MCMD_REG); |
78 | 77 | ||
79 | /* Wait read complete */ | 78 | /* Wait read complete */ |
80 | start_jiffies = jiffies; | 79 | timeout_jiffies = jiffies + MDIO_TIMEOUT; |
81 | while (readl(data->membase + EMAC_MAC_MIND_REG) & 0x1) { | 80 | while (readl(data->membase + EMAC_MAC_MIND_REG) & 0x1) { |
82 | if (time_after(start_jiffies, | 81 | if (time_is_before_jiffies(timeout_jiffies)) |
83 | start_jiffies + MDIO_TIMEOUT)) | ||
84 | return -ETIMEDOUT; | 82 | return -ETIMEDOUT; |
85 | msleep(1); | 83 | msleep(1); |
86 | } | 84 | } |
diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c index 1e3c302d94fe..2bc87e3a8141 100644 --- a/drivers/net/usb/ax88179_178a.c +++ b/drivers/net/usb/ax88179_178a.c | |||
@@ -1029,10 +1029,10 @@ static int ax88179_bind(struct usbnet *dev, struct usb_interface *intf) | |||
1029 | dev->mii.supports_gmii = 1; | 1029 | dev->mii.supports_gmii = 1; |
1030 | 1030 | ||
1031 | dev->net->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | | 1031 | dev->net->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | |
1032 | NETIF_F_RXCSUM | NETIF_F_SG | NETIF_F_TSO; | 1032 | NETIF_F_RXCSUM; |
1033 | 1033 | ||
1034 | dev->net->hw_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | | 1034 | dev->net->hw_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | |
1035 | NETIF_F_RXCSUM | NETIF_F_SG | NETIF_F_TSO; | 1035 | NETIF_F_RXCSUM; |
1036 | 1036 | ||
1037 | /* Enable checksum offload */ | 1037 | /* Enable checksum offload */ |
1038 | *tmp = AX_RXCOE_IP | AX_RXCOE_TCP | AX_RXCOE_UDP | | 1038 | *tmp = AX_RXCOE_IP | AX_RXCOE_TCP | AX_RXCOE_UDP | |
@@ -1173,7 +1173,6 @@ ax88179_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags) | |||
1173 | if (((skb->len + 8) % frame_size) == 0) | 1173 | if (((skb->len + 8) % frame_size) == 0) |
1174 | tx_hdr2 |= 0x80008000; /* Enable padding */ | 1174 | tx_hdr2 |= 0x80008000; /* Enable padding */ |
1175 | 1175 | ||
1176 | skb_linearize(skb); | ||
1177 | headroom = skb_headroom(skb); | 1176 | headroom = skb_headroom(skb); |
1178 | tailroom = skb_tailroom(skb); | 1177 | tailroom = skb_tailroom(skb); |
1179 | 1178 | ||
@@ -1317,10 +1316,10 @@ static int ax88179_reset(struct usbnet *dev) | |||
1317 | 1, 1, tmp); | 1316 | 1, 1, tmp); |
1318 | 1317 | ||
1319 | dev->net->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | | 1318 | dev->net->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | |
1320 | NETIF_F_RXCSUM | NETIF_F_SG | NETIF_F_TSO; | 1319 | NETIF_F_RXCSUM; |
1321 | 1320 | ||
1322 | dev->net->hw_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | | 1321 | dev->net->hw_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | |
1323 | NETIF_F_RXCSUM | NETIF_F_SG | NETIF_F_TSO; | 1322 | NETIF_F_RXCSUM; |
1324 | 1323 | ||
1325 | /* Enable checksum offload */ | 1324 | /* Enable checksum offload */ |
1326 | *tmp = AX_RXCOE_IP | AX_RXCOE_TCP | AX_RXCOE_UDP | | 1325 | *tmp = AX_RXCOE_IP | AX_RXCOE_TCP | AX_RXCOE_UDP | |
diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c index 75409748c774..66ebbacf066f 100644 --- a/drivers/net/usb/smsc75xx.c +++ b/drivers/net/usb/smsc75xx.c | |||
@@ -45,7 +45,6 @@ | |||
45 | #define EEPROM_MAC_OFFSET (0x01) | 45 | #define EEPROM_MAC_OFFSET (0x01) |
46 | #define DEFAULT_TX_CSUM_ENABLE (true) | 46 | #define DEFAULT_TX_CSUM_ENABLE (true) |
47 | #define DEFAULT_RX_CSUM_ENABLE (true) | 47 | #define DEFAULT_RX_CSUM_ENABLE (true) |
48 | #define DEFAULT_TSO_ENABLE (true) | ||
49 | #define SMSC75XX_INTERNAL_PHY_ID (1) | 48 | #define SMSC75XX_INTERNAL_PHY_ID (1) |
50 | #define SMSC75XX_TX_OVERHEAD (8) | 49 | #define SMSC75XX_TX_OVERHEAD (8) |
51 | #define MAX_RX_FIFO_SIZE (20 * 1024) | 50 | #define MAX_RX_FIFO_SIZE (20 * 1024) |
@@ -1410,17 +1409,14 @@ static int smsc75xx_bind(struct usbnet *dev, struct usb_interface *intf) | |||
1410 | 1409 | ||
1411 | INIT_WORK(&pdata->set_multicast, smsc75xx_deferred_multicast_write); | 1410 | INIT_WORK(&pdata->set_multicast, smsc75xx_deferred_multicast_write); |
1412 | 1411 | ||
1413 | if (DEFAULT_TX_CSUM_ENABLE) { | 1412 | if (DEFAULT_TX_CSUM_ENABLE) |
1414 | dev->net->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; | 1413 | dev->net->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; |
1415 | if (DEFAULT_TSO_ENABLE) | 1414 | |
1416 | dev->net->features |= NETIF_F_SG | | ||
1417 | NETIF_F_TSO | NETIF_F_TSO6; | ||
1418 | } | ||
1419 | if (DEFAULT_RX_CSUM_ENABLE) | 1415 | if (DEFAULT_RX_CSUM_ENABLE) |
1420 | dev->net->features |= NETIF_F_RXCSUM; | 1416 | dev->net->features |= NETIF_F_RXCSUM; |
1421 | 1417 | ||
1422 | dev->net->hw_features = NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | | 1418 | dev->net->hw_features = NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | |
1423 | NETIF_F_SG | NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_RXCSUM; | 1419 | NETIF_F_RXCSUM; |
1424 | 1420 | ||
1425 | ret = smsc75xx_wait_ready(dev, 0); | 1421 | ret = smsc75xx_wait_ready(dev, 0); |
1426 | if (ret < 0) { | 1422 | if (ret < 0) { |
@@ -2200,8 +2196,6 @@ static struct sk_buff *smsc75xx_tx_fixup(struct usbnet *dev, | |||
2200 | { | 2196 | { |
2201 | u32 tx_cmd_a, tx_cmd_b; | 2197 | u32 tx_cmd_a, tx_cmd_b; |
2202 | 2198 | ||
2203 | skb_linearize(skb); | ||
2204 | |||
2205 | if (skb_headroom(skb) < SMSC75XX_TX_OVERHEAD) { | 2199 | if (skb_headroom(skb) < SMSC75XX_TX_OVERHEAD) { |
2206 | struct sk_buff *skb2 = | 2200 | struct sk_buff *skb2 = |
2207 | skb_copy_expand(skb, SMSC75XX_TX_OVERHEAD, 0, flags); | 2201 | skb_copy_expand(skb, SMSC75XX_TX_OVERHEAD, 0, flags); |
diff --git a/drivers/net/veth.c b/drivers/net/veth.c index da866523cf20..eee1f19ef1e9 100644 --- a/drivers/net/veth.c +++ b/drivers/net/veth.c | |||
@@ -269,6 +269,7 @@ static void veth_setup(struct net_device *dev) | |||
269 | dev->ethtool_ops = &veth_ethtool_ops; | 269 | dev->ethtool_ops = &veth_ethtool_ops; |
270 | dev->features |= NETIF_F_LLTX; | 270 | dev->features |= NETIF_F_LLTX; |
271 | dev->features |= VETH_FEATURES; | 271 | dev->features |= VETH_FEATURES; |
272 | dev->vlan_features = dev->features; | ||
272 | dev->destructor = veth_dev_free; | 273 | dev->destructor = veth_dev_free; |
273 | 274 | ||
274 | dev->hw_features = VETH_FEATURES; | 275 | dev->hw_features = VETH_FEATURES; |
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index a5ba8dd7e6be..f4c6db419ddb 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c | |||
@@ -136,7 +136,8 @@ struct vxlan_dev { | |||
136 | u32 flags; /* VXLAN_F_* below */ | 136 | u32 flags; /* VXLAN_F_* below */ |
137 | 137 | ||
138 | struct work_struct sock_work; | 138 | struct work_struct sock_work; |
139 | struct work_struct igmp_work; | 139 | struct work_struct igmp_join; |
140 | struct work_struct igmp_leave; | ||
140 | 141 | ||
141 | unsigned long age_interval; | 142 | unsigned long age_interval; |
142 | struct timer_list age_timer; | 143 | struct timer_list age_timer; |
@@ -736,7 +737,6 @@ static bool vxlan_snoop(struct net_device *dev, | |||
736 | return false; | 737 | return false; |
737 | } | 738 | } |
738 | 739 | ||
739 | |||
740 | /* See if multicast group is already in use by other ID */ | 740 | /* See if multicast group is already in use by other ID */ |
741 | static bool vxlan_group_used(struct vxlan_net *vn, __be32 remote_ip) | 741 | static bool vxlan_group_used(struct vxlan_net *vn, __be32 remote_ip) |
742 | { | 742 | { |
@@ -770,12 +770,13 @@ static void vxlan_sock_release(struct vxlan_net *vn, struct vxlan_sock *vs) | |||
770 | queue_work(vxlan_wq, &vs->del_work); | 770 | queue_work(vxlan_wq, &vs->del_work); |
771 | } | 771 | } |
772 | 772 | ||
773 | /* Callback to update multicast group membership. | 773 | /* Callback to update multicast group membership when first VNI on |
774 | * Scheduled when vxlan goes up/down. | 774 | * multicast asddress is brought up |
775 | * Done as workqueue because ip_mc_join_group acquires RTNL. | ||
775 | */ | 776 | */ |
776 | static void vxlan_igmp_work(struct work_struct *work) | 777 | static void vxlan_igmp_join(struct work_struct *work) |
777 | { | 778 | { |
778 | struct vxlan_dev *vxlan = container_of(work, struct vxlan_dev, igmp_work); | 779 | struct vxlan_dev *vxlan = container_of(work, struct vxlan_dev, igmp_join); |
779 | struct vxlan_net *vn = net_generic(dev_net(vxlan->dev), vxlan_net_id); | 780 | struct vxlan_net *vn = net_generic(dev_net(vxlan->dev), vxlan_net_id); |
780 | struct vxlan_sock *vs = vxlan->vn_sock; | 781 | struct vxlan_sock *vs = vxlan->vn_sock; |
781 | struct sock *sk = vs->sock->sk; | 782 | struct sock *sk = vs->sock->sk; |
@@ -785,10 +786,27 @@ static void vxlan_igmp_work(struct work_struct *work) | |||
785 | }; | 786 | }; |
786 | 787 | ||
787 | lock_sock(sk); | 788 | lock_sock(sk); |
788 | if (vxlan_group_used(vn, vxlan->default_dst.remote_ip)) | 789 | ip_mc_join_group(sk, &mreq); |
789 | ip_mc_join_group(sk, &mreq); | 790 | release_sock(sk); |
790 | else | 791 | |
791 | ip_mc_leave_group(sk, &mreq); | 792 | vxlan_sock_release(vn, vs); |
793 | dev_put(vxlan->dev); | ||
794 | } | ||
795 | |||
796 | /* Inverse of vxlan_igmp_join when last VNI is brought down */ | ||
797 | static void vxlan_igmp_leave(struct work_struct *work) | ||
798 | { | ||
799 | struct vxlan_dev *vxlan = container_of(work, struct vxlan_dev, igmp_leave); | ||
800 | struct vxlan_net *vn = net_generic(dev_net(vxlan->dev), vxlan_net_id); | ||
801 | struct vxlan_sock *vs = vxlan->vn_sock; | ||
802 | struct sock *sk = vs->sock->sk; | ||
803 | struct ip_mreqn mreq = { | ||
804 | .imr_multiaddr.s_addr = vxlan->default_dst.remote_ip, | ||
805 | .imr_ifindex = vxlan->default_dst.remote_ifindex, | ||
806 | }; | ||
807 | |||
808 | lock_sock(sk); | ||
809 | ip_mc_leave_group(sk, &mreq); | ||
792 | release_sock(sk); | 810 | release_sock(sk); |
793 | 811 | ||
794 | vxlan_sock_release(vn, vs); | 812 | vxlan_sock_release(vn, vs); |
@@ -1359,6 +1377,7 @@ static void vxlan_uninit(struct net_device *dev) | |||
1359 | /* Start ageing timer and join group when device is brought up */ | 1377 | /* Start ageing timer and join group when device is brought up */ |
1360 | static int vxlan_open(struct net_device *dev) | 1378 | static int vxlan_open(struct net_device *dev) |
1361 | { | 1379 | { |
1380 | struct vxlan_net *vn = net_generic(dev_net(dev), vxlan_net_id); | ||
1362 | struct vxlan_dev *vxlan = netdev_priv(dev); | 1381 | struct vxlan_dev *vxlan = netdev_priv(dev); |
1363 | struct vxlan_sock *vs = vxlan->vn_sock; | 1382 | struct vxlan_sock *vs = vxlan->vn_sock; |
1364 | 1383 | ||
@@ -1366,10 +1385,11 @@ static int vxlan_open(struct net_device *dev) | |||
1366 | if (!vs) | 1385 | if (!vs) |
1367 | return -ENOTCONN; | 1386 | return -ENOTCONN; |
1368 | 1387 | ||
1369 | if (IN_MULTICAST(ntohl(vxlan->default_dst.remote_ip))) { | 1388 | if (IN_MULTICAST(ntohl(vxlan->default_dst.remote_ip)) && |
1389 | ! vxlan_group_used(vn, vxlan->default_dst.remote_ip)) { | ||
1370 | vxlan_sock_hold(vs); | 1390 | vxlan_sock_hold(vs); |
1371 | dev_hold(dev); | 1391 | dev_hold(dev); |
1372 | queue_work(vxlan_wq, &vxlan->igmp_work); | 1392 | queue_work(vxlan_wq, &vxlan->igmp_join); |
1373 | } | 1393 | } |
1374 | 1394 | ||
1375 | if (vxlan->age_interval) | 1395 | if (vxlan->age_interval) |
@@ -1400,13 +1420,15 @@ static void vxlan_flush(struct vxlan_dev *vxlan) | |||
1400 | /* Cleanup timer and forwarding table on shutdown */ | 1420 | /* Cleanup timer and forwarding table on shutdown */ |
1401 | static int vxlan_stop(struct net_device *dev) | 1421 | static int vxlan_stop(struct net_device *dev) |
1402 | { | 1422 | { |
1423 | struct vxlan_net *vn = net_generic(dev_net(dev), vxlan_net_id); | ||
1403 | struct vxlan_dev *vxlan = netdev_priv(dev); | 1424 | struct vxlan_dev *vxlan = netdev_priv(dev); |
1404 | struct vxlan_sock *vs = vxlan->vn_sock; | 1425 | struct vxlan_sock *vs = vxlan->vn_sock; |
1405 | 1426 | ||
1406 | if (vs && IN_MULTICAST(ntohl(vxlan->default_dst.remote_ip))) { | 1427 | if (vs && IN_MULTICAST(ntohl(vxlan->default_dst.remote_ip)) && |
1428 | ! vxlan_group_used(vn, vxlan->default_dst.remote_ip)) { | ||
1407 | vxlan_sock_hold(vs); | 1429 | vxlan_sock_hold(vs); |
1408 | dev_hold(dev); | 1430 | dev_hold(dev); |
1409 | queue_work(vxlan_wq, &vxlan->igmp_work); | 1431 | queue_work(vxlan_wq, &vxlan->igmp_leave); |
1410 | } | 1432 | } |
1411 | 1433 | ||
1412 | del_timer_sync(&vxlan->age_timer); | 1434 | del_timer_sync(&vxlan->age_timer); |
@@ -1471,7 +1493,8 @@ static void vxlan_setup(struct net_device *dev) | |||
1471 | 1493 | ||
1472 | INIT_LIST_HEAD(&vxlan->next); | 1494 | INIT_LIST_HEAD(&vxlan->next); |
1473 | spin_lock_init(&vxlan->hash_lock); | 1495 | spin_lock_init(&vxlan->hash_lock); |
1474 | INIT_WORK(&vxlan->igmp_work, vxlan_igmp_work); | 1496 | INIT_WORK(&vxlan->igmp_join, vxlan_igmp_join); |
1497 | INIT_WORK(&vxlan->igmp_leave, vxlan_igmp_leave); | ||
1475 | INIT_WORK(&vxlan->sock_work, vxlan_sock_work); | 1498 | INIT_WORK(&vxlan->sock_work, vxlan_sock_work); |
1476 | 1499 | ||
1477 | init_timer_deferrable(&vxlan->age_timer); | 1500 | init_timer_deferrable(&vxlan->age_timer); |
@@ -1878,10 +1901,12 @@ static __net_exit void vxlan_exit_net(struct net *net) | |||
1878 | { | 1901 | { |
1879 | struct vxlan_net *vn = net_generic(net, vxlan_net_id); | 1902 | struct vxlan_net *vn = net_generic(net, vxlan_net_id); |
1880 | struct vxlan_dev *vxlan; | 1903 | struct vxlan_dev *vxlan; |
1904 | LIST_HEAD(list); | ||
1881 | 1905 | ||
1882 | rtnl_lock(); | 1906 | rtnl_lock(); |
1883 | list_for_each_entry(vxlan, &vn->vxlan_list, next) | 1907 | list_for_each_entry(vxlan, &vn->vxlan_list, next) |
1884 | dev_close(vxlan->dev); | 1908 | unregister_netdevice_queue(vxlan->dev, &list); |
1909 | unregister_netdevice_many(&list); | ||
1885 | rtnl_unlock(); | 1910 | rtnl_unlock(); |
1886 | } | 1911 | } |
1887 | 1912 | ||
diff --git a/drivers/net/wireless/ath/ath5k/mac80211-ops.c b/drivers/net/wireless/ath/ath5k/mac80211-ops.c index 81b686c6a376..40825d43322e 100644 --- a/drivers/net/wireless/ath/ath5k/mac80211-ops.c +++ b/drivers/net/wireless/ath/ath5k/mac80211-ops.c | |||
@@ -325,7 +325,7 @@ ath5k_prepare_multicast(struct ieee80211_hw *hw, | |||
325 | struct netdev_hw_addr *ha; | 325 | struct netdev_hw_addr *ha; |
326 | 326 | ||
327 | mfilt[0] = 0; | 327 | mfilt[0] = 0; |
328 | mfilt[1] = 1; | 328 | mfilt[1] = 0; |
329 | 329 | ||
330 | netdev_hw_addr_list_for_each(ha, mc_list) { | 330 | netdev_hw_addr_list_for_each(ha, mc_list) { |
331 | /* calculate XOR of eight 6-bit values */ | 331 | /* calculate XOR of eight 6-bit values */ |
diff --git a/drivers/net/wireless/ath/ath9k/ar5008_phy.c b/drivers/net/wireless/ath/ath9k/ar5008_phy.c index d1acfe98918a..1576d58291d4 100644 --- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c +++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c | |||
@@ -610,7 +610,15 @@ static void ar5008_hw_override_ini(struct ath_hw *ah, | |||
610 | REG_SET_BIT(ah, AR_DIAG_SW, (AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT)); | 610 | REG_SET_BIT(ah, AR_DIAG_SW, (AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT)); |
611 | 611 | ||
612 | if (AR_SREV_9280_20_OR_LATER(ah)) { | 612 | if (AR_SREV_9280_20_OR_LATER(ah)) { |
613 | val = REG_READ(ah, AR_PCU_MISC_MODE2); | 613 | /* |
614 | * For AR9280 and above, there is a new feature that allows | ||
615 | * Multicast search based on both MAC Address and Key ID. | ||
616 | * By default, this feature is enabled. But since the driver | ||
617 | * is not using this feature, we switch it off; otherwise | ||
618 | * multicast search based on MAC addr only will fail. | ||
619 | */ | ||
620 | val = REG_READ(ah, AR_PCU_MISC_MODE2) & | ||
621 | (~AR_ADHOC_MCAST_KEYID_ENABLE); | ||
614 | 622 | ||
615 | if (!AR_SREV_9271(ah)) | 623 | if (!AR_SREV_9271(ah)) |
616 | val &= ~AR_PCU_MISC_MODE2_HWWAR1; | 624 | val &= ~AR_PCU_MISC_MODE2_HWWAR1; |
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c index 9e582e14da74..5205a3625e84 100644 --- a/drivers/net/wireless/ath/ath9k/hif_usb.c +++ b/drivers/net/wireless/ath/ath9k/hif_usb.c | |||
@@ -1082,7 +1082,7 @@ static void ath9k_hif_usb_firmware_fail(struct hif_device_usb *hif_dev) | |||
1082 | struct device *dev = &hif_dev->udev->dev; | 1082 | struct device *dev = &hif_dev->udev->dev; |
1083 | struct device *parent = dev->parent; | 1083 | struct device *parent = dev->parent; |
1084 | 1084 | ||
1085 | complete(&hif_dev->fw_done); | 1085 | complete_all(&hif_dev->fw_done); |
1086 | 1086 | ||
1087 | if (parent) | 1087 | if (parent) |
1088 | device_lock(parent); | 1088 | device_lock(parent); |
@@ -1131,7 +1131,7 @@ static void ath9k_hif_usb_firmware_cb(const struct firmware *fw, void *context) | |||
1131 | 1131 | ||
1132 | release_firmware(fw); | 1132 | release_firmware(fw); |
1133 | hif_dev->flags |= HIF_USB_READY; | 1133 | hif_dev->flags |= HIF_USB_READY; |
1134 | complete(&hif_dev->fw_done); | 1134 | complete_all(&hif_dev->fw_done); |
1135 | 1135 | ||
1136 | return; | 1136 | return; |
1137 | 1137 | ||
@@ -1295,7 +1295,9 @@ static void ath9k_hif_usb_disconnect(struct usb_interface *interface) | |||
1295 | 1295 | ||
1296 | usb_set_intfdata(interface, NULL); | 1296 | usb_set_intfdata(interface, NULL); |
1297 | 1297 | ||
1298 | if (!unplugged && (hif_dev->flags & HIF_USB_START)) | 1298 | /* If firmware was loaded we should drop it |
1299 | * go back to first stage bootloader. */ | ||
1300 | if (!unplugged && (hif_dev->flags & HIF_USB_READY)) | ||
1299 | ath9k_hif_usb_reboot(udev); | 1301 | ath9k_hif_usb_reboot(udev); |
1300 | 1302 | ||
1301 | kfree(hif_dev); | 1303 | kfree(hif_dev); |
@@ -1316,7 +1318,10 @@ static int ath9k_hif_usb_suspend(struct usb_interface *interface, | |||
1316 | if (!(hif_dev->flags & HIF_USB_START)) | 1318 | if (!(hif_dev->flags & HIF_USB_START)) |
1317 | ath9k_htc_suspend(hif_dev->htc_handle); | 1319 | ath9k_htc_suspend(hif_dev->htc_handle); |
1318 | 1320 | ||
1319 | ath9k_hif_usb_dealloc_urbs(hif_dev); | 1321 | wait_for_completion(&hif_dev->fw_done); |
1322 | |||
1323 | if (hif_dev->flags & HIF_USB_READY) | ||
1324 | ath9k_hif_usb_dealloc_urbs(hif_dev); | ||
1320 | 1325 | ||
1321 | return 0; | 1326 | return 0; |
1322 | } | 1327 | } |
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c index 71a183ffc77f..c3676bf1d6c4 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c | |||
@@ -861,6 +861,7 @@ static int ath9k_init_device(struct ath9k_htc_priv *priv, | |||
861 | if (error != 0) | 861 | if (error != 0) |
862 | goto err_rx; | 862 | goto err_rx; |
863 | 863 | ||
864 | ath9k_hw_disable(priv->ah); | ||
864 | #ifdef CONFIG_MAC80211_LEDS | 865 | #ifdef CONFIG_MAC80211_LEDS |
865 | /* must be initialized before ieee80211_register_hw */ | 866 | /* must be initialized before ieee80211_register_hw */ |
866 | priv->led_cdev.default_trigger = ieee80211_create_tpt_led_trigger(priv->hw, | 867 | priv->led_cdev.default_trigger = ieee80211_create_tpt_led_trigger(priv->hw, |
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index c59ae43b9b35..927992732620 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c | |||
@@ -146,6 +146,28 @@ static void ath_set_rates(struct ieee80211_vif *vif, struct ieee80211_sta *sta, | |||
146 | ARRAY_SIZE(bf->rates)); | 146 | ARRAY_SIZE(bf->rates)); |
147 | } | 147 | } |
148 | 148 | ||
149 | static void ath_txq_skb_done(struct ath_softc *sc, struct ath_txq *txq, | ||
150 | struct sk_buff *skb) | ||
151 | { | ||
152 | int q; | ||
153 | |||
154 | q = skb_get_queue_mapping(skb); | ||
155 | if (txq == sc->tx.uapsdq) | ||
156 | txq = sc->tx.txq_map[q]; | ||
157 | |||
158 | if (txq != sc->tx.txq_map[q]) | ||
159 | return; | ||
160 | |||
161 | if (WARN_ON(--txq->pending_frames < 0)) | ||
162 | txq->pending_frames = 0; | ||
163 | |||
164 | if (txq->stopped && | ||
165 | txq->pending_frames < sc->tx.txq_max_pending[q]) { | ||
166 | ieee80211_wake_queue(sc->hw, q); | ||
167 | txq->stopped = false; | ||
168 | } | ||
169 | } | ||
170 | |||
149 | static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid) | 171 | static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid) |
150 | { | 172 | { |
151 | struct ath_txq *txq = tid->ac->txq; | 173 | struct ath_txq *txq = tid->ac->txq; |
@@ -167,6 +189,7 @@ static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid) | |||
167 | if (!bf) { | 189 | if (!bf) { |
168 | bf = ath_tx_setup_buffer(sc, txq, tid, skb); | 190 | bf = ath_tx_setup_buffer(sc, txq, tid, skb); |
169 | if (!bf) { | 191 | if (!bf) { |
192 | ath_txq_skb_done(sc, txq, skb); | ||
170 | ieee80211_free_txskb(sc->hw, skb); | 193 | ieee80211_free_txskb(sc->hw, skb); |
171 | continue; | 194 | continue; |
172 | } | 195 | } |
@@ -811,6 +834,7 @@ ath_tx_get_tid_subframe(struct ath_softc *sc, struct ath_txq *txq, | |||
811 | 834 | ||
812 | if (!bf) { | 835 | if (!bf) { |
813 | __skb_unlink(skb, &tid->buf_q); | 836 | __skb_unlink(skb, &tid->buf_q); |
837 | ath_txq_skb_done(sc, txq, skb); | ||
814 | ieee80211_free_txskb(sc->hw, skb); | 838 | ieee80211_free_txskb(sc->hw, skb); |
815 | continue; | 839 | continue; |
816 | } | 840 | } |
@@ -1824,6 +1848,7 @@ static void ath_tx_send_ampdu(struct ath_softc *sc, struct ath_txq *txq, | |||
1824 | 1848 | ||
1825 | bf = ath_tx_setup_buffer(sc, txq, tid, skb); | 1849 | bf = ath_tx_setup_buffer(sc, txq, tid, skb); |
1826 | if (!bf) { | 1850 | if (!bf) { |
1851 | ath_txq_skb_done(sc, txq, skb); | ||
1827 | ieee80211_free_txskb(sc->hw, skb); | 1852 | ieee80211_free_txskb(sc->hw, skb); |
1828 | return; | 1853 | return; |
1829 | } | 1854 | } |
@@ -2090,6 +2115,7 @@ int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
2090 | 2115 | ||
2091 | bf = ath_tx_setup_buffer(sc, txq, tid, skb); | 2116 | bf = ath_tx_setup_buffer(sc, txq, tid, skb); |
2092 | if (!bf) { | 2117 | if (!bf) { |
2118 | ath_txq_skb_done(sc, txq, skb); | ||
2093 | if (txctl->paprd) | 2119 | if (txctl->paprd) |
2094 | dev_kfree_skb_any(skb); | 2120 | dev_kfree_skb_any(skb); |
2095 | else | 2121 | else |
@@ -2189,7 +2215,7 @@ static void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb, | |||
2189 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); | 2215 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); |
2190 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); | 2216 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); |
2191 | struct ieee80211_hdr * hdr = (struct ieee80211_hdr *)skb->data; | 2217 | struct ieee80211_hdr * hdr = (struct ieee80211_hdr *)skb->data; |
2192 | int q, padpos, padsize; | 2218 | int padpos, padsize; |
2193 | unsigned long flags; | 2219 | unsigned long flags; |
2194 | 2220 | ||
2195 | ath_dbg(common, XMIT, "TX complete: skb: %p\n", skb); | 2221 | ath_dbg(common, XMIT, "TX complete: skb: %p\n", skb); |
@@ -2225,21 +2251,7 @@ static void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb, | |||
2225 | spin_unlock_irqrestore(&sc->sc_pm_lock, flags); | 2251 | spin_unlock_irqrestore(&sc->sc_pm_lock, flags); |
2226 | 2252 | ||
2227 | __skb_queue_tail(&txq->complete_q, skb); | 2253 | __skb_queue_tail(&txq->complete_q, skb); |
2228 | 2254 | ath_txq_skb_done(sc, txq, skb); | |
2229 | q = skb_get_queue_mapping(skb); | ||
2230 | if (txq == sc->tx.uapsdq) | ||
2231 | txq = sc->tx.txq_map[q]; | ||
2232 | |||
2233 | if (txq == sc->tx.txq_map[q]) { | ||
2234 | if (WARN_ON(--txq->pending_frames < 0)) | ||
2235 | txq->pending_frames = 0; | ||
2236 | |||
2237 | if (txq->stopped && | ||
2238 | txq->pending_frames < sc->tx.txq_max_pending[q]) { | ||
2239 | ieee80211_wake_queue(sc->hw, q); | ||
2240 | txq->stopped = false; | ||
2241 | } | ||
2242 | } | ||
2243 | } | 2255 | } |
2244 | 2256 | ||
2245 | static void ath_tx_complete_buf(struct ath_softc *sc, struct ath_buf *bf, | 2257 | static void ath_tx_complete_buf(struct ath_softc *sc, struct ath_buf *bf, |
diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c b/drivers/net/wireless/ath/wil6210/debugfs.c index e8308ec30970..ab636767fbde 100644 --- a/drivers/net/wireless/ath/wil6210/debugfs.c +++ b/drivers/net/wireless/ath/wil6210/debugfs.c | |||
@@ -145,7 +145,7 @@ static void wil_print_ring(struct seq_file *s, const char *prefix, | |||
145 | le16_to_cpu(hdr.type), hdr.flags); | 145 | le16_to_cpu(hdr.type), hdr.flags); |
146 | if (len <= MAX_MBOXITEM_SIZE) { | 146 | if (len <= MAX_MBOXITEM_SIZE) { |
147 | int n = 0; | 147 | int n = 0; |
148 | unsigned char printbuf[16 * 3 + 2]; | 148 | char printbuf[16 * 3 + 2]; |
149 | unsigned char databuf[MAX_MBOXITEM_SIZE]; | 149 | unsigned char databuf[MAX_MBOXITEM_SIZE]; |
150 | void __iomem *src = wmi_buffer(wil, d.addr) + | 150 | void __iomem *src = wmi_buffer(wil, d.addr) + |
151 | sizeof(struct wil6210_mbox_hdr); | 151 | sizeof(struct wil6210_mbox_hdr); |
@@ -416,7 +416,7 @@ static int wil_txdesc_debugfs_show(struct seq_file *s, void *data) | |||
416 | seq_printf(s, " SKB = %p\n", skb); | 416 | seq_printf(s, " SKB = %p\n", skb); |
417 | 417 | ||
418 | if (skb) { | 418 | if (skb) { |
419 | unsigned char printbuf[16 * 3 + 2]; | 419 | char printbuf[16 * 3 + 2]; |
420 | int i = 0; | 420 | int i = 0; |
421 | int len = le16_to_cpu(d->dma.length); | 421 | int len = le16_to_cpu(d->dma.length); |
422 | void *p = skb->data; | 422 | void *p = skb->data; |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c index 8e8975562ec3..80099016d21f 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c | |||
@@ -242,7 +242,7 @@ void brcmf_txflowblock_if(struct brcmf_if *ifp, | |||
242 | { | 242 | { |
243 | unsigned long flags; | 243 | unsigned long flags; |
244 | 244 | ||
245 | if (!ifp) | 245 | if (!ifp || !ifp->ndev) |
246 | return; | 246 | return; |
247 | 247 | ||
248 | brcmf_dbg(TRACE, "enter: idx=%d stop=0x%X reason=%d state=%d\n", | 248 | brcmf_dbg(TRACE, "enter: idx=%d stop=0x%X reason=%d state=%d\n", |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c index f0d9f7f6c83d..29b1f24c2d0f 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c | |||
@@ -1744,13 +1744,14 @@ int brcmf_fws_process_skb(struct brcmf_if *ifp, struct sk_buff *skb) | |||
1744 | ulong flags; | 1744 | ulong flags; |
1745 | int fifo = BRCMF_FWS_FIFO_BCMC; | 1745 | int fifo = BRCMF_FWS_FIFO_BCMC; |
1746 | bool multicast = is_multicast_ether_addr(eh->h_dest); | 1746 | bool multicast = is_multicast_ether_addr(eh->h_dest); |
1747 | bool pae = eh->h_proto == htons(ETH_P_PAE); | ||
1747 | 1748 | ||
1748 | /* determine the priority */ | 1749 | /* determine the priority */ |
1749 | if (!skb->priority) | 1750 | if (!skb->priority) |
1750 | skb->priority = cfg80211_classify8021d(skb); | 1751 | skb->priority = cfg80211_classify8021d(skb); |
1751 | 1752 | ||
1752 | drvr->tx_multicast += !!multicast; | 1753 | drvr->tx_multicast += !!multicast; |
1753 | if (ntohs(eh->h_proto) == ETH_P_PAE) | 1754 | if (pae) |
1754 | atomic_inc(&ifp->pend_8021x_cnt); | 1755 | atomic_inc(&ifp->pend_8021x_cnt); |
1755 | 1756 | ||
1756 | if (!brcmf_fws_fc_active(fws)) { | 1757 | if (!brcmf_fws_fc_active(fws)) { |
@@ -1781,6 +1782,11 @@ int brcmf_fws_process_skb(struct brcmf_if *ifp, struct sk_buff *skb) | |||
1781 | brcmf_fws_schedule_deq(fws); | 1782 | brcmf_fws_schedule_deq(fws); |
1782 | } else { | 1783 | } else { |
1783 | brcmf_err("drop skb: no hanger slot\n"); | 1784 | brcmf_err("drop skb: no hanger slot\n"); |
1785 | if (pae) { | ||
1786 | atomic_dec(&ifp->pend_8021x_cnt); | ||
1787 | if (waitqueue_active(&ifp->pend_8021x_wait)) | ||
1788 | wake_up(&ifp->pend_8021x_wait); | ||
1789 | } | ||
1784 | brcmu_pkt_buf_free_skb(skb); | 1790 | brcmu_pkt_buf_free_skb(skb); |
1785 | } | 1791 | } |
1786 | brcmf_fws_unlock(drvr, flags); | 1792 | brcmf_fws_unlock(drvr, flags); |
diff --git a/drivers/net/wireless/cw1200/txrx.c b/drivers/net/wireless/cw1200/txrx.c index 5862c373d714..e824d4d4a18d 100644 --- a/drivers/net/wireless/cw1200/txrx.c +++ b/drivers/net/wireless/cw1200/txrx.c | |||
@@ -1165,7 +1165,7 @@ void cw1200_rx_cb(struct cw1200_common *priv, | |||
1165 | if (cw1200_handle_action_rx(priv, skb)) | 1165 | if (cw1200_handle_action_rx(priv, skb)) |
1166 | return; | 1166 | return; |
1167 | } else if (ieee80211_is_beacon(frame->frame_control) && | 1167 | } else if (ieee80211_is_beacon(frame->frame_control) && |
1168 | !arg->status && | 1168 | !arg->status && priv->vif && |
1169 | !memcmp(ieee80211_get_SA(frame), priv->vif->bss_conf.bssid, | 1169 | !memcmp(ieee80211_get_SA(frame), priv->vif->bss_conf.bssid, |
1170 | ETH_ALEN)) { | 1170 | ETH_ALEN)) { |
1171 | const u8 *tim_ie; | 1171 | const u8 *tim_ie; |
diff --git a/drivers/net/wireless/iwlwifi/dvm/main.c b/drivers/net/wireless/iwlwifi/dvm/main.c index 3952ddf2ddb2..1531a4fc0960 100644 --- a/drivers/net/wireless/iwlwifi/dvm/main.c +++ b/drivers/net/wireless/iwlwifi/dvm/main.c | |||
@@ -758,7 +758,7 @@ int iwl_alive_start(struct iwl_priv *priv) | |||
758 | BT_COEX_PRIO_TBL_EVT_INIT_CALIB2); | 758 | BT_COEX_PRIO_TBL_EVT_INIT_CALIB2); |
759 | if (ret) | 759 | if (ret) |
760 | return ret; | 760 | return ret; |
761 | } else { | 761 | } else if (priv->lib->bt_params) { |
762 | /* | 762 | /* |
763 | * default is 2-wire BT coexexistence support | 763 | * default is 2-wire BT coexexistence support |
764 | */ | 764 | */ |
diff --git a/drivers/net/wireless/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/iwlwifi/mvm/debugfs.c index e56ed2a84888..c24a744910ac 100644 --- a/drivers/net/wireless/iwlwifi/mvm/debugfs.c +++ b/drivers/net/wireless/iwlwifi/mvm/debugfs.c | |||
@@ -988,7 +988,11 @@ void iwl_mvm_vif_dbgfs_register(struct iwl_mvm *mvm, struct ieee80211_vif *vif) | |||
988 | struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); | 988 | struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); |
989 | char buf[100]; | 989 | char buf[100]; |
990 | 990 | ||
991 | if (!dbgfs_dir) | 991 | /* |
992 | * Check if debugfs directory already exist before creating it. | ||
993 | * This may happen when, for example, resetting hw or suspend-resume | ||
994 | */ | ||
995 | if (!dbgfs_dir || mvmvif->dbgfs_dir) | ||
992 | return; | 996 | return; |
993 | 997 | ||
994 | mvmvif->dbgfs_dir = debugfs_create_dir("iwlmvm", dbgfs_dir); | 998 | mvmvif->dbgfs_dir = debugfs_create_dir("iwlmvm", dbgfs_dir); |
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c index e08683b20531..1eedc424051c 100644 --- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c | |||
@@ -257,7 +257,11 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm) | |||
257 | if (ret) | 257 | if (ret) |
258 | return ret; | 258 | return ret; |
259 | 259 | ||
260 | return ieee80211_register_hw(mvm->hw); | 260 | ret = ieee80211_register_hw(mvm->hw); |
261 | if (ret) | ||
262 | iwl_mvm_leds_exit(mvm); | ||
263 | |||
264 | return ret; | ||
261 | } | 265 | } |
262 | 266 | ||
263 | static void iwl_mvm_mac_tx(struct ieee80211_hw *hw, | 267 | static void iwl_mvm_mac_tx(struct ieee80211_hw *hw, |
@@ -385,6 +389,7 @@ static void iwl_mvm_restart_cleanup(struct iwl_mvm *mvm) | |||
385 | ieee80211_wake_queues(mvm->hw); | 389 | ieee80211_wake_queues(mvm->hw); |
386 | 390 | ||
387 | mvm->vif_count = 0; | 391 | mvm->vif_count = 0; |
392 | mvm->rx_ba_sessions = 0; | ||
388 | } | 393 | } |
389 | 394 | ||
390 | static int iwl_mvm_mac_start(struct ieee80211_hw *hw) | 395 | static int iwl_mvm_mac_start(struct ieee80211_hw *hw) |
@@ -1006,6 +1011,21 @@ static int iwl_mvm_mac_sta_state(struct ieee80211_hw *hw, | |||
1006 | mutex_lock(&mvm->mutex); | 1011 | mutex_lock(&mvm->mutex); |
1007 | if (old_state == IEEE80211_STA_NOTEXIST && | 1012 | if (old_state == IEEE80211_STA_NOTEXIST && |
1008 | new_state == IEEE80211_STA_NONE) { | 1013 | new_state == IEEE80211_STA_NONE) { |
1014 | /* | ||
1015 | * Firmware bug - it'll crash if the beacon interval is less | ||
1016 | * than 16. We can't avoid connecting at all, so refuse the | ||
1017 | * station state change, this will cause mac80211 to abandon | ||
1018 | * attempts to connect to this AP, and eventually wpa_s will | ||
1019 | * blacklist the AP... | ||
1020 | */ | ||
1021 | if (vif->type == NL80211_IFTYPE_STATION && | ||
1022 | vif->bss_conf.beacon_int < 16) { | ||
1023 | IWL_ERR(mvm, | ||
1024 | "AP %pM beacon interval is %d, refusing due to firmware bug!\n", | ||
1025 | sta->addr, vif->bss_conf.beacon_int); | ||
1026 | ret = -EINVAL; | ||
1027 | goto out_unlock; | ||
1028 | } | ||
1009 | ret = iwl_mvm_add_sta(mvm, vif, sta); | 1029 | ret = iwl_mvm_add_sta(mvm, vif, sta); |
1010 | } else if (old_state == IEEE80211_STA_NONE && | 1030 | } else if (old_state == IEEE80211_STA_NONE && |
1011 | new_state == IEEE80211_STA_AUTH) { | 1031 | new_state == IEEE80211_STA_AUTH) { |
@@ -1038,6 +1058,7 @@ static int iwl_mvm_mac_sta_state(struct ieee80211_hw *hw, | |||
1038 | } else { | 1058 | } else { |
1039 | ret = -EIO; | 1059 | ret = -EIO; |
1040 | } | 1060 | } |
1061 | out_unlock: | ||
1041 | mutex_unlock(&mvm->mutex); | 1062 | mutex_unlock(&mvm->mutex); |
1042 | 1063 | ||
1043 | return ret; | 1064 | return ret; |
diff --git a/drivers/net/wireless/iwlwifi/mvm/mvm.h b/drivers/net/wireless/iwlwifi/mvm/mvm.h index d40d7db185d6..420e82d379d9 100644 --- a/drivers/net/wireless/iwlwifi/mvm/mvm.h +++ b/drivers/net/wireless/iwlwifi/mvm/mvm.h | |||
@@ -419,6 +419,7 @@ struct iwl_mvm { | |||
419 | struct work_struct sta_drained_wk; | 419 | struct work_struct sta_drained_wk; |
420 | unsigned long sta_drained[BITS_TO_LONGS(IWL_MVM_STATION_COUNT)]; | 420 | unsigned long sta_drained[BITS_TO_LONGS(IWL_MVM_STATION_COUNT)]; |
421 | atomic_t pending_frames[IWL_MVM_STATION_COUNT]; | 421 | atomic_t pending_frames[IWL_MVM_STATION_COUNT]; |
422 | u8 rx_ba_sessions; | ||
422 | 423 | ||
423 | /* configured by mac80211 */ | 424 | /* configured by mac80211 */ |
424 | u32 rts_threshold; | 425 | u32 rts_threshold; |
diff --git a/drivers/net/wireless/iwlwifi/mvm/scan.c b/drivers/net/wireless/iwlwifi/mvm/scan.c index 2157b0f8ced5..268f027b45b0 100644 --- a/drivers/net/wireless/iwlwifi/mvm/scan.c +++ b/drivers/net/wireless/iwlwifi/mvm/scan.c | |||
@@ -137,8 +137,8 @@ static void iwl_mvm_scan_fill_ssids(struct iwl_scan_cmd *cmd, | |||
137 | { | 137 | { |
138 | int fw_idx, req_idx; | 138 | int fw_idx, req_idx; |
139 | 139 | ||
140 | fw_idx = 0; | 140 | for (req_idx = req->n_ssids - 1, fw_idx = 0; req_idx > 0; |
141 | for (req_idx = req->n_ssids - 1; req_idx > 0; req_idx--) { | 141 | req_idx--, fw_idx++) { |
142 | cmd->direct_scan[fw_idx].id = WLAN_EID_SSID; | 142 | cmd->direct_scan[fw_idx].id = WLAN_EID_SSID; |
143 | cmd->direct_scan[fw_idx].len = req->ssids[req_idx].ssid_len; | 143 | cmd->direct_scan[fw_idx].len = req->ssids[req_idx].ssid_len; |
144 | memcpy(cmd->direct_scan[fw_idx].ssid, | 144 | memcpy(cmd->direct_scan[fw_idx].ssid, |
@@ -153,7 +153,9 @@ static void iwl_mvm_scan_fill_ssids(struct iwl_scan_cmd *cmd, | |||
153 | * just to notify that this scan is active and not passive. | 153 | * just to notify that this scan is active and not passive. |
154 | * In order to notify the FW of the number of SSIDs we wish to scan (including | 154 | * In order to notify the FW of the number of SSIDs we wish to scan (including |
155 | * the zero-length one), we need to set the corresponding bits in chan->type, | 155 | * the zero-length one), we need to set the corresponding bits in chan->type, |
156 | * one for each SSID, and set the active bit (first). | 156 | * one for each SSID, and set the active bit (first). The first SSID is already |
157 | * included in the probe template, so we need to set only req->n_ssids - 1 bits | ||
158 | * in addition to the first bit. | ||
157 | */ | 159 | */ |
158 | static u16 iwl_mvm_get_active_dwell(enum ieee80211_band band, int n_ssids) | 160 | static u16 iwl_mvm_get_active_dwell(enum ieee80211_band band, int n_ssids) |
159 | { | 161 | { |
@@ -179,7 +181,7 @@ static void iwl_mvm_scan_fill_channels(struct iwl_scan_cmd *cmd, | |||
179 | __le32 chan_type_value; | 181 | __le32 chan_type_value; |
180 | 182 | ||
181 | if (req->n_ssids > 0) | 183 | if (req->n_ssids > 0) |
182 | chan_type_value = cpu_to_le32(BIT(req->n_ssids + 1) - 1); | 184 | chan_type_value = cpu_to_le32(BIT(req->n_ssids) - 1); |
183 | else | 185 | else |
184 | chan_type_value = SCAN_CHANNEL_TYPE_PASSIVE; | 186 | chan_type_value = SCAN_CHANNEL_TYPE_PASSIVE; |
185 | 187 | ||
diff --git a/drivers/net/wireless/iwlwifi/mvm/sta.c b/drivers/net/wireless/iwlwifi/mvm/sta.c index 62fe5209093b..85d4bbe52157 100644 --- a/drivers/net/wireless/iwlwifi/mvm/sta.c +++ b/drivers/net/wireless/iwlwifi/mvm/sta.c | |||
@@ -608,6 +608,8 @@ int iwl_mvm_rm_bcast_sta(struct iwl_mvm *mvm, struct iwl_mvm_int_sta *bsta) | |||
608 | return ret; | 608 | return ret; |
609 | } | 609 | } |
610 | 610 | ||
611 | #define IWL_MAX_RX_BA_SESSIONS 16 | ||
612 | |||
611 | int iwl_mvm_sta_rx_agg(struct iwl_mvm *mvm, struct ieee80211_sta *sta, | 613 | int iwl_mvm_sta_rx_agg(struct iwl_mvm *mvm, struct ieee80211_sta *sta, |
612 | int tid, u16 ssn, bool start) | 614 | int tid, u16 ssn, bool start) |
613 | { | 615 | { |
@@ -618,11 +620,20 @@ int iwl_mvm_sta_rx_agg(struct iwl_mvm *mvm, struct ieee80211_sta *sta, | |||
618 | 620 | ||
619 | lockdep_assert_held(&mvm->mutex); | 621 | lockdep_assert_held(&mvm->mutex); |
620 | 622 | ||
623 | if (start && mvm->rx_ba_sessions >= IWL_MAX_RX_BA_SESSIONS) { | ||
624 | IWL_WARN(mvm, "Not enough RX BA SESSIONS\n"); | ||
625 | return -ENOSPC; | ||
626 | } | ||
627 | |||
621 | cmd.mac_id_n_color = cpu_to_le32(mvm_sta->mac_id_n_color); | 628 | cmd.mac_id_n_color = cpu_to_le32(mvm_sta->mac_id_n_color); |
622 | cmd.sta_id = mvm_sta->sta_id; | 629 | cmd.sta_id = mvm_sta->sta_id; |
623 | cmd.add_modify = STA_MODE_MODIFY; | 630 | cmd.add_modify = STA_MODE_MODIFY; |
624 | cmd.add_immediate_ba_tid = (u8) tid; | 631 | if (start) { |
625 | cmd.add_immediate_ba_ssn = cpu_to_le16(ssn); | 632 | cmd.add_immediate_ba_tid = (u8) tid; |
633 | cmd.add_immediate_ba_ssn = cpu_to_le16(ssn); | ||
634 | } else { | ||
635 | cmd.remove_immediate_ba_tid = (u8) tid; | ||
636 | } | ||
626 | cmd.modify_mask = start ? STA_MODIFY_ADD_BA_TID : | 637 | cmd.modify_mask = start ? STA_MODIFY_ADD_BA_TID : |
627 | STA_MODIFY_REMOVE_BA_TID; | 638 | STA_MODIFY_REMOVE_BA_TID; |
628 | 639 | ||
@@ -648,6 +659,14 @@ int iwl_mvm_sta_rx_agg(struct iwl_mvm *mvm, struct ieee80211_sta *sta, | |||
648 | break; | 659 | break; |
649 | } | 660 | } |
650 | 661 | ||
662 | if (!ret) { | ||
663 | if (start) | ||
664 | mvm->rx_ba_sessions++; | ||
665 | else if (mvm->rx_ba_sessions > 0) | ||
666 | /* check that restart flow didn't zero the counter */ | ||
667 | mvm->rx_ba_sessions--; | ||
668 | } | ||
669 | |||
651 | return ret; | 670 | return ret; |
652 | } | 671 | } |
653 | 672 | ||
diff --git a/drivers/net/wireless/mwifiex/init.c b/drivers/net/wireless/mwifiex/init.c index caaf4bd56b30..2cf8b964e966 100644 --- a/drivers/net/wireless/mwifiex/init.c +++ b/drivers/net/wireless/mwifiex/init.c | |||
@@ -693,7 +693,7 @@ int mwifiex_dnld_fw(struct mwifiex_adapter *adapter, | |||
693 | if (!ret) { | 693 | if (!ret) { |
694 | dev_notice(adapter->dev, | 694 | dev_notice(adapter->dev, |
695 | "WLAN FW already running! Skip FW dnld\n"); | 695 | "WLAN FW already running! Skip FW dnld\n"); |
696 | goto done; | 696 | return 0; |
697 | } | 697 | } |
698 | 698 | ||
699 | poll_num = MAX_FIRMWARE_POLL_TRIES; | 699 | poll_num = MAX_FIRMWARE_POLL_TRIES; |
@@ -719,14 +719,8 @@ int mwifiex_dnld_fw(struct mwifiex_adapter *adapter, | |||
719 | poll_fw: | 719 | poll_fw: |
720 | /* Check if the firmware is downloaded successfully or not */ | 720 | /* Check if the firmware is downloaded successfully or not */ |
721 | ret = adapter->if_ops.check_fw_status(adapter, poll_num); | 721 | ret = adapter->if_ops.check_fw_status(adapter, poll_num); |
722 | if (ret) { | 722 | if (ret) |
723 | dev_err(adapter->dev, "FW failed to be active in time\n"); | 723 | dev_err(adapter->dev, "FW failed to be active in time\n"); |
724 | return -1; | ||
725 | } | ||
726 | done: | ||
727 | /* re-enable host interrupt for mwifiex after fw dnld is successful */ | ||
728 | if (adapter->if_ops.enable_int) | ||
729 | adapter->if_ops.enable_int(adapter); | ||
730 | 724 | ||
731 | return ret; | 725 | return ret; |
732 | } | 726 | } |
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c index e15ab72fb03d..1753431de361 100644 --- a/drivers/net/wireless/mwifiex/main.c +++ b/drivers/net/wireless/mwifiex/main.c | |||
@@ -427,6 +427,10 @@ static void mwifiex_fw_dpc(const struct firmware *firmware, void *context) | |||
427 | "Cal data request_firmware() failed\n"); | 427 | "Cal data request_firmware() failed\n"); |
428 | } | 428 | } |
429 | 429 | ||
430 | /* enable host interrupt after fw dnld is successful */ | ||
431 | if (adapter->if_ops.enable_int) | ||
432 | adapter->if_ops.enable_int(adapter); | ||
433 | |||
430 | adapter->init_wait_q_woken = false; | 434 | adapter->init_wait_q_woken = false; |
431 | ret = mwifiex_init_fw(adapter); | 435 | ret = mwifiex_init_fw(adapter); |
432 | if (ret == -1) { | 436 | if (ret == -1) { |
@@ -478,6 +482,8 @@ err_add_intf: | |||
478 | mwifiex_del_virtual_intf(adapter->wiphy, priv->wdev); | 482 | mwifiex_del_virtual_intf(adapter->wiphy, priv->wdev); |
479 | rtnl_unlock(); | 483 | rtnl_unlock(); |
480 | err_init_fw: | 484 | err_init_fw: |
485 | if (adapter->if_ops.disable_int) | ||
486 | adapter->if_ops.disable_int(adapter); | ||
481 | pr_debug("info: %s: unregister device\n", __func__); | 487 | pr_debug("info: %s: unregister device\n", __func__); |
482 | adapter->if_ops.unregister_dev(adapter); | 488 | adapter->if_ops.unregister_dev(adapter); |
483 | done: | 489 | done: |
@@ -855,7 +861,7 @@ mwifiex_add_card(void *card, struct semaphore *sem, | |||
855 | INIT_WORK(&adapter->main_work, mwifiex_main_work_queue); | 861 | INIT_WORK(&adapter->main_work, mwifiex_main_work_queue); |
856 | 862 | ||
857 | /* Register the device. Fill up the private data structure with relevant | 863 | /* Register the device. Fill up the private data structure with relevant |
858 | information from the card and request for the required IRQ. */ | 864 | information from the card. */ |
859 | if (adapter->if_ops.register_dev(adapter)) { | 865 | if (adapter->if_ops.register_dev(adapter)) { |
860 | pr_err("%s: failed to register mwifiex device\n", __func__); | 866 | pr_err("%s: failed to register mwifiex device\n", __func__); |
861 | goto err_registerdev; | 867 | goto err_registerdev; |
@@ -919,6 +925,11 @@ int mwifiex_remove_card(struct mwifiex_adapter *adapter, struct semaphore *sem) | |||
919 | if (!adapter) | 925 | if (!adapter) |
920 | goto exit_remove; | 926 | goto exit_remove; |
921 | 927 | ||
928 | /* We can no longer handle interrupts once we start doing the teardown | ||
929 | * below. */ | ||
930 | if (adapter->if_ops.disable_int) | ||
931 | adapter->if_ops.disable_int(adapter); | ||
932 | |||
922 | adapter->surprise_removed = true; | 933 | adapter->surprise_removed = true; |
923 | 934 | ||
924 | /* Stop data */ | 935 | /* Stop data */ |
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h index 3da73d36acdf..253e0bd38e25 100644 --- a/drivers/net/wireless/mwifiex/main.h +++ b/drivers/net/wireless/mwifiex/main.h | |||
@@ -601,6 +601,7 @@ struct mwifiex_if_ops { | |||
601 | int (*register_dev) (struct mwifiex_adapter *); | 601 | int (*register_dev) (struct mwifiex_adapter *); |
602 | void (*unregister_dev) (struct mwifiex_adapter *); | 602 | void (*unregister_dev) (struct mwifiex_adapter *); |
603 | int (*enable_int) (struct mwifiex_adapter *); | 603 | int (*enable_int) (struct mwifiex_adapter *); |
604 | void (*disable_int) (struct mwifiex_adapter *); | ||
604 | int (*process_int_status) (struct mwifiex_adapter *); | 605 | int (*process_int_status) (struct mwifiex_adapter *); |
605 | int (*host_to_card) (struct mwifiex_adapter *, u8, struct sk_buff *, | 606 | int (*host_to_card) (struct mwifiex_adapter *, u8, struct sk_buff *, |
606 | struct mwifiex_tx_param *); | 607 | struct mwifiex_tx_param *); |
diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c index 5ee5ed02eccd..5ef49f2e375a 100644 --- a/drivers/net/wireless/mwifiex/sdio.c +++ b/drivers/net/wireless/mwifiex/sdio.c | |||
@@ -51,6 +51,7 @@ static struct mwifiex_if_ops sdio_ops; | |||
51 | static struct semaphore add_remove_card_sem; | 51 | static struct semaphore add_remove_card_sem; |
52 | 52 | ||
53 | static int mwifiex_sdio_resume(struct device *dev); | 53 | static int mwifiex_sdio_resume(struct device *dev); |
54 | static void mwifiex_sdio_interrupt(struct sdio_func *func); | ||
54 | 55 | ||
55 | /* | 56 | /* |
56 | * SDIO probe. | 57 | * SDIO probe. |
@@ -296,6 +297,15 @@ static struct sdio_driver mwifiex_sdio = { | |||
296 | } | 297 | } |
297 | }; | 298 | }; |
298 | 299 | ||
300 | /* Write data into SDIO card register. Caller claims SDIO device. */ | ||
301 | static int | ||
302 | mwifiex_write_reg_locked(struct sdio_func *func, u32 reg, u8 data) | ||
303 | { | ||
304 | int ret = -1; | ||
305 | sdio_writeb(func, data, reg, &ret); | ||
306 | return ret; | ||
307 | } | ||
308 | |||
299 | /* | 309 | /* |
300 | * This function writes data into SDIO card register. | 310 | * This function writes data into SDIO card register. |
301 | */ | 311 | */ |
@@ -303,10 +313,10 @@ static int | |||
303 | mwifiex_write_reg(struct mwifiex_adapter *adapter, u32 reg, u8 data) | 313 | mwifiex_write_reg(struct mwifiex_adapter *adapter, u32 reg, u8 data) |
304 | { | 314 | { |
305 | struct sdio_mmc_card *card = adapter->card; | 315 | struct sdio_mmc_card *card = adapter->card; |
306 | int ret = -1; | 316 | int ret; |
307 | 317 | ||
308 | sdio_claim_host(card->func); | 318 | sdio_claim_host(card->func); |
309 | sdio_writeb(card->func, data, reg, &ret); | 319 | ret = mwifiex_write_reg_locked(card->func, reg, data); |
310 | sdio_release_host(card->func); | 320 | sdio_release_host(card->func); |
311 | 321 | ||
312 | return ret; | 322 | return ret; |
@@ -685,23 +695,15 @@ mwifiex_sdio_read_fw_status(struct mwifiex_adapter *adapter, u16 *dat) | |||
685 | * The host interrupt mask is read, the disable bit is reset and | 695 | * The host interrupt mask is read, the disable bit is reset and |
686 | * written back to the card host interrupt mask register. | 696 | * written back to the card host interrupt mask register. |
687 | */ | 697 | */ |
688 | static int mwifiex_sdio_disable_host_int(struct mwifiex_adapter *adapter) | 698 | static void mwifiex_sdio_disable_host_int(struct mwifiex_adapter *adapter) |
689 | { | 699 | { |
690 | u8 host_int_mask, host_int_disable = HOST_INT_DISABLE; | 700 | struct sdio_mmc_card *card = adapter->card; |
691 | 701 | struct sdio_func *func = card->func; | |
692 | /* Read back the host_int_mask register */ | ||
693 | if (mwifiex_read_reg(adapter, HOST_INT_MASK_REG, &host_int_mask)) | ||
694 | return -1; | ||
695 | |||
696 | /* Update with the mask and write back to the register */ | ||
697 | host_int_mask &= ~host_int_disable; | ||
698 | |||
699 | if (mwifiex_write_reg(adapter, HOST_INT_MASK_REG, host_int_mask)) { | ||
700 | dev_err(adapter->dev, "disable host interrupt failed\n"); | ||
701 | return -1; | ||
702 | } | ||
703 | 702 | ||
704 | return 0; | 703 | sdio_claim_host(func); |
704 | mwifiex_write_reg_locked(func, HOST_INT_MASK_REG, 0); | ||
705 | sdio_release_irq(func); | ||
706 | sdio_release_host(func); | ||
705 | } | 707 | } |
706 | 708 | ||
707 | /* | 709 | /* |
@@ -713,14 +715,29 @@ static int mwifiex_sdio_disable_host_int(struct mwifiex_adapter *adapter) | |||
713 | static int mwifiex_sdio_enable_host_int(struct mwifiex_adapter *adapter) | 715 | static int mwifiex_sdio_enable_host_int(struct mwifiex_adapter *adapter) |
714 | { | 716 | { |
715 | struct sdio_mmc_card *card = adapter->card; | 717 | struct sdio_mmc_card *card = adapter->card; |
718 | struct sdio_func *func = card->func; | ||
719 | int ret; | ||
720 | |||
721 | sdio_claim_host(func); | ||
722 | |||
723 | /* Request the SDIO IRQ */ | ||
724 | ret = sdio_claim_irq(func, mwifiex_sdio_interrupt); | ||
725 | if (ret) { | ||
726 | dev_err(adapter->dev, "claim irq failed: ret=%d\n", ret); | ||
727 | goto out; | ||
728 | } | ||
716 | 729 | ||
717 | /* Simply write the mask to the register */ | 730 | /* Simply write the mask to the register */ |
718 | if (mwifiex_write_reg(adapter, HOST_INT_MASK_REG, | 731 | ret = mwifiex_write_reg_locked(func, HOST_INT_MASK_REG, |
719 | card->reg->host_int_enable)) { | 732 | card->reg->host_int_enable); |
733 | if (ret) { | ||
720 | dev_err(adapter->dev, "enable host interrupt failed\n"); | 734 | dev_err(adapter->dev, "enable host interrupt failed\n"); |
721 | return -1; | 735 | sdio_release_irq(func); |
722 | } | 736 | } |
723 | return 0; | 737 | |
738 | out: | ||
739 | sdio_release_host(func); | ||
740 | return ret; | ||
724 | } | 741 | } |
725 | 742 | ||
726 | /* | 743 | /* |
@@ -997,9 +1014,6 @@ mwifiex_sdio_interrupt(struct sdio_func *func) | |||
997 | } | 1014 | } |
998 | adapter = card->adapter; | 1015 | adapter = card->adapter; |
999 | 1016 | ||
1000 | if (adapter->surprise_removed) | ||
1001 | return; | ||
1002 | |||
1003 | if (!adapter->pps_uapsd_mode && adapter->ps_state == PS_STATE_SLEEP) | 1017 | if (!adapter->pps_uapsd_mode && adapter->ps_state == PS_STATE_SLEEP) |
1004 | adapter->ps_state = PS_STATE_AWAKE; | 1018 | adapter->ps_state = PS_STATE_AWAKE; |
1005 | 1019 | ||
@@ -1728,9 +1742,7 @@ mwifiex_unregister_dev(struct mwifiex_adapter *adapter) | |||
1728 | struct sdio_mmc_card *card = adapter->card; | 1742 | struct sdio_mmc_card *card = adapter->card; |
1729 | 1743 | ||
1730 | if (adapter->card) { | 1744 | if (adapter->card) { |
1731 | /* Release the SDIO IRQ */ | ||
1732 | sdio_claim_host(card->func); | 1745 | sdio_claim_host(card->func); |
1733 | sdio_release_irq(card->func); | ||
1734 | sdio_disable_func(card->func); | 1746 | sdio_disable_func(card->func); |
1735 | sdio_release_host(card->func); | 1747 | sdio_release_host(card->func); |
1736 | sdio_set_drvdata(card->func, NULL); | 1748 | sdio_set_drvdata(card->func, NULL); |
@@ -1744,7 +1756,7 @@ mwifiex_unregister_dev(struct mwifiex_adapter *adapter) | |||
1744 | */ | 1756 | */ |
1745 | static int mwifiex_register_dev(struct mwifiex_adapter *adapter) | 1757 | static int mwifiex_register_dev(struct mwifiex_adapter *adapter) |
1746 | { | 1758 | { |
1747 | int ret = 0; | 1759 | int ret; |
1748 | struct sdio_mmc_card *card = adapter->card; | 1760 | struct sdio_mmc_card *card = adapter->card; |
1749 | struct sdio_func *func = card->func; | 1761 | struct sdio_func *func = card->func; |
1750 | 1762 | ||
@@ -1753,22 +1765,14 @@ static int mwifiex_register_dev(struct mwifiex_adapter *adapter) | |||
1753 | 1765 | ||
1754 | sdio_claim_host(func); | 1766 | sdio_claim_host(func); |
1755 | 1767 | ||
1756 | /* Request the SDIO IRQ */ | ||
1757 | ret = sdio_claim_irq(func, mwifiex_sdio_interrupt); | ||
1758 | if (ret) { | ||
1759 | pr_err("claim irq failed: ret=%d\n", ret); | ||
1760 | goto disable_func; | ||
1761 | } | ||
1762 | |||
1763 | /* Set block size */ | 1768 | /* Set block size */ |
1764 | ret = sdio_set_block_size(card->func, MWIFIEX_SDIO_BLOCK_SIZE); | 1769 | ret = sdio_set_block_size(card->func, MWIFIEX_SDIO_BLOCK_SIZE); |
1770 | sdio_release_host(func); | ||
1765 | if (ret) { | 1771 | if (ret) { |
1766 | pr_err("cannot set SDIO block size\n"); | 1772 | pr_err("cannot set SDIO block size\n"); |
1767 | ret = -1; | 1773 | return ret; |
1768 | goto release_irq; | ||
1769 | } | 1774 | } |
1770 | 1775 | ||
1771 | sdio_release_host(func); | ||
1772 | sdio_set_drvdata(func, card); | 1776 | sdio_set_drvdata(func, card); |
1773 | 1777 | ||
1774 | adapter->dev = &func->dev; | 1778 | adapter->dev = &func->dev; |
@@ -1776,15 +1780,6 @@ static int mwifiex_register_dev(struct mwifiex_adapter *adapter) | |||
1776 | strcpy(adapter->fw_name, card->firmware); | 1780 | strcpy(adapter->fw_name, card->firmware); |
1777 | 1781 | ||
1778 | return 0; | 1782 | return 0; |
1779 | |||
1780 | release_irq: | ||
1781 | sdio_release_irq(func); | ||
1782 | disable_func: | ||
1783 | sdio_disable_func(func); | ||
1784 | sdio_release_host(func); | ||
1785 | adapter->card = NULL; | ||
1786 | |||
1787 | return -1; | ||
1788 | } | 1783 | } |
1789 | 1784 | ||
1790 | /* | 1785 | /* |
@@ -1813,9 +1808,6 @@ static int mwifiex_init_sdio(struct mwifiex_adapter *adapter) | |||
1813 | */ | 1808 | */ |
1814 | mwifiex_read_reg(adapter, HOST_INTSTATUS_REG, &sdio_ireg); | 1809 | mwifiex_read_reg(adapter, HOST_INTSTATUS_REG, &sdio_ireg); |
1815 | 1810 | ||
1816 | /* Disable host interrupt mask register for SDIO */ | ||
1817 | mwifiex_sdio_disable_host_int(adapter); | ||
1818 | |||
1819 | /* Get SDIO ioport */ | 1811 | /* Get SDIO ioport */ |
1820 | mwifiex_init_sdio_ioport(adapter); | 1812 | mwifiex_init_sdio_ioport(adapter); |
1821 | 1813 | ||
@@ -1957,6 +1949,7 @@ static struct mwifiex_if_ops sdio_ops = { | |||
1957 | .register_dev = mwifiex_register_dev, | 1949 | .register_dev = mwifiex_register_dev, |
1958 | .unregister_dev = mwifiex_unregister_dev, | 1950 | .unregister_dev = mwifiex_unregister_dev, |
1959 | .enable_int = mwifiex_sdio_enable_host_int, | 1951 | .enable_int = mwifiex_sdio_enable_host_int, |
1952 | .disable_int = mwifiex_sdio_disable_host_int, | ||
1960 | .process_int_status = mwifiex_process_int_status, | 1953 | .process_int_status = mwifiex_process_int_status, |
1961 | .host_to_card = mwifiex_sdio_host_to_card, | 1954 | .host_to_card = mwifiex_sdio_host_to_card, |
1962 | .wakeup = mwifiex_pm_wakeup_card, | 1955 | .wakeup = mwifiex_pm_wakeup_card, |
diff --git a/drivers/net/wireless/mwifiex/sdio.h b/drivers/net/wireless/mwifiex/sdio.h index 6d51dfdd8251..532ae0ac4dfb 100644 --- a/drivers/net/wireless/mwifiex/sdio.h +++ b/drivers/net/wireless/mwifiex/sdio.h | |||
@@ -92,9 +92,6 @@ | |||
92 | /* Host Control Registers : Download host interrupt mask */ | 92 | /* Host Control Registers : Download host interrupt mask */ |
93 | #define DN_LD_HOST_INT_MASK (0x2U) | 93 | #define DN_LD_HOST_INT_MASK (0x2U) |
94 | 94 | ||
95 | /* Disable Host interrupt mask */ | ||
96 | #define HOST_INT_DISABLE 0xff | ||
97 | |||
98 | /* Host Control Registers : Host interrupt status */ | 95 | /* Host Control Registers : Host interrupt status */ |
99 | #define HOST_INTSTATUS_REG 0x03 | 96 | #define HOST_INTSTATUS_REG 0x03 |
100 | /* Host Control Registers : Upload host interrupt status */ | 97 | /* Host Control Registers : Upload host interrupt status */ |
diff --git a/drivers/net/wireless/rt2x00/Kconfig b/drivers/net/wireless/rt2x00/Kconfig index 9b915d3a44be..3e60a31582f8 100644 --- a/drivers/net/wireless/rt2x00/Kconfig +++ b/drivers/net/wireless/rt2x00/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | menuconfig RT2X00 | 1 | menuconfig RT2X00 |
2 | tristate "Ralink driver support" | 2 | tristate "Ralink driver support" |
3 | depends on MAC80211 | 3 | depends on MAC80211 && HAS_DMA |
4 | ---help--- | 4 | ---help--- |
5 | This will enable the support for the Ralink drivers, | 5 | This will enable the support for the Ralink drivers, |
6 | developed in the rt2x00 project <http://rt2x00.serialmonkey.com>. | 6 | developed in the rt2x00 project <http://rt2x00.serialmonkey.com>. |
diff --git a/drivers/net/wireless/rtlwifi/Kconfig b/drivers/net/wireless/rtlwifi/Kconfig index 7253de3d8c66..c2ffce7a907c 100644 --- a/drivers/net/wireless/rtlwifi/Kconfig +++ b/drivers/net/wireless/rtlwifi/Kconfig | |||
@@ -1,27 +1,20 @@ | |||
1 | config RTLWIFI | 1 | menuconfig RTL_CARDS |
2 | tristate "Realtek wireless card support" | 2 | tristate "Realtek rtlwifi family of devices" |
3 | depends on MAC80211 | 3 | depends on MAC80211 && (PCI || USB) |
4 | select FW_LOADER | ||
5 | ---help--- | ||
6 | This is common code for RTL8192CE/RTL8192CU/RTL8192SE/RTL8723AE | ||
7 | drivers. This module does nothing by itself - the various front-end | ||
8 | drivers need to be enabled to support any desired devices. | ||
9 | |||
10 | If you choose to build as a module, it'll be called rtlwifi. | ||
11 | |||
12 | config RTLWIFI_DEBUG | ||
13 | bool "Debugging output for rtlwifi driver family" | ||
14 | depends on RTLWIFI | ||
15 | default y | 4 | default y |
16 | ---help--- | 5 | ---help--- |
17 | To use the module option that sets the dynamic-debugging level for, | 6 | This option will enable support for the Realtek mac80211-based |
18 | the front-end driver, this parameter must be "Y". For memory-limited | 7 | wireless drivers. Drivers rtl8192ce, rtl8192cu, rtl8192se, rtl8192de, |
19 | systems, choose "N". If in doubt, choose "Y". | 8 | rtl8723eu, and rtl8188eu share some common code. |
9 | |||
10 | if RTL_CARDS | ||
20 | 11 | ||
21 | config RTL8192CE | 12 | config RTL8192CE |
22 | tristate "Realtek RTL8192CE/RTL8188CE Wireless Network Adapter" | 13 | tristate "Realtek RTL8192CE/RTL8188CE Wireless Network Adapter" |
23 | depends on RTLWIFI && PCI | 14 | depends on PCI |
24 | select RTL8192C_COMMON | 15 | select RTL8192C_COMMON |
16 | select RTLWIFI | ||
17 | select RTLWIFI_PCI | ||
25 | ---help--- | 18 | ---help--- |
26 | This is the driver for Realtek RTL8192CE/RTL8188CE 802.11n PCIe | 19 | This is the driver for Realtek RTL8192CE/RTL8188CE 802.11n PCIe |
27 | wireless network adapters. | 20 | wireless network adapters. |
@@ -30,7 +23,9 @@ config RTL8192CE | |||
30 | 23 | ||
31 | config RTL8192SE | 24 | config RTL8192SE |
32 | tristate "Realtek RTL8192SE/RTL8191SE PCIe Wireless Network Adapter" | 25 | tristate "Realtek RTL8192SE/RTL8191SE PCIe Wireless Network Adapter" |
33 | depends on RTLWIFI && PCI | 26 | depends on PCI |
27 | select RTLWIFI | ||
28 | select RTLWIFI_PCI | ||
34 | ---help--- | 29 | ---help--- |
35 | This is the driver for Realtek RTL8192SE/RTL8191SE 802.11n PCIe | 30 | This is the driver for Realtek RTL8192SE/RTL8191SE 802.11n PCIe |
36 | wireless network adapters. | 31 | wireless network adapters. |
@@ -39,7 +34,9 @@ config RTL8192SE | |||
39 | 34 | ||
40 | config RTL8192DE | 35 | config RTL8192DE |
41 | tristate "Realtek RTL8192DE/RTL8188DE PCIe Wireless Network Adapter" | 36 | tristate "Realtek RTL8192DE/RTL8188DE PCIe Wireless Network Adapter" |
42 | depends on RTLWIFI && PCI | 37 | depends on PCI |
38 | select RTLWIFI | ||
39 | select RTLWIFI_PCI | ||
43 | ---help--- | 40 | ---help--- |
44 | This is the driver for Realtek RTL8192DE/RTL8188DE 802.11n PCIe | 41 | This is the driver for Realtek RTL8192DE/RTL8188DE 802.11n PCIe |
45 | wireless network adapters. | 42 | wireless network adapters. |
@@ -48,7 +45,9 @@ config RTL8192DE | |||
48 | 45 | ||
49 | config RTL8723AE | 46 | config RTL8723AE |
50 | tristate "Realtek RTL8723AE PCIe Wireless Network Adapter" | 47 | tristate "Realtek RTL8723AE PCIe Wireless Network Adapter" |
51 | depends on RTLWIFI && PCI | 48 | depends on PCI |
49 | select RTLWIFI | ||
50 | select RTLWIFI_PCI | ||
52 | ---help--- | 51 | ---help--- |
53 | This is the driver for Realtek RTL8723AE 802.11n PCIe | 52 | This is the driver for Realtek RTL8723AE 802.11n PCIe |
54 | wireless network adapters. | 53 | wireless network adapters. |
@@ -57,7 +56,9 @@ config RTL8723AE | |||
57 | 56 | ||
58 | config RTL8188EE | 57 | config RTL8188EE |
59 | tristate "Realtek RTL8188EE Wireless Network Adapter" | 58 | tristate "Realtek RTL8188EE Wireless Network Adapter" |
60 | depends on RTLWIFI && PCI | 59 | depends on PCI |
60 | select RTLWIFI | ||
61 | select RTLWIFI_PCI | ||
61 | ---help--- | 62 | ---help--- |
62 | This is the driver for Realtek RTL8188EE 802.11n PCIe | 63 | This is the driver for Realtek RTL8188EE 802.11n PCIe |
63 | wireless network adapters. | 64 | wireless network adapters. |
@@ -66,7 +67,9 @@ config RTL8188EE | |||
66 | 67 | ||
67 | config RTL8192CU | 68 | config RTL8192CU |
68 | tristate "Realtek RTL8192CU/RTL8188CU USB Wireless Network Adapter" | 69 | tristate "Realtek RTL8192CU/RTL8188CU USB Wireless Network Adapter" |
69 | depends on RTLWIFI && USB | 70 | depends on USB |
71 | select RTLWIFI | ||
72 | select RTLWIFI_USB | ||
70 | select RTL8192C_COMMON | 73 | select RTL8192C_COMMON |
71 | ---help--- | 74 | ---help--- |
72 | This is the driver for Realtek RTL8192CU/RTL8188CU 802.11n USB | 75 | This is the driver for Realtek RTL8192CU/RTL8188CU 802.11n USB |
@@ -74,7 +77,28 @@ config RTL8192CU | |||
74 | 77 | ||
75 | If you choose to build it as a module, it will be called rtl8192cu | 78 | If you choose to build it as a module, it will be called rtl8192cu |
76 | 79 | ||
80 | config RTLWIFI | ||
81 | tristate | ||
82 | select FW_LOADER | ||
83 | |||
84 | config RTLWIFI_PCI | ||
85 | tristate | ||
86 | |||
87 | config RTLWIFI_USB | ||
88 | tristate | ||
89 | |||
90 | config RTLWIFI_DEBUG | ||
91 | bool "Debugging output for rtlwifi driver family" | ||
92 | depends on RTLWIFI | ||
93 | default y | ||
94 | ---help--- | ||
95 | To use the module option that sets the dynamic-debugging level for, | ||
96 | the front-end driver, this parameter must be "Y". For memory-limited | ||
97 | systems, choose "N". If in doubt, choose "Y". | ||
98 | |||
77 | config RTL8192C_COMMON | 99 | config RTL8192C_COMMON |
78 | tristate | 100 | tristate |
79 | depends on RTL8192CE || RTL8192CU | 101 | depends on RTL8192CE || RTL8192CU |
80 | default m | 102 | default y |
103 | |||
104 | endif | ||
diff --git a/drivers/net/wireless/rtlwifi/Makefile b/drivers/net/wireless/rtlwifi/Makefile index ff02b874f8d8..d56f023a4b90 100644 --- a/drivers/net/wireless/rtlwifi/Makefile +++ b/drivers/net/wireless/rtlwifi/Makefile | |||
@@ -12,13 +12,11 @@ rtlwifi-objs := \ | |||
12 | 12 | ||
13 | rtl8192c_common-objs += \ | 13 | rtl8192c_common-objs += \ |
14 | 14 | ||
15 | ifneq ($(CONFIG_PCI),) | 15 | obj-$(CONFIG_RTLWIFI_PCI) += rtl_pci.o |
16 | rtlwifi-objs += pci.o | 16 | rtl_pci-objs := pci.o |
17 | endif | ||
18 | 17 | ||
19 | ifneq ($(CONFIG_USB),) | 18 | obj-$(CONFIG_RTLWIFI_USB) += rtl_usb.o |
20 | rtlwifi-objs += usb.o | 19 | rtl_usb-objs := usb.o |
21 | endif | ||
22 | 20 | ||
23 | obj-$(CONFIG_RTL8192C_COMMON) += rtl8192c/ | 21 | obj-$(CONFIG_RTL8192C_COMMON) += rtl8192c/ |
24 | obj-$(CONFIG_RTL8192CE) += rtl8192ce/ | 22 | obj-$(CONFIG_RTL8192CE) += rtl8192ce/ |
diff --git a/drivers/net/wireless/rtlwifi/base.c b/drivers/net/wireless/rtlwifi/base.c index 9d558ac77b0c..7651f5acc14b 100644 --- a/drivers/net/wireless/rtlwifi/base.c +++ b/drivers/net/wireless/rtlwifi/base.c | |||
@@ -172,6 +172,7 @@ u8 rtl_tid_to_ac(u8 tid) | |||
172 | { | 172 | { |
173 | return tid_to_ac[tid]; | 173 | return tid_to_ac[tid]; |
174 | } | 174 | } |
175 | EXPORT_SYMBOL_GPL(rtl_tid_to_ac); | ||
175 | 176 | ||
176 | static void _rtl_init_hw_ht_capab(struct ieee80211_hw *hw, | 177 | static void _rtl_init_hw_ht_capab(struct ieee80211_hw *hw, |
177 | struct ieee80211_sta_ht_cap *ht_cap) | 178 | struct ieee80211_sta_ht_cap *ht_cap) |
@@ -406,6 +407,7 @@ void rtl_deinit_deferred_work(struct ieee80211_hw *hw) | |||
406 | cancel_delayed_work(&rtlpriv->works.ps_rfon_wq); | 407 | cancel_delayed_work(&rtlpriv->works.ps_rfon_wq); |
407 | cancel_delayed_work(&rtlpriv->works.fwevt_wq); | 408 | cancel_delayed_work(&rtlpriv->works.fwevt_wq); |
408 | } | 409 | } |
410 | EXPORT_SYMBOL_GPL(rtl_deinit_deferred_work); | ||
409 | 411 | ||
410 | void rtl_init_rfkill(struct ieee80211_hw *hw) | 412 | void rtl_init_rfkill(struct ieee80211_hw *hw) |
411 | { | 413 | { |
@@ -439,6 +441,7 @@ void rtl_deinit_rfkill(struct ieee80211_hw *hw) | |||
439 | { | 441 | { |
440 | wiphy_rfkill_stop_polling(hw->wiphy); | 442 | wiphy_rfkill_stop_polling(hw->wiphy); |
441 | } | 443 | } |
444 | EXPORT_SYMBOL_GPL(rtl_deinit_rfkill); | ||
442 | 445 | ||
443 | int rtl_init_core(struct ieee80211_hw *hw) | 446 | int rtl_init_core(struct ieee80211_hw *hw) |
444 | { | 447 | { |
@@ -489,10 +492,12 @@ int rtl_init_core(struct ieee80211_hw *hw) | |||
489 | 492 | ||
490 | return 0; | 493 | return 0; |
491 | } | 494 | } |
495 | EXPORT_SYMBOL_GPL(rtl_init_core); | ||
492 | 496 | ||
493 | void rtl_deinit_core(struct ieee80211_hw *hw) | 497 | void rtl_deinit_core(struct ieee80211_hw *hw) |
494 | { | 498 | { |
495 | } | 499 | } |
500 | EXPORT_SYMBOL_GPL(rtl_deinit_core); | ||
496 | 501 | ||
497 | void rtl_init_rx_config(struct ieee80211_hw *hw) | 502 | void rtl_init_rx_config(struct ieee80211_hw *hw) |
498 | { | 503 | { |
@@ -501,6 +506,7 @@ void rtl_init_rx_config(struct ieee80211_hw *hw) | |||
501 | 506 | ||
502 | rtlpriv->cfg->ops->get_hw_reg(hw, HW_VAR_RCR, (u8 *) (&mac->rx_conf)); | 507 | rtlpriv->cfg->ops->get_hw_reg(hw, HW_VAR_RCR, (u8 *) (&mac->rx_conf)); |
503 | } | 508 | } |
509 | EXPORT_SYMBOL_GPL(rtl_init_rx_config); | ||
504 | 510 | ||
505 | /********************************************************* | 511 | /********************************************************* |
506 | * | 512 | * |
@@ -879,6 +885,7 @@ bool rtl_tx_mgmt_proc(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
879 | 885 | ||
880 | return true; | 886 | return true; |
881 | } | 887 | } |
888 | EXPORT_SYMBOL_GPL(rtl_tx_mgmt_proc); | ||
882 | 889 | ||
883 | void rtl_get_tcb_desc(struct ieee80211_hw *hw, | 890 | void rtl_get_tcb_desc(struct ieee80211_hw *hw, |
884 | struct ieee80211_tx_info *info, | 891 | struct ieee80211_tx_info *info, |
@@ -1052,6 +1059,7 @@ bool rtl_action_proc(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx) | |||
1052 | 1059 | ||
1053 | return true; | 1060 | return true; |
1054 | } | 1061 | } |
1062 | EXPORT_SYMBOL_GPL(rtl_action_proc); | ||
1055 | 1063 | ||
1056 | /*should call before software enc*/ | 1064 | /*should call before software enc*/ |
1057 | u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx) | 1065 | u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx) |
@@ -1125,6 +1133,7 @@ u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx) | |||
1125 | 1133 | ||
1126 | return false; | 1134 | return false; |
1127 | } | 1135 | } |
1136 | EXPORT_SYMBOL_GPL(rtl_is_special_data); | ||
1128 | 1137 | ||
1129 | /********************************************************* | 1138 | /********************************************************* |
1130 | * | 1139 | * |
@@ -1300,6 +1309,7 @@ void rtl_beacon_statistic(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
1300 | 1309 | ||
1301 | rtlpriv->link_info.bcn_rx_inperiod++; | 1310 | rtlpriv->link_info.bcn_rx_inperiod++; |
1302 | } | 1311 | } |
1312 | EXPORT_SYMBOL_GPL(rtl_beacon_statistic); | ||
1303 | 1313 | ||
1304 | void rtl_watchdog_wq_callback(void *data) | 1314 | void rtl_watchdog_wq_callback(void *data) |
1305 | { | 1315 | { |
@@ -1793,6 +1803,7 @@ void rtl_recognize_peer(struct ieee80211_hw *hw, u8 *data, unsigned int len) | |||
1793 | 1803 | ||
1794 | mac->vendor = vendor; | 1804 | mac->vendor = vendor; |
1795 | } | 1805 | } |
1806 | EXPORT_SYMBOL_GPL(rtl_recognize_peer); | ||
1796 | 1807 | ||
1797 | /********************************************************* | 1808 | /********************************************************* |
1798 | * | 1809 | * |
@@ -1849,6 +1860,7 @@ struct attribute_group rtl_attribute_group = { | |||
1849 | .name = "rtlsysfs", | 1860 | .name = "rtlsysfs", |
1850 | .attrs = rtl_sysfs_entries, | 1861 | .attrs = rtl_sysfs_entries, |
1851 | }; | 1862 | }; |
1863 | EXPORT_SYMBOL_GPL(rtl_attribute_group); | ||
1852 | 1864 | ||
1853 | MODULE_AUTHOR("lizhaoming <chaoming_li@realsil.com.cn>"); | 1865 | MODULE_AUTHOR("lizhaoming <chaoming_li@realsil.com.cn>"); |
1854 | MODULE_AUTHOR("Realtek WlanFAE <wlanfae@realtek.com>"); | 1866 | MODULE_AUTHOR("Realtek WlanFAE <wlanfae@realtek.com>"); |
@@ -1856,7 +1868,8 @@ MODULE_AUTHOR("Larry Finger <Larry.FInger@lwfinger.net>"); | |||
1856 | MODULE_LICENSE("GPL"); | 1868 | MODULE_LICENSE("GPL"); |
1857 | MODULE_DESCRIPTION("Realtek 802.11n PCI wireless core"); | 1869 | MODULE_DESCRIPTION("Realtek 802.11n PCI wireless core"); |
1858 | 1870 | ||
1859 | struct rtl_global_var global_var = {}; | 1871 | struct rtl_global_var rtl_global_var = {}; |
1872 | EXPORT_SYMBOL_GPL(rtl_global_var); | ||
1860 | 1873 | ||
1861 | static int __init rtl_core_module_init(void) | 1874 | static int __init rtl_core_module_init(void) |
1862 | { | 1875 | { |
@@ -1864,8 +1877,8 @@ static int __init rtl_core_module_init(void) | |||
1864 | pr_err("Unable to register rtl_rc, use default RC !!\n"); | 1877 | pr_err("Unable to register rtl_rc, use default RC !!\n"); |
1865 | 1878 | ||
1866 | /* init some global vars */ | 1879 | /* init some global vars */ |
1867 | INIT_LIST_HEAD(&global_var.glb_priv_list); | 1880 | INIT_LIST_HEAD(&rtl_global_var.glb_priv_list); |
1868 | spin_lock_init(&global_var.glb_list_lock); | 1881 | spin_lock_init(&rtl_global_var.glb_list_lock); |
1869 | 1882 | ||
1870 | return 0; | 1883 | return 0; |
1871 | } | 1884 | } |
diff --git a/drivers/net/wireless/rtlwifi/base.h b/drivers/net/wireless/rtlwifi/base.h index 8576bc34b032..0e5fe0902daf 100644 --- a/drivers/net/wireless/rtlwifi/base.h +++ b/drivers/net/wireless/rtlwifi/base.h | |||
@@ -147,7 +147,7 @@ void rtl_recognize_peer(struct ieee80211_hw *hw, u8 *data, unsigned int len); | |||
147 | u8 rtl_tid_to_ac(u8 tid); | 147 | u8 rtl_tid_to_ac(u8 tid); |
148 | extern struct attribute_group rtl_attribute_group; | 148 | extern struct attribute_group rtl_attribute_group; |
149 | void rtl_easy_concurrent_retrytimer_callback(unsigned long data); | 149 | void rtl_easy_concurrent_retrytimer_callback(unsigned long data); |
150 | extern struct rtl_global_var global_var; | 150 | extern struct rtl_global_var rtl_global_var; |
151 | int rtlwifi_rate_mapping(struct ieee80211_hw *hw, | 151 | int rtlwifi_rate_mapping(struct ieee80211_hw *hw, |
152 | bool isht, u8 desc_rate, bool first_ampdu); | 152 | bool isht, u8 desc_rate, bool first_ampdu); |
153 | bool rtl_tx_mgmt_proc(struct ieee80211_hw *hw, struct sk_buff *skb); | 153 | bool rtl_tx_mgmt_proc(struct ieee80211_hw *hw, struct sk_buff *skb); |
diff --git a/drivers/net/wireless/rtlwifi/core.c b/drivers/net/wireless/rtlwifi/core.c index ee84844be008..733b7ce7f0e2 100644 --- a/drivers/net/wireless/rtlwifi/core.c +++ b/drivers/net/wireless/rtlwifi/core.c | |||
@@ -1330,3 +1330,4 @@ const struct ieee80211_ops rtl_ops = { | |||
1330 | .rfkill_poll = rtl_op_rfkill_poll, | 1330 | .rfkill_poll = rtl_op_rfkill_poll, |
1331 | .flush = rtl_op_flush, | 1331 | .flush = rtl_op_flush, |
1332 | }; | 1332 | }; |
1333 | EXPORT_SYMBOL_GPL(rtl_ops); | ||
diff --git a/drivers/net/wireless/rtlwifi/debug.c b/drivers/net/wireless/rtlwifi/debug.c index 7d52d3d7769f..76e2086e137e 100644 --- a/drivers/net/wireless/rtlwifi/debug.c +++ b/drivers/net/wireless/rtlwifi/debug.c | |||
@@ -51,3 +51,4 @@ void rtl_dbgp_flag_init(struct ieee80211_hw *hw) | |||
51 | 51 | ||
52 | /*Init Debug flag enable condition */ | 52 | /*Init Debug flag enable condition */ |
53 | } | 53 | } |
54 | EXPORT_SYMBOL_GPL(rtl_dbgp_flag_init); | ||
diff --git a/drivers/net/wireless/rtlwifi/efuse.c b/drivers/net/wireless/rtlwifi/efuse.c index 9e3894178e77..838a1ed3f194 100644 --- a/drivers/net/wireless/rtlwifi/efuse.c +++ b/drivers/net/wireless/rtlwifi/efuse.c | |||
@@ -229,6 +229,7 @@ void read_efuse_byte(struct ieee80211_hw *hw, u16 _offset, u8 *pbuf) | |||
229 | 229 | ||
230 | *pbuf = (u8) (value32 & 0xff); | 230 | *pbuf = (u8) (value32 & 0xff); |
231 | } | 231 | } |
232 | EXPORT_SYMBOL_GPL(read_efuse_byte); | ||
232 | 233 | ||
233 | void read_efuse(struct ieee80211_hw *hw, u16 _offset, u16 _size_byte, u8 *pbuf) | 234 | void read_efuse(struct ieee80211_hw *hw, u16 _offset, u16 _size_byte, u8 *pbuf) |
234 | { | 235 | { |
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c index c97e9d327331..703f839af6ca 100644 --- a/drivers/net/wireless/rtlwifi/pci.c +++ b/drivers/net/wireless/rtlwifi/pci.c | |||
@@ -35,6 +35,13 @@ | |||
35 | #include "efuse.h" | 35 | #include "efuse.h" |
36 | #include <linux/export.h> | 36 | #include <linux/export.h> |
37 | #include <linux/kmemleak.h> | 37 | #include <linux/kmemleak.h> |
38 | #include <linux/module.h> | ||
39 | |||
40 | MODULE_AUTHOR("lizhaoming <chaoming_li@realsil.com.cn>"); | ||
41 | MODULE_AUTHOR("Realtek WlanFAE <wlanfae@realtek.com>"); | ||
42 | MODULE_AUTHOR("Larry Finger <Larry.FInger@lwfinger.net>"); | ||
43 | MODULE_LICENSE("GPL"); | ||
44 | MODULE_DESCRIPTION("PCI basic driver for rtlwifi"); | ||
38 | 45 | ||
39 | static const u16 pcibridge_vendors[PCI_BRIDGE_VENDOR_MAX] = { | 46 | static const u16 pcibridge_vendors[PCI_BRIDGE_VENDOR_MAX] = { |
40 | PCI_VENDOR_ID_INTEL, | 47 | PCI_VENDOR_ID_INTEL, |
@@ -1008,19 +1015,6 @@ static void _rtl_pci_prepare_bcn_tasklet(struct ieee80211_hw *hw) | |||
1008 | return; | 1015 | return; |
1009 | } | 1016 | } |
1010 | 1017 | ||
1011 | static void rtl_lps_change_work_callback(struct work_struct *work) | ||
1012 | { | ||
1013 | struct rtl_works *rtlworks = | ||
1014 | container_of(work, struct rtl_works, lps_change_work); | ||
1015 | struct ieee80211_hw *hw = rtlworks->hw; | ||
1016 | struct rtl_priv *rtlpriv = rtl_priv(hw); | ||
1017 | |||
1018 | if (rtlpriv->enter_ps) | ||
1019 | rtl_lps_enter(hw); | ||
1020 | else | ||
1021 | rtl_lps_leave(hw); | ||
1022 | } | ||
1023 | |||
1024 | static void _rtl_pci_init_trx_var(struct ieee80211_hw *hw) | 1018 | static void _rtl_pci_init_trx_var(struct ieee80211_hw *hw) |
1025 | { | 1019 | { |
1026 | struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); | 1020 | struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); |
@@ -1899,7 +1893,7 @@ int rtl_pci_probe(struct pci_dev *pdev, | |||
1899 | rtlpriv->rtlhal.interface = INTF_PCI; | 1893 | rtlpriv->rtlhal.interface = INTF_PCI; |
1900 | rtlpriv->cfg = (struct rtl_hal_cfg *)(id->driver_data); | 1894 | rtlpriv->cfg = (struct rtl_hal_cfg *)(id->driver_data); |
1901 | rtlpriv->intf_ops = &rtl_pci_ops; | 1895 | rtlpriv->intf_ops = &rtl_pci_ops; |
1902 | rtlpriv->glb_var = &global_var; | 1896 | rtlpriv->glb_var = &rtl_global_var; |
1903 | 1897 | ||
1904 | /* | 1898 | /* |
1905 | *init dbgp flags before all | 1899 | *init dbgp flags before all |
diff --git a/drivers/net/wireless/rtlwifi/ps.c b/drivers/net/wireless/rtlwifi/ps.c index 884bceae38a9..298b615964e8 100644 --- a/drivers/net/wireless/rtlwifi/ps.c +++ b/drivers/net/wireless/rtlwifi/ps.c | |||
@@ -269,6 +269,7 @@ void rtl_ips_nic_on(struct ieee80211_hw *hw) | |||
269 | 269 | ||
270 | spin_unlock_irqrestore(&rtlpriv->locks.ips_lock, flags); | 270 | spin_unlock_irqrestore(&rtlpriv->locks.ips_lock, flags); |
271 | } | 271 | } |
272 | EXPORT_SYMBOL_GPL(rtl_ips_nic_on); | ||
272 | 273 | ||
273 | /*for FW LPS*/ | 274 | /*for FW LPS*/ |
274 | 275 | ||
@@ -518,6 +519,7 @@ void rtl_swlps_beacon(struct ieee80211_hw *hw, void *data, unsigned int len) | |||
518 | "u_bufferd: %x, m_buffered: %x\n", u_buffed, m_buffed); | 519 | "u_bufferd: %x, m_buffered: %x\n", u_buffed, m_buffed); |
519 | } | 520 | } |
520 | } | 521 | } |
522 | EXPORT_SYMBOL_GPL(rtl_swlps_beacon); | ||
521 | 523 | ||
522 | void rtl_swlps_rf_awake(struct ieee80211_hw *hw) | 524 | void rtl_swlps_rf_awake(struct ieee80211_hw *hw) |
523 | { | 525 | { |
@@ -611,6 +613,19 @@ void rtl_swlps_rf_sleep(struct ieee80211_hw *hw) | |||
611 | MSECS(sleep_intv * mac->vif->bss_conf.beacon_int - 40)); | 613 | MSECS(sleep_intv * mac->vif->bss_conf.beacon_int - 40)); |
612 | } | 614 | } |
613 | 615 | ||
616 | void rtl_lps_change_work_callback(struct work_struct *work) | ||
617 | { | ||
618 | struct rtl_works *rtlworks = | ||
619 | container_of(work, struct rtl_works, lps_change_work); | ||
620 | struct ieee80211_hw *hw = rtlworks->hw; | ||
621 | struct rtl_priv *rtlpriv = rtl_priv(hw); | ||
622 | |||
623 | if (rtlpriv->enter_ps) | ||
624 | rtl_lps_enter(hw); | ||
625 | else | ||
626 | rtl_lps_leave(hw); | ||
627 | } | ||
628 | EXPORT_SYMBOL_GPL(rtl_lps_change_work_callback); | ||
614 | 629 | ||
615 | void rtl_swlps_wq_callback(void *data) | 630 | void rtl_swlps_wq_callback(void *data) |
616 | { | 631 | { |
@@ -922,3 +937,4 @@ void rtl_p2p_info(struct ieee80211_hw *hw, void *data, unsigned int len) | |||
922 | else | 937 | else |
923 | rtl_p2p_noa_ie(hw, data, len - FCS_LEN); | 938 | rtl_p2p_noa_ie(hw, data, len - FCS_LEN); |
924 | } | 939 | } |
940 | EXPORT_SYMBOL_GPL(rtl_p2p_info); | ||
diff --git a/drivers/net/wireless/rtlwifi/ps.h b/drivers/net/wireless/rtlwifi/ps.h index 4d682b753f50..88bd76ea88f7 100644 --- a/drivers/net/wireless/rtlwifi/ps.h +++ b/drivers/net/wireless/rtlwifi/ps.h | |||
@@ -49,5 +49,6 @@ void rtl_swlps_rf_awake(struct ieee80211_hw *hw); | |||
49 | void rtl_swlps_rf_sleep(struct ieee80211_hw *hw); | 49 | void rtl_swlps_rf_sleep(struct ieee80211_hw *hw); |
50 | void rtl_p2p_ps_cmd(struct ieee80211_hw *hw, u8 p2p_ps_state); | 50 | void rtl_p2p_ps_cmd(struct ieee80211_hw *hw, u8 p2p_ps_state); |
51 | void rtl_p2p_info(struct ieee80211_hw *hw, void *data, unsigned int len); | 51 | void rtl_p2p_info(struct ieee80211_hw *hw, void *data, unsigned int len); |
52 | void rtl_lps_change_work_callback(struct work_struct *work); | ||
52 | 53 | ||
53 | #endif | 54 | #endif |
diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c index a3532e077871..e56778cac9bf 100644 --- a/drivers/net/wireless/rtlwifi/usb.c +++ b/drivers/net/wireless/rtlwifi/usb.c | |||
@@ -32,6 +32,13 @@ | |||
32 | #include "ps.h" | 32 | #include "ps.h" |
33 | #include "rtl8192c/fw_common.h" | 33 | #include "rtl8192c/fw_common.h" |
34 | #include <linux/export.h> | 34 | #include <linux/export.h> |
35 | #include <linux/module.h> | ||
36 | |||
37 | MODULE_AUTHOR("lizhaoming <chaoming_li@realsil.com.cn>"); | ||
38 | MODULE_AUTHOR("Realtek WlanFAE <wlanfae@realtek.com>"); | ||
39 | MODULE_AUTHOR("Larry Finger <Larry.FInger@lwfinger.net>"); | ||
40 | MODULE_LICENSE("GPL"); | ||
41 | MODULE_DESCRIPTION("USB basic driver for rtlwifi"); | ||
35 | 42 | ||
36 | #define REALTEK_USB_VENQT_READ 0xC0 | 43 | #define REALTEK_USB_VENQT_READ 0xC0 |
37 | #define REALTEK_USB_VENQT_WRITE 0x40 | 44 | #define REALTEK_USB_VENQT_WRITE 0x40 |
@@ -1070,6 +1077,8 @@ int rtl_usb_probe(struct usb_interface *intf, | |||
1070 | spin_lock_init(&rtlpriv->locks.usb_lock); | 1077 | spin_lock_init(&rtlpriv->locks.usb_lock); |
1071 | INIT_WORK(&rtlpriv->works.fill_h2c_cmd, | 1078 | INIT_WORK(&rtlpriv->works.fill_h2c_cmd, |
1072 | rtl_fill_h2c_cmd_work_callback); | 1079 | rtl_fill_h2c_cmd_work_callback); |
1080 | INIT_WORK(&rtlpriv->works.lps_change_work, | ||
1081 | rtl_lps_change_work_callback); | ||
1073 | 1082 | ||
1074 | rtlpriv->usb_data_index = 0; | 1083 | rtlpriv->usb_data_index = 0; |
1075 | init_completion(&rtlpriv->firmware_loading_complete); | 1084 | init_completion(&rtlpriv->firmware_loading_complete); |
diff --git a/drivers/rapidio/rio.c b/drivers/rapidio/rio.c index f4f30af2df68..2e8a20cac588 100644 --- a/drivers/rapidio/rio.c +++ b/drivers/rapidio/rio.c | |||
@@ -1715,11 +1715,13 @@ int rio_unregister_scan(int mport_id, struct rio_scan *scan_ops) | |||
1715 | (mport_id == RIO_MPORT_ANY && port->nscan == scan_ops)) | 1715 | (mport_id == RIO_MPORT_ANY && port->nscan == scan_ops)) |
1716 | port->nscan = NULL; | 1716 | port->nscan = NULL; |
1717 | 1717 | ||
1718 | list_for_each_entry(scan, &rio_scans, node) | 1718 | list_for_each_entry(scan, &rio_scans, node) { |
1719 | if (scan->mport_id == mport_id) { | 1719 | if (scan->mport_id == mport_id) { |
1720 | list_del(&scan->node); | 1720 | list_del(&scan->node); |
1721 | kfree(scan); | 1721 | kfree(scan); |
1722 | break; | ||
1722 | } | 1723 | } |
1724 | } | ||
1723 | 1725 | ||
1724 | mutex_unlock(&rio_mport_list_lock); | 1726 | mutex_unlock(&rio_mport_list_lock); |
1725 | 1727 | ||
diff --git a/drivers/rtc/rtc-twl.c b/drivers/rtc/rtc-twl.c index 02faf3c4e0d5..c2e80d7ca5e2 100644 --- a/drivers/rtc/rtc-twl.c +++ b/drivers/rtc/rtc-twl.c | |||
@@ -524,6 +524,8 @@ static int twl_rtc_probe(struct platform_device *pdev) | |||
524 | if (ret < 0) | 524 | if (ret < 0) |
525 | goto out1; | 525 | goto out1; |
526 | 526 | ||
527 | device_init_wakeup(&pdev->dev, 1); | ||
528 | |||
527 | rtc = rtc_device_register(pdev->name, | 529 | rtc = rtc_device_register(pdev->name, |
528 | &pdev->dev, &twl_rtc_ops, THIS_MODULE); | 530 | &pdev->dev, &twl_rtc_ops, THIS_MODULE); |
529 | if (IS_ERR(rtc)) { | 531 | if (IS_ERR(rtc)) { |
@@ -542,7 +544,6 @@ static int twl_rtc_probe(struct platform_device *pdev) | |||
542 | } | 544 | } |
543 | 545 | ||
544 | platform_set_drvdata(pdev, rtc); | 546 | platform_set_drvdata(pdev, rtc); |
545 | device_init_wakeup(&pdev->dev, 1); | ||
546 | return 0; | 547 | return 0; |
547 | 548 | ||
548 | out2: | 549 | out2: |
diff --git a/drivers/tty/serial/arc_uart.c b/drivers/tty/serial/arc_uart.c index cbf1d155b7b2..22f280aa4f2c 100644 --- a/drivers/tty/serial/arc_uart.c +++ b/drivers/tty/serial/arc_uart.c | |||
@@ -773,6 +773,6 @@ module_init(arc_serial_init); | |||
773 | module_exit(arc_serial_exit); | 773 | module_exit(arc_serial_exit); |
774 | 774 | ||
775 | MODULE_LICENSE("GPL"); | 775 | MODULE_LICENSE("GPL"); |
776 | MODULE_ALIAS("plat-arcfpga/uart"); | 776 | MODULE_ALIAS("platform:" DRIVER_NAME); |
777 | MODULE_AUTHOR("Vineet Gupta"); | 777 | MODULE_AUTHOR("Vineet Gupta"); |
778 | MODULE_DESCRIPTION("ARC(Synopsys) On-Chip(fpga) serial driver"); | 778 | MODULE_DESCRIPTION("ARC(Synopsys) On-Chip(fpga) serial driver"); |
diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c index 4f5f161896a1..f85b8e6d0346 100644 --- a/drivers/tty/serial/mxs-auart.c +++ b/drivers/tty/serial/mxs-auart.c | |||
@@ -678,11 +678,18 @@ static void mxs_auart_settermios(struct uart_port *u, | |||
678 | 678 | ||
679 | static irqreturn_t mxs_auart_irq_handle(int irq, void *context) | 679 | static irqreturn_t mxs_auart_irq_handle(int irq, void *context) |
680 | { | 680 | { |
681 | u32 istatus, istat; | 681 | u32 istat; |
682 | struct mxs_auart_port *s = context; | 682 | struct mxs_auart_port *s = context; |
683 | u32 stat = readl(s->port.membase + AUART_STAT); | 683 | u32 stat = readl(s->port.membase + AUART_STAT); |
684 | 684 | ||
685 | istatus = istat = readl(s->port.membase + AUART_INTR); | 685 | istat = readl(s->port.membase + AUART_INTR); |
686 | |||
687 | /* ack irq */ | ||
688 | writel(istat & (AUART_INTR_RTIS | ||
689 | | AUART_INTR_TXIS | ||
690 | | AUART_INTR_RXIS | ||
691 | | AUART_INTR_CTSMIS), | ||
692 | s->port.membase + AUART_INTR_CLR); | ||
686 | 693 | ||
687 | if (istat & AUART_INTR_CTSMIS) { | 694 | if (istat & AUART_INTR_CTSMIS) { |
688 | uart_handle_cts_change(&s->port, stat & AUART_STAT_CTS); | 695 | uart_handle_cts_change(&s->port, stat & AUART_STAT_CTS); |
@@ -702,12 +709,6 @@ static irqreturn_t mxs_auart_irq_handle(int irq, void *context) | |||
702 | istat &= ~AUART_INTR_TXIS; | 709 | istat &= ~AUART_INTR_TXIS; |
703 | } | 710 | } |
704 | 711 | ||
705 | writel(istatus & (AUART_INTR_RTIS | ||
706 | | AUART_INTR_TXIS | ||
707 | | AUART_INTR_RXIS | ||
708 | | AUART_INTR_CTSMIS), | ||
709 | s->port.membase + AUART_INTR_CLR); | ||
710 | |||
711 | return IRQ_HANDLED; | 712 | return IRQ_HANDLED; |
712 | } | 713 | } |
713 | 714 | ||
@@ -850,7 +851,7 @@ auart_console_write(struct console *co, const char *str, unsigned int count) | |||
850 | struct mxs_auart_port *s; | 851 | struct mxs_auart_port *s; |
851 | struct uart_port *port; | 852 | struct uart_port *port; |
852 | unsigned int old_ctrl0, old_ctrl2; | 853 | unsigned int old_ctrl0, old_ctrl2; |
853 | unsigned int to = 1000; | 854 | unsigned int to = 20000; |
854 | 855 | ||
855 | if (co->index >= MXS_AUART_PORTS || co->index < 0) | 856 | if (co->index >= MXS_AUART_PORTS || co->index < 0) |
856 | return; | 857 | return; |
@@ -871,18 +872,23 @@ auart_console_write(struct console *co, const char *str, unsigned int count) | |||
871 | 872 | ||
872 | uart_console_write(port, str, count, mxs_auart_console_putchar); | 873 | uart_console_write(port, str, count, mxs_auart_console_putchar); |
873 | 874 | ||
874 | /* | 875 | /* Finally, wait for transmitter to become empty ... */ |
875 | * Finally, wait for transmitter to become empty | ||
876 | * and restore the TCR | ||
877 | */ | ||
878 | while (readl(port->membase + AUART_STAT) & AUART_STAT_BUSY) { | 876 | while (readl(port->membase + AUART_STAT) & AUART_STAT_BUSY) { |
877 | udelay(1); | ||
879 | if (!to--) | 878 | if (!to--) |
880 | break; | 879 | break; |
881 | udelay(1); | ||
882 | } | 880 | } |
883 | 881 | ||
884 | writel(old_ctrl0, port->membase + AUART_CTRL0); | 882 | /* |
885 | writel(old_ctrl2, port->membase + AUART_CTRL2); | 883 | * ... and restore the TCR if we waited long enough for the transmitter |
884 | * to be idle. This might keep the transmitter enabled although it is | ||
885 | * unused, but that is better than to disable it while it is still | ||
886 | * transmitting. | ||
887 | */ | ||
888 | if (!(readl(port->membase + AUART_STAT) & AUART_STAT_BUSY)) { | ||
889 | writel(old_ctrl0, port->membase + AUART_CTRL0); | ||
890 | writel(old_ctrl2, port->membase + AUART_CTRL2); | ||
891 | } | ||
886 | 892 | ||
887 | clk_disable(s->clk); | 893 | clk_disable(s->clk); |
888 | } | 894 | } |
diff --git a/drivers/tty/tty_port.c b/drivers/tty/tty_port.c index 121aeb9393e1..f597e88a705d 100644 --- a/drivers/tty/tty_port.c +++ b/drivers/tty/tty_port.c | |||
@@ -256,10 +256,9 @@ void tty_port_tty_hangup(struct tty_port *port, bool check_clocal) | |||
256 | { | 256 | { |
257 | struct tty_struct *tty = tty_port_tty_get(port); | 257 | struct tty_struct *tty = tty_port_tty_get(port); |
258 | 258 | ||
259 | if (tty && (!check_clocal || !C_CLOCAL(tty))) { | 259 | if (tty && (!check_clocal || !C_CLOCAL(tty))) |
260 | tty_hangup(tty); | 260 | tty_hangup(tty); |
261 | tty_kref_put(tty); | 261 | tty_kref_put(tty); |
262 | } | ||
263 | } | 262 | } |
264 | EXPORT_SYMBOL_GPL(tty_port_tty_hangup); | 263 | EXPORT_SYMBOL_GPL(tty_port_tty_hangup); |
265 | 264 | ||
diff --git a/drivers/usb/chipidea/Kconfig b/drivers/usb/chipidea/Kconfig index eb2aa2e5a842..d1bd8ef1f9c1 100644 --- a/drivers/usb/chipidea/Kconfig +++ b/drivers/usb/chipidea/Kconfig | |||
@@ -12,7 +12,7 @@ if USB_CHIPIDEA | |||
12 | 12 | ||
13 | config USB_CHIPIDEA_UDC | 13 | config USB_CHIPIDEA_UDC |
14 | bool "ChipIdea device controller" | 14 | bool "ChipIdea device controller" |
15 | depends on USB_GADGET=y || USB_CHIPIDEA=m | 15 | depends on USB_GADGET=y || (USB_CHIPIDEA=m && USB_GADGET=m) |
16 | help | 16 | help |
17 | Say Y here to enable device controller functionality of the | 17 | Say Y here to enable device controller functionality of the |
18 | ChipIdea driver. | 18 | ChipIdea driver. |
@@ -20,7 +20,7 @@ config USB_CHIPIDEA_UDC | |||
20 | config USB_CHIPIDEA_HOST | 20 | config USB_CHIPIDEA_HOST |
21 | bool "ChipIdea host controller" | 21 | bool "ChipIdea host controller" |
22 | depends on USB=y | 22 | depends on USB=y |
23 | depends on USB_EHCI_HCD=y || USB_CHIPIDEA=m | 23 | depends on USB_EHCI_HCD=y || (USB_CHIPIDEA=m && USB_EHCI_HCD=m) |
24 | select USB_EHCI_ROOT_HUB_TT | 24 | select USB_EHCI_ROOT_HUB_TT |
25 | help | 25 | help |
26 | Say Y here to enable host controller functionality of the | 26 | Say Y here to enable host controller functionality of the |
diff --git a/drivers/usb/chipidea/bits.h b/drivers/usb/chipidea/bits.h index aefa0261220c..1b23e354f9fb 100644 --- a/drivers/usb/chipidea/bits.h +++ b/drivers/usb/chipidea/bits.h | |||
@@ -50,7 +50,7 @@ | |||
50 | #define PORTSC_PTC (0x0FUL << 16) | 50 | #define PORTSC_PTC (0x0FUL << 16) |
51 | /* PTS and PTW for non lpm version only */ | 51 | /* PTS and PTW for non lpm version only */ |
52 | #define PORTSC_PTS(d) \ | 52 | #define PORTSC_PTS(d) \ |
53 | ((((d) & 0x3) << 30) | (((d) & 0x4) ? BIT(25) : 0)) | 53 | (u32)((((d) & 0x3) << 30) | (((d) & 0x4) ? BIT(25) : 0)) |
54 | #define PORTSC_PTW BIT(28) | 54 | #define PORTSC_PTW BIT(28) |
55 | #define PORTSC_STS BIT(29) | 55 | #define PORTSC_STS BIT(29) |
56 | 56 | ||
@@ -59,7 +59,7 @@ | |||
59 | #define DEVLC_PSPD_HS (0x02UL << 25) | 59 | #define DEVLC_PSPD_HS (0x02UL << 25) |
60 | #define DEVLC_PTW BIT(27) | 60 | #define DEVLC_PTW BIT(27) |
61 | #define DEVLC_STS BIT(28) | 61 | #define DEVLC_STS BIT(28) |
62 | #define DEVLC_PTS(d) (((d) & 0x7) << 29) | 62 | #define DEVLC_PTS(d) (u32)(((d) & 0x7) << 29) |
63 | 63 | ||
64 | /* Encoding for DEVLC_PTS and PORTSC_PTS */ | 64 | /* Encoding for DEVLC_PTS and PORTSC_PTS */ |
65 | #define PTS_UTMI 0 | 65 | #define PTS_UTMI 0 |
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c index f48712ffe261..c1c113ef950c 100644 --- a/drivers/usb/gadget/ether.c +++ b/drivers/usb/gadget/ether.c | |||
@@ -449,14 +449,20 @@ fail: | |||
449 | 449 | ||
450 | static int __exit eth_unbind(struct usb_composite_dev *cdev) | 450 | static int __exit eth_unbind(struct usb_composite_dev *cdev) |
451 | { | 451 | { |
452 | if (has_rndis()) | 452 | if (has_rndis()) { |
453 | usb_put_function(f_rndis); | ||
453 | usb_put_function_instance(fi_rndis); | 454 | usb_put_function_instance(fi_rndis); |
454 | if (use_eem) | 455 | } |
456 | if (use_eem) { | ||
457 | usb_put_function(f_eem); | ||
455 | usb_put_function_instance(fi_eem); | 458 | usb_put_function_instance(fi_eem); |
456 | else if (can_support_ecm(cdev->gadget)) | 459 | } else if (can_support_ecm(cdev->gadget)) { |
460 | usb_put_function(f_ecm); | ||
457 | usb_put_function_instance(fi_ecm); | 461 | usb_put_function_instance(fi_ecm); |
458 | else | 462 | } else { |
463 | usb_put_function(f_geth); | ||
459 | usb_put_function_instance(fi_geth); | 464 | usb_put_function_instance(fi_geth); |
465 | } | ||
460 | return 0; | 466 | return 0; |
461 | } | 467 | } |
462 | 468 | ||
diff --git a/drivers/usb/gadget/f_phonet.c b/drivers/usb/gadget/f_phonet.c index 1bf26e9f38cd..eb3aa817a662 100644 --- a/drivers/usb/gadget/f_phonet.c +++ b/drivers/usb/gadget/f_phonet.c | |||
@@ -488,7 +488,6 @@ static int pn_bind(struct usb_configuration *c, struct usb_function *f) | |||
488 | struct usb_ep *ep; | 488 | struct usb_ep *ep; |
489 | int status, i; | 489 | int status, i; |
490 | 490 | ||
491 | #ifndef USBF_PHONET_INCLUDED | ||
492 | struct f_phonet_opts *phonet_opts; | 491 | struct f_phonet_opts *phonet_opts; |
493 | 492 | ||
494 | phonet_opts = container_of(f->fi, struct f_phonet_opts, func_inst); | 493 | phonet_opts = container_of(f->fi, struct f_phonet_opts, func_inst); |
@@ -507,7 +506,6 @@ static int pn_bind(struct usb_configuration *c, struct usb_function *f) | |||
507 | return status; | 506 | return status; |
508 | phonet_opts->bound = true; | 507 | phonet_opts->bound = true; |
509 | } | 508 | } |
510 | #endif | ||
511 | 509 | ||
512 | /* Reserve interface IDs */ | 510 | /* Reserve interface IDs */ |
513 | status = usb_interface_id(c, f); | 511 | status = usb_interface_id(c, f); |
diff --git a/drivers/usb/gadget/multi.c b/drivers/usb/gadget/multi.c index 032b96a51ce4..2a1ebefd8f9e 100644 --- a/drivers/usb/gadget/multi.c +++ b/drivers/usb/gadget/multi.c | |||
@@ -160,10 +160,8 @@ static __init int rndis_do_config(struct usb_configuration *c) | |||
160 | return ret; | 160 | return ret; |
161 | 161 | ||
162 | f_acm_rndis = usb_get_function(fi_acm); | 162 | f_acm_rndis = usb_get_function(fi_acm); |
163 | if (IS_ERR(f_acm_rndis)) { | 163 | if (IS_ERR(f_acm_rndis)) |
164 | ret = PTR_ERR(f_acm_rndis); | 164 | return PTR_ERR(f_acm_rndis); |
165 | goto err_func_acm; | ||
166 | } | ||
167 | 165 | ||
168 | ret = usb_add_function(c, f_acm_rndis); | 166 | ret = usb_add_function(c, f_acm_rndis); |
169 | if (ret) | 167 | if (ret) |
@@ -178,7 +176,6 @@ err_fsg: | |||
178 | usb_remove_function(c, f_acm_rndis); | 176 | usb_remove_function(c, f_acm_rndis); |
179 | err_conf: | 177 | err_conf: |
180 | usb_put_function(f_acm_rndis); | 178 | usb_put_function(f_acm_rndis); |
181 | err_func_acm: | ||
182 | return ret; | 179 | return ret; |
183 | } | 180 | } |
184 | 181 | ||
@@ -226,7 +223,7 @@ static __init int cdc_do_config(struct usb_configuration *c) | |||
226 | /* implicit port_num is zero */ | 223 | /* implicit port_num is zero */ |
227 | f_acm_multi = usb_get_function(fi_acm); | 224 | f_acm_multi = usb_get_function(fi_acm); |
228 | if (IS_ERR(f_acm_multi)) | 225 | if (IS_ERR(f_acm_multi)) |
229 | goto err_func_acm; | 226 | return PTR_ERR(f_acm_multi); |
230 | 227 | ||
231 | ret = usb_add_function(c, f_acm_multi); | 228 | ret = usb_add_function(c, f_acm_multi); |
232 | if (ret) | 229 | if (ret) |
@@ -241,7 +238,6 @@ err_fsg: | |||
241 | usb_remove_function(c, f_acm_multi); | 238 | usb_remove_function(c, f_acm_multi); |
242 | err_conf: | 239 | err_conf: |
243 | usb_put_function(f_acm_multi); | 240 | usb_put_function(f_acm_multi); |
244 | err_func_acm: | ||
245 | return ret; | 241 | return ret; |
246 | } | 242 | } |
247 | 243 | ||
diff --git a/drivers/usb/gadget/udc-core.c b/drivers/usb/gadget/udc-core.c index c28ac9872030..13e25f80fc20 100644 --- a/drivers/usb/gadget/udc-core.c +++ b/drivers/usb/gadget/udc-core.c | |||
@@ -109,7 +109,7 @@ void usb_gadget_set_state(struct usb_gadget *gadget, | |||
109 | enum usb_device_state state) | 109 | enum usb_device_state state) |
110 | { | 110 | { |
111 | gadget->state = state; | 111 | gadget->state = state; |
112 | sysfs_notify(&gadget->dev.kobj, NULL, "status"); | 112 | sysfs_notify(&gadget->dev.kobj, NULL, "state"); |
113 | } | 113 | } |
114 | EXPORT_SYMBOL_GPL(usb_gadget_set_state); | 114 | EXPORT_SYMBOL_GPL(usb_gadget_set_state); |
115 | 115 | ||
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index 6708a3b78ad8..f44e8b5e00c9 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c | |||
@@ -481,7 +481,7 @@ static u64 omap2430_dmamask = DMA_BIT_MASK(32); | |||
481 | 481 | ||
482 | static int omap2430_probe(struct platform_device *pdev) | 482 | static int omap2430_probe(struct platform_device *pdev) |
483 | { | 483 | { |
484 | struct resource musb_resources[2]; | 484 | struct resource musb_resources[3]; |
485 | struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; | 485 | struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; |
486 | struct omap_musb_board_data *data; | 486 | struct omap_musb_board_data *data; |
487 | struct platform_device *musb; | 487 | struct platform_device *musb; |
@@ -581,6 +581,11 @@ static int omap2430_probe(struct platform_device *pdev) | |||
581 | musb_resources[1].end = pdev->resource[1].end; | 581 | musb_resources[1].end = pdev->resource[1].end; |
582 | musb_resources[1].flags = pdev->resource[1].flags; | 582 | musb_resources[1].flags = pdev->resource[1].flags; |
583 | 583 | ||
584 | musb_resources[2].name = pdev->resource[2].name; | ||
585 | musb_resources[2].start = pdev->resource[2].start; | ||
586 | musb_resources[2].end = pdev->resource[2].end; | ||
587 | musb_resources[2].flags = pdev->resource[2].flags; | ||
588 | |||
584 | ret = platform_device_add_resources(musb, musb_resources, | 589 | ret = platform_device_add_resources(musb, musb_resources, |
585 | ARRAY_SIZE(musb_resources)); | 590 | ARRAY_SIZE(musb_resources)); |
586 | if (ret) { | 591 | if (ret) { |
diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c index 2c06a8969a9f..6f8a9ca96ae7 100644 --- a/drivers/usb/musb/tusb6010.c +++ b/drivers/usb/musb/tusb6010.c | |||
@@ -1156,7 +1156,7 @@ static u64 tusb_dmamask = DMA_BIT_MASK(32); | |||
1156 | 1156 | ||
1157 | static int tusb_probe(struct platform_device *pdev) | 1157 | static int tusb_probe(struct platform_device *pdev) |
1158 | { | 1158 | { |
1159 | struct resource musb_resources[2]; | 1159 | struct resource musb_resources[3]; |
1160 | struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; | 1160 | struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; |
1161 | struct platform_device *musb; | 1161 | struct platform_device *musb; |
1162 | struct tusb6010_glue *glue; | 1162 | struct tusb6010_glue *glue; |
@@ -1199,6 +1199,11 @@ static int tusb_probe(struct platform_device *pdev) | |||
1199 | musb_resources[1].end = pdev->resource[1].end; | 1199 | musb_resources[1].end = pdev->resource[1].end; |
1200 | musb_resources[1].flags = pdev->resource[1].flags; | 1200 | musb_resources[1].flags = pdev->resource[1].flags; |
1201 | 1201 | ||
1202 | musb_resources[2].name = pdev->resource[2].name; | ||
1203 | musb_resources[2].start = pdev->resource[2].start; | ||
1204 | musb_resources[2].end = pdev->resource[2].end; | ||
1205 | musb_resources[2].flags = pdev->resource[2].flags; | ||
1206 | |||
1202 | ret = platform_device_add_resources(musb, musb_resources, | 1207 | ret = platform_device_add_resources(musb, musb_resources, |
1203 | ARRAY_SIZE(musb_resources)); | 1208 | ARRAY_SIZE(musb_resources)); |
1204 | if (ret) { | 1209 | if (ret) { |
diff --git a/drivers/usb/serial/Kconfig b/drivers/usb/serial/Kconfig index 8c3a42ea910c..7eef9b33fde6 100644 --- a/drivers/usb/serial/Kconfig +++ b/drivers/usb/serial/Kconfig | |||
@@ -719,6 +719,13 @@ config USB_SERIAL_FLASHLOADER | |||
719 | To compile this driver as a module, choose M here: the | 719 | To compile this driver as a module, choose M here: the |
720 | module will be called flashloader. | 720 | module will be called flashloader. |
721 | 721 | ||
722 | config USB_SERIAL_SUUNTO | ||
723 | tristate "USB Suunto ANT+ driver" | ||
724 | help | ||
725 | Say Y here if you want to use the Suunto ANT+ USB device. | ||
726 | |||
727 | To compile this driver as a module, choose M here: the | ||
728 | module will be called suunto. | ||
722 | 729 | ||
723 | config USB_SERIAL_DEBUG | 730 | config USB_SERIAL_DEBUG |
724 | tristate "USB Debugging Device" | 731 | tristate "USB Debugging Device" |
diff --git a/drivers/usb/serial/Makefile b/drivers/usb/serial/Makefile index f7130114488f..a14a870d993f 100644 --- a/drivers/usb/serial/Makefile +++ b/drivers/usb/serial/Makefile | |||
@@ -54,6 +54,7 @@ obj-$(CONFIG_USB_SERIAL_SIEMENS_MPI) += siemens_mpi.o | |||
54 | obj-$(CONFIG_USB_SERIAL_SIERRAWIRELESS) += sierra.o | 54 | obj-$(CONFIG_USB_SERIAL_SIERRAWIRELESS) += sierra.o |
55 | obj-$(CONFIG_USB_SERIAL_SPCP8X5) += spcp8x5.o | 55 | obj-$(CONFIG_USB_SERIAL_SPCP8X5) += spcp8x5.o |
56 | obj-$(CONFIG_USB_SERIAL_SSU100) += ssu100.o | 56 | obj-$(CONFIG_USB_SERIAL_SSU100) += ssu100.o |
57 | obj-$(CONFIG_USB_SERIAL_SUUNTO) += suunto.o | ||
57 | obj-$(CONFIG_USB_SERIAL_SYMBOL) += symbolserial.o | 58 | obj-$(CONFIG_USB_SERIAL_SYMBOL) += symbolserial.o |
58 | obj-$(CONFIG_USB_SERIAL_WWAN) += usb_wwan.o | 59 | obj-$(CONFIG_USB_SERIAL_WWAN) += usb_wwan.o |
59 | obj-$(CONFIG_USB_SERIAL_TI) += ti_usb_3410_5052.o | 60 | obj-$(CONFIG_USB_SERIAL_TI) += ti_usb_3410_5052.o |
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 7260ec660347..b65e657c641d 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -735,9 +735,34 @@ static struct usb_device_id id_table_combined [] = { | |||
735 | { USB_DEVICE(FTDI_VID, FTDI_NDI_AURORA_SCU_PID), | 735 | { USB_DEVICE(FTDI_VID, FTDI_NDI_AURORA_SCU_PID), |
736 | .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, | 736 | .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, |
737 | { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) }, | 737 | { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) }, |
738 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_SERIAL_VX7_PID) }, | 738 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_S03_PID) }, |
739 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_CT29B_PID) }, | 739 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_59_PID) }, |
740 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_RTS01_PID) }, | 740 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_57A_PID) }, |
741 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_57B_PID) }, | ||
742 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_29A_PID) }, | ||
743 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_29B_PID) }, | ||
744 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_29F_PID) }, | ||
745 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_62B_PID) }, | ||
746 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_S01_PID) }, | ||
747 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_63_PID) }, | ||
748 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_29C_PID) }, | ||
749 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_81B_PID) }, | ||
750 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_82B_PID) }, | ||
751 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_K5D_PID) }, | ||
752 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_K4Y_PID) }, | ||
753 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_K5G_PID) }, | ||
754 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_S05_PID) }, | ||
755 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_60_PID) }, | ||
756 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_61_PID) }, | ||
757 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_62_PID) }, | ||
758 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_63B_PID) }, | ||
759 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_64_PID) }, | ||
760 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_65_PID) }, | ||
761 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_92_PID) }, | ||
762 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_92D_PID) }, | ||
763 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_W5R_PID) }, | ||
764 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_A5R_PID) }, | ||
765 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_PW1_PID) }, | ||
741 | { USB_DEVICE(FTDI_VID, FTDI_MAXSTREAM_PID) }, | 766 | { USB_DEVICE(FTDI_VID, FTDI_MAXSTREAM_PID) }, |
742 | { USB_DEVICE(FTDI_VID, FTDI_PHI_FISCO_PID) }, | 767 | { USB_DEVICE(FTDI_VID, FTDI_PHI_FISCO_PID) }, |
743 | { USB_DEVICE(TML_VID, TML_USB_SERIAL_PID) }, | 768 | { USB_DEVICE(TML_VID, TML_USB_SERIAL_PID) }, |
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h index 6dd79253205d..1b8af461b522 100644 --- a/drivers/usb/serial/ftdi_sio_ids.h +++ b/drivers/usb/serial/ftdi_sio_ids.h | |||
@@ -815,11 +815,35 @@ | |||
815 | /* | 815 | /* |
816 | * RT Systems programming cables for various ham radios | 816 | * RT Systems programming cables for various ham radios |
817 | */ | 817 | */ |
818 | #define RTSYSTEMS_VID 0x2100 /* Vendor ID */ | 818 | #define RTSYSTEMS_VID 0x2100 /* Vendor ID */ |
819 | #define RTSYSTEMS_SERIAL_VX7_PID 0x9e52 /* Serial converter for VX-7 Radios using FT232RL */ | 819 | #define RTSYSTEMS_USB_S03_PID 0x9001 /* RTS-03 USB to Serial Adapter */ |
820 | #define RTSYSTEMS_CT29B_PID 0x9e54 /* CT29B Radio Cable */ | 820 | #define RTSYSTEMS_USB_59_PID 0x9e50 /* USB-59 USB to 8 pin plug */ |
821 | #define RTSYSTEMS_RTS01_PID 0x9e57 /* USB-RTS01 Radio Cable */ | 821 | #define RTSYSTEMS_USB_57A_PID 0x9e51 /* USB-57A USB to 4pin 3.5mm plug */ |
822 | 822 | #define RTSYSTEMS_USB_57B_PID 0x9e52 /* USB-57B USB to extended 4pin 3.5mm plug */ | |
823 | #define RTSYSTEMS_USB_29A_PID 0x9e53 /* USB-29A USB to 3.5mm stereo plug */ | ||
824 | #define RTSYSTEMS_USB_29B_PID 0x9e54 /* USB-29B USB to 6 pin mini din */ | ||
825 | #define RTSYSTEMS_USB_29F_PID 0x9e55 /* USB-29F USB to 6 pin modular plug */ | ||
826 | #define RTSYSTEMS_USB_62B_PID 0x9e56 /* USB-62B USB to 8 pin mini din plug*/ | ||
827 | #define RTSYSTEMS_USB_S01_PID 0x9e57 /* USB-RTS01 USB to 3.5 mm stereo plug*/ | ||
828 | #define RTSYSTEMS_USB_63_PID 0x9e58 /* USB-63 USB to 9 pin female*/ | ||
829 | #define RTSYSTEMS_USB_29C_PID 0x9e59 /* USB-29C USB to 4 pin modular plug*/ | ||
830 | #define RTSYSTEMS_USB_81B_PID 0x9e5A /* USB-81 USB to 8 pin mini din plug*/ | ||
831 | #define RTSYSTEMS_USB_82B_PID 0x9e5B /* USB-82 USB to 2.5 mm stereo plug*/ | ||
832 | #define RTSYSTEMS_USB_K5D_PID 0x9e5C /* USB-K5D USB to 8 pin modular plug*/ | ||
833 | #define RTSYSTEMS_USB_K4Y_PID 0x9e5D /* USB-K4Y USB to 2.5/3.5 mm plugs*/ | ||
834 | #define RTSYSTEMS_USB_K5G_PID 0x9e5E /* USB-K5G USB to 8 pin modular plug*/ | ||
835 | #define RTSYSTEMS_USB_S05_PID 0x9e5F /* USB-RTS05 USB to 2.5 mm stereo plug*/ | ||
836 | #define RTSYSTEMS_USB_60_PID 0x9e60 /* USB-60 USB to 6 pin din*/ | ||
837 | #define RTSYSTEMS_USB_61_PID 0x9e61 /* USB-61 USB to 6 pin mini din*/ | ||
838 | #define RTSYSTEMS_USB_62_PID 0x9e62 /* USB-62 USB to 8 pin mini din*/ | ||
839 | #define RTSYSTEMS_USB_63B_PID 0x9e63 /* USB-63 USB to 9 pin female*/ | ||
840 | #define RTSYSTEMS_USB_64_PID 0x9e64 /* USB-64 USB to 9 pin male*/ | ||
841 | #define RTSYSTEMS_USB_65_PID 0x9e65 /* USB-65 USB to 9 pin female null modem*/ | ||
842 | #define RTSYSTEMS_USB_92_PID 0x9e66 /* USB-92 USB to 12 pin plug*/ | ||
843 | #define RTSYSTEMS_USB_92D_PID 0x9e67 /* USB-92D USB to 12 pin plug data*/ | ||
844 | #define RTSYSTEMS_USB_W5R_PID 0x9e68 /* USB-W5R USB to 8 pin modular plug*/ | ||
845 | #define RTSYSTEMS_USB_A5R_PID 0x9e69 /* USB-A5R USB to 8 pin modular plug*/ | ||
846 | #define RTSYSTEMS_USB_PW1_PID 0x9e6A /* USB-PW1 USB to 8 pin modular plug*/ | ||
823 | 847 | ||
824 | /* | 848 | /* |
825 | * Physik Instrumente | 849 | * Physik Instrumente |
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c index 603fb70dde80..d953d674f222 100644 --- a/drivers/usb/serial/mos7840.c +++ b/drivers/usb/serial/mos7840.c | |||
@@ -183,7 +183,10 @@ | |||
183 | #define LED_ON_MS 500 | 183 | #define LED_ON_MS 500 |
184 | #define LED_OFF_MS 500 | 184 | #define LED_OFF_MS 500 |
185 | 185 | ||
186 | static int device_type; | 186 | enum mos7840_flag { |
187 | MOS7840_FLAG_CTRL_BUSY, | ||
188 | MOS7840_FLAG_LED_BUSY, | ||
189 | }; | ||
187 | 190 | ||
188 | static const struct usb_device_id id_table[] = { | 191 | static const struct usb_device_id id_table[] = { |
189 | {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7840)}, | 192 | {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7840)}, |
@@ -238,9 +241,12 @@ struct moschip_port { | |||
238 | 241 | ||
239 | /* For device(s) with LED indicator */ | 242 | /* For device(s) with LED indicator */ |
240 | bool has_led; | 243 | bool has_led; |
241 | bool led_flag; | ||
242 | struct timer_list led_timer1; /* Timer for LED on */ | 244 | struct timer_list led_timer1; /* Timer for LED on */ |
243 | struct timer_list led_timer2; /* Timer for LED off */ | 245 | struct timer_list led_timer2; /* Timer for LED off */ |
246 | struct urb *led_urb; | ||
247 | struct usb_ctrlrequest *led_dr; | ||
248 | |||
249 | unsigned long flags; | ||
244 | }; | 250 | }; |
245 | 251 | ||
246 | /* | 252 | /* |
@@ -460,10 +466,10 @@ static void mos7840_control_callback(struct urb *urb) | |||
460 | case -ESHUTDOWN: | 466 | case -ESHUTDOWN: |
461 | /* this urb is terminated, clean up */ | 467 | /* this urb is terminated, clean up */ |
462 | dev_dbg(dev, "%s - urb shutting down with status: %d\n", __func__, status); | 468 | dev_dbg(dev, "%s - urb shutting down with status: %d\n", __func__, status); |
463 | return; | 469 | goto out; |
464 | default: | 470 | default: |
465 | dev_dbg(dev, "%s - nonzero urb status received: %d\n", __func__, status); | 471 | dev_dbg(dev, "%s - nonzero urb status received: %d\n", __func__, status); |
466 | return; | 472 | goto out; |
467 | } | 473 | } |
468 | 474 | ||
469 | dev_dbg(dev, "%s urb buffer size is %d\n", __func__, urb->actual_length); | 475 | dev_dbg(dev, "%s urb buffer size is %d\n", __func__, urb->actual_length); |
@@ -476,6 +482,8 @@ static void mos7840_control_callback(struct urb *urb) | |||
476 | mos7840_handle_new_msr(mos7840_port, regval); | 482 | mos7840_handle_new_msr(mos7840_port, regval); |
477 | else if (mos7840_port->MsrLsr == 1) | 483 | else if (mos7840_port->MsrLsr == 1) |
478 | mos7840_handle_new_lsr(mos7840_port, regval); | 484 | mos7840_handle_new_lsr(mos7840_port, regval); |
485 | out: | ||
486 | clear_bit_unlock(MOS7840_FLAG_CTRL_BUSY, &mos7840_port->flags); | ||
479 | } | 487 | } |
480 | 488 | ||
481 | static int mos7840_get_reg(struct moschip_port *mcs, __u16 Wval, __u16 reg, | 489 | static int mos7840_get_reg(struct moschip_port *mcs, __u16 Wval, __u16 reg, |
@@ -486,6 +494,9 @@ static int mos7840_get_reg(struct moschip_port *mcs, __u16 Wval, __u16 reg, | |||
486 | unsigned char *buffer = mcs->ctrl_buf; | 494 | unsigned char *buffer = mcs->ctrl_buf; |
487 | int ret; | 495 | int ret; |
488 | 496 | ||
497 | if (test_and_set_bit_lock(MOS7840_FLAG_CTRL_BUSY, &mcs->flags)) | ||
498 | return -EBUSY; | ||
499 | |||
489 | dr->bRequestType = MCS_RD_RTYPE; | 500 | dr->bRequestType = MCS_RD_RTYPE; |
490 | dr->bRequest = MCS_RDREQ; | 501 | dr->bRequest = MCS_RDREQ; |
491 | dr->wValue = cpu_to_le16(Wval); /* 0 */ | 502 | dr->wValue = cpu_to_le16(Wval); /* 0 */ |
@@ -497,6 +508,9 @@ static int mos7840_get_reg(struct moschip_port *mcs, __u16 Wval, __u16 reg, | |||
497 | mos7840_control_callback, mcs); | 508 | mos7840_control_callback, mcs); |
498 | mcs->control_urb->transfer_buffer_length = 2; | 509 | mcs->control_urb->transfer_buffer_length = 2; |
499 | ret = usb_submit_urb(mcs->control_urb, GFP_ATOMIC); | 510 | ret = usb_submit_urb(mcs->control_urb, GFP_ATOMIC); |
511 | if (ret) | ||
512 | clear_bit_unlock(MOS7840_FLAG_CTRL_BUSY, &mcs->flags); | ||
513 | |||
500 | return ret; | 514 | return ret; |
501 | } | 515 | } |
502 | 516 | ||
@@ -523,7 +537,7 @@ static void mos7840_set_led_async(struct moschip_port *mcs, __u16 wval, | |||
523 | __u16 reg) | 537 | __u16 reg) |
524 | { | 538 | { |
525 | struct usb_device *dev = mcs->port->serial->dev; | 539 | struct usb_device *dev = mcs->port->serial->dev; |
526 | struct usb_ctrlrequest *dr = mcs->dr; | 540 | struct usb_ctrlrequest *dr = mcs->led_dr; |
527 | 541 | ||
528 | dr->bRequestType = MCS_WR_RTYPE; | 542 | dr->bRequestType = MCS_WR_RTYPE; |
529 | dr->bRequest = MCS_WRREQ; | 543 | dr->bRequest = MCS_WRREQ; |
@@ -531,10 +545,10 @@ static void mos7840_set_led_async(struct moschip_port *mcs, __u16 wval, | |||
531 | dr->wIndex = cpu_to_le16(reg); | 545 | dr->wIndex = cpu_to_le16(reg); |
532 | dr->wLength = cpu_to_le16(0); | 546 | dr->wLength = cpu_to_le16(0); |
533 | 547 | ||
534 | usb_fill_control_urb(mcs->control_urb, dev, usb_sndctrlpipe(dev, 0), | 548 | usb_fill_control_urb(mcs->led_urb, dev, usb_sndctrlpipe(dev, 0), |
535 | (unsigned char *)dr, NULL, 0, mos7840_set_led_callback, NULL); | 549 | (unsigned char *)dr, NULL, 0, mos7840_set_led_callback, NULL); |
536 | 550 | ||
537 | usb_submit_urb(mcs->control_urb, GFP_ATOMIC); | 551 | usb_submit_urb(mcs->led_urb, GFP_ATOMIC); |
538 | } | 552 | } |
539 | 553 | ||
540 | static void mos7840_set_led_sync(struct usb_serial_port *port, __u16 reg, | 554 | static void mos7840_set_led_sync(struct usb_serial_port *port, __u16 reg, |
@@ -560,7 +574,19 @@ static void mos7840_led_flag_off(unsigned long arg) | |||
560 | { | 574 | { |
561 | struct moschip_port *mcs = (struct moschip_port *) arg; | 575 | struct moschip_port *mcs = (struct moschip_port *) arg; |
562 | 576 | ||
563 | mcs->led_flag = false; | 577 | clear_bit_unlock(MOS7840_FLAG_LED_BUSY, &mcs->flags); |
578 | } | ||
579 | |||
580 | static void mos7840_led_activity(struct usb_serial_port *port) | ||
581 | { | ||
582 | struct moschip_port *mos7840_port = usb_get_serial_port_data(port); | ||
583 | |||
584 | if (test_and_set_bit_lock(MOS7840_FLAG_LED_BUSY, &mos7840_port->flags)) | ||
585 | return; | ||
586 | |||
587 | mos7840_set_led_async(mos7840_port, 0x0301, MODEM_CONTROL_REGISTER); | ||
588 | mod_timer(&mos7840_port->led_timer1, | ||
589 | jiffies + msecs_to_jiffies(LED_ON_MS)); | ||
564 | } | 590 | } |
565 | 591 | ||
566 | /***************************************************************************** | 592 | /***************************************************************************** |
@@ -758,14 +784,8 @@ static void mos7840_bulk_in_callback(struct urb *urb) | |||
758 | return; | 784 | return; |
759 | } | 785 | } |
760 | 786 | ||
761 | /* Turn on LED */ | 787 | if (mos7840_port->has_led) |
762 | if (mos7840_port->has_led && !mos7840_port->led_flag) { | 788 | mos7840_led_activity(port); |
763 | mos7840_port->led_flag = true; | ||
764 | mos7840_set_led_async(mos7840_port, 0x0301, | ||
765 | MODEM_CONTROL_REGISTER); | ||
766 | mod_timer(&mos7840_port->led_timer1, | ||
767 | jiffies + msecs_to_jiffies(LED_ON_MS)); | ||
768 | } | ||
769 | 789 | ||
770 | mos7840_port->read_urb_busy = true; | 790 | mos7840_port->read_urb_busy = true; |
771 | retval = usb_submit_urb(mos7840_port->read_urb, GFP_ATOMIC); | 791 | retval = usb_submit_urb(mos7840_port->read_urb, GFP_ATOMIC); |
@@ -816,18 +836,6 @@ static void mos7840_bulk_out_data_callback(struct urb *urb) | |||
816 | /************************************************************************/ | 836 | /************************************************************************/ |
817 | /* D R I V E R T T Y I N T E R F A C E F U N C T I O N S */ | 837 | /* D R I V E R T T Y I N T E R F A C E F U N C T I O N S */ |
818 | /************************************************************************/ | 838 | /************************************************************************/ |
819 | #ifdef MCSSerialProbe | ||
820 | static int mos7840_serial_probe(struct usb_serial *serial, | ||
821 | const struct usb_device_id *id) | ||
822 | { | ||
823 | |||
824 | /*need to implement the mode_reg reading and updating\ | ||
825 | structures usb_serial_ device_type\ | ||
826 | (i.e num_ports, num_bulkin,bulkout etc) */ | ||
827 | /* Also we can update the changes attach */ | ||
828 | return 1; | ||
829 | } | ||
830 | #endif | ||
831 | 839 | ||
832 | /***************************************************************************** | 840 | /***************************************************************************** |
833 | * mos7840_open | 841 | * mos7840_open |
@@ -1454,13 +1462,8 @@ static int mos7840_write(struct tty_struct *tty, struct usb_serial_port *port, | |||
1454 | data1 = urb->transfer_buffer; | 1462 | data1 = urb->transfer_buffer; |
1455 | dev_dbg(&port->dev, "bulkout endpoint is %d\n", port->bulk_out_endpointAddress); | 1463 | dev_dbg(&port->dev, "bulkout endpoint is %d\n", port->bulk_out_endpointAddress); |
1456 | 1464 | ||
1457 | /* Turn on LED */ | 1465 | if (mos7840_port->has_led) |
1458 | if (mos7840_port->has_led && !mos7840_port->led_flag) { | 1466 | mos7840_led_activity(port); |
1459 | mos7840_port->led_flag = true; | ||
1460 | mos7840_set_led_sync(port, MODEM_CONTROL_REGISTER, 0x0301); | ||
1461 | mod_timer(&mos7840_port->led_timer1, | ||
1462 | jiffies + msecs_to_jiffies(LED_ON_MS)); | ||
1463 | } | ||
1464 | 1467 | ||
1465 | /* send it down the pipe */ | 1468 | /* send it down the pipe */ |
1466 | status = usb_submit_urb(urb, GFP_ATOMIC); | 1469 | status = usb_submit_urb(urb, GFP_ATOMIC); |
@@ -2187,38 +2190,48 @@ static int mos7810_check(struct usb_serial *serial) | |||
2187 | return 0; | 2190 | return 0; |
2188 | } | 2191 | } |
2189 | 2192 | ||
2190 | static int mos7840_calc_num_ports(struct usb_serial *serial) | 2193 | static int mos7840_probe(struct usb_serial *serial, |
2194 | const struct usb_device_id *id) | ||
2191 | { | 2195 | { |
2192 | __u16 data = 0x00; | 2196 | u16 product = serial->dev->descriptor.idProduct; |
2193 | u8 *buf; | 2197 | u8 *buf; |
2194 | int mos7840_num_ports; | 2198 | int device_type; |
2199 | |||
2200 | if (product == MOSCHIP_DEVICE_ID_7810 || | ||
2201 | product == MOSCHIP_DEVICE_ID_7820) { | ||
2202 | device_type = product; | ||
2203 | goto out; | ||
2204 | } | ||
2195 | 2205 | ||
2196 | buf = kzalloc(VENDOR_READ_LENGTH, GFP_KERNEL); | 2206 | buf = kzalloc(VENDOR_READ_LENGTH, GFP_KERNEL); |
2197 | if (buf) { | 2207 | if (!buf) |
2198 | usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), | 2208 | return -ENOMEM; |
2209 | |||
2210 | usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), | ||
2199 | MCS_RDREQ, MCS_RD_RTYPE, 0, GPIO_REGISTER, buf, | 2211 | MCS_RDREQ, MCS_RD_RTYPE, 0, GPIO_REGISTER, buf, |
2200 | VENDOR_READ_LENGTH, MOS_WDR_TIMEOUT); | 2212 | VENDOR_READ_LENGTH, MOS_WDR_TIMEOUT); |
2201 | data = *buf; | ||
2202 | kfree(buf); | ||
2203 | } | ||
2204 | 2213 | ||
2205 | if (serial->dev->descriptor.idProduct == MOSCHIP_DEVICE_ID_7810 || | 2214 | /* For a MCS7840 device GPIO0 must be set to 1 */ |
2206 | serial->dev->descriptor.idProduct == MOSCHIP_DEVICE_ID_7820) { | 2215 | if (buf[0] & 0x01) |
2207 | device_type = serial->dev->descriptor.idProduct; | 2216 | device_type = MOSCHIP_DEVICE_ID_7840; |
2208 | } else { | 2217 | else if (mos7810_check(serial)) |
2209 | /* For a MCS7840 device GPIO0 must be set to 1 */ | 2218 | device_type = MOSCHIP_DEVICE_ID_7810; |
2210 | if ((data & 0x01) == 1) | 2219 | else |
2211 | device_type = MOSCHIP_DEVICE_ID_7840; | 2220 | device_type = MOSCHIP_DEVICE_ID_7820; |
2212 | else if (mos7810_check(serial)) | 2221 | |
2213 | device_type = MOSCHIP_DEVICE_ID_7810; | 2222 | kfree(buf); |
2214 | else | 2223 | out: |
2215 | device_type = MOSCHIP_DEVICE_ID_7820; | 2224 | usb_set_serial_data(serial, (void *)(unsigned long)device_type); |
2216 | } | 2225 | |
2226 | return 0; | ||
2227 | } | ||
2228 | |||
2229 | static int mos7840_calc_num_ports(struct usb_serial *serial) | ||
2230 | { | ||
2231 | int device_type = (unsigned long)usb_get_serial_data(serial); | ||
2232 | int mos7840_num_ports; | ||
2217 | 2233 | ||
2218 | mos7840_num_ports = (device_type >> 4) & 0x000F; | 2234 | mos7840_num_ports = (device_type >> 4) & 0x000F; |
2219 | serial->num_bulk_in = mos7840_num_ports; | ||
2220 | serial->num_bulk_out = mos7840_num_ports; | ||
2221 | serial->num_ports = mos7840_num_ports; | ||
2222 | 2235 | ||
2223 | return mos7840_num_ports; | 2236 | return mos7840_num_ports; |
2224 | } | 2237 | } |
@@ -2226,6 +2239,7 @@ static int mos7840_calc_num_ports(struct usb_serial *serial) | |||
2226 | static int mos7840_port_probe(struct usb_serial_port *port) | 2239 | static int mos7840_port_probe(struct usb_serial_port *port) |
2227 | { | 2240 | { |
2228 | struct usb_serial *serial = port->serial; | 2241 | struct usb_serial *serial = port->serial; |
2242 | int device_type = (unsigned long)usb_get_serial_data(serial); | ||
2229 | struct moschip_port *mos7840_port; | 2243 | struct moschip_port *mos7840_port; |
2230 | int status; | 2244 | int status; |
2231 | int pnum; | 2245 | int pnum; |
@@ -2401,6 +2415,14 @@ static int mos7840_port_probe(struct usb_serial_port *port) | |||
2401 | if (device_type == MOSCHIP_DEVICE_ID_7810) { | 2415 | if (device_type == MOSCHIP_DEVICE_ID_7810) { |
2402 | mos7840_port->has_led = true; | 2416 | mos7840_port->has_led = true; |
2403 | 2417 | ||
2418 | mos7840_port->led_urb = usb_alloc_urb(0, GFP_KERNEL); | ||
2419 | mos7840_port->led_dr = kmalloc(sizeof(*mos7840_port->led_dr), | ||
2420 | GFP_KERNEL); | ||
2421 | if (!mos7840_port->led_urb || !mos7840_port->led_dr) { | ||
2422 | status = -ENOMEM; | ||
2423 | goto error; | ||
2424 | } | ||
2425 | |||
2404 | init_timer(&mos7840_port->led_timer1); | 2426 | init_timer(&mos7840_port->led_timer1); |
2405 | mos7840_port->led_timer1.function = mos7840_led_off; | 2427 | mos7840_port->led_timer1.function = mos7840_led_off; |
2406 | mos7840_port->led_timer1.expires = | 2428 | mos7840_port->led_timer1.expires = |
@@ -2413,8 +2435,6 @@ static int mos7840_port_probe(struct usb_serial_port *port) | |||
2413 | jiffies + msecs_to_jiffies(LED_OFF_MS); | 2435 | jiffies + msecs_to_jiffies(LED_OFF_MS); |
2414 | mos7840_port->led_timer2.data = (unsigned long)mos7840_port; | 2436 | mos7840_port->led_timer2.data = (unsigned long)mos7840_port; |
2415 | 2437 | ||
2416 | mos7840_port->led_flag = false; | ||
2417 | |||
2418 | /* Turn off LED */ | 2438 | /* Turn off LED */ |
2419 | mos7840_set_led_sync(port, MODEM_CONTROL_REGISTER, 0x0300); | 2439 | mos7840_set_led_sync(port, MODEM_CONTROL_REGISTER, 0x0300); |
2420 | } | 2440 | } |
@@ -2436,6 +2456,8 @@ out: | |||
2436 | } | 2456 | } |
2437 | return 0; | 2457 | return 0; |
2438 | error: | 2458 | error: |
2459 | kfree(mos7840_port->led_dr); | ||
2460 | usb_free_urb(mos7840_port->led_urb); | ||
2439 | kfree(mos7840_port->dr); | 2461 | kfree(mos7840_port->dr); |
2440 | kfree(mos7840_port->ctrl_buf); | 2462 | kfree(mos7840_port->ctrl_buf); |
2441 | usb_free_urb(mos7840_port->control_urb); | 2463 | usb_free_urb(mos7840_port->control_urb); |
@@ -2456,6 +2478,10 @@ static int mos7840_port_remove(struct usb_serial_port *port) | |||
2456 | 2478 | ||
2457 | del_timer_sync(&mos7840_port->led_timer1); | 2479 | del_timer_sync(&mos7840_port->led_timer1); |
2458 | del_timer_sync(&mos7840_port->led_timer2); | 2480 | del_timer_sync(&mos7840_port->led_timer2); |
2481 | |||
2482 | usb_kill_urb(mos7840_port->led_urb); | ||
2483 | usb_free_urb(mos7840_port->led_urb); | ||
2484 | kfree(mos7840_port->led_dr); | ||
2459 | } | 2485 | } |
2460 | usb_kill_urb(mos7840_port->control_urb); | 2486 | usb_kill_urb(mos7840_port->control_urb); |
2461 | usb_free_urb(mos7840_port->control_urb); | 2487 | usb_free_urb(mos7840_port->control_urb); |
@@ -2482,9 +2508,7 @@ static struct usb_serial_driver moschip7840_4port_device = { | |||
2482 | .throttle = mos7840_throttle, | 2508 | .throttle = mos7840_throttle, |
2483 | .unthrottle = mos7840_unthrottle, | 2509 | .unthrottle = mos7840_unthrottle, |
2484 | .calc_num_ports = mos7840_calc_num_ports, | 2510 | .calc_num_ports = mos7840_calc_num_ports, |
2485 | #ifdef MCSSerialProbe | 2511 | .probe = mos7840_probe, |
2486 | .probe = mos7840_serial_probe, | ||
2487 | #endif | ||
2488 | .ioctl = mos7840_ioctl, | 2512 | .ioctl = mos7840_ioctl, |
2489 | .set_termios = mos7840_set_termios, | 2513 | .set_termios = mos7840_set_termios, |
2490 | .break_ctl = mos7840_break, | 2514 | .break_ctl = mos7840_break, |
diff --git a/drivers/usb/serial/suunto.c b/drivers/usb/serial/suunto.c new file mode 100644 index 000000000000..2248e7a7d5ad --- /dev/null +++ b/drivers/usb/serial/suunto.c | |||
@@ -0,0 +1,41 @@ | |||
1 | /* | ||
2 | * Suunto ANT+ USB Driver | ||
3 | * | ||
4 | * Copyright (C) 2013 Greg Kroah-Hartman <gregkh@linuxfoundation.org> | ||
5 | * Copyright (C) 2013 Linux Foundation | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License version 2 as published by | ||
9 | * the Free Software Foundation only. | ||
10 | */ | ||
11 | |||
12 | #include <linux/kernel.h> | ||
13 | #include <linux/init.h> | ||
14 | #include <linux/tty.h> | ||
15 | #include <linux/module.h> | ||
16 | #include <linux/usb.h> | ||
17 | #include <linux/usb/serial.h> | ||
18 | #include <linux/uaccess.h> | ||
19 | |||
20 | static const struct usb_device_id id_table[] = { | ||
21 | { USB_DEVICE(0x0fcf, 0x1008) }, | ||
22 | { }, | ||
23 | }; | ||
24 | MODULE_DEVICE_TABLE(usb, id_table); | ||
25 | |||
26 | static struct usb_serial_driver suunto_device = { | ||
27 | .driver = { | ||
28 | .owner = THIS_MODULE, | ||
29 | .name = KBUILD_MODNAME, | ||
30 | }, | ||
31 | .id_table = id_table, | ||
32 | .num_ports = 1, | ||
33 | }; | ||
34 | |||
35 | static struct usb_serial_driver * const serial_drivers[] = { | ||
36 | &suunto_device, | ||
37 | NULL, | ||
38 | }; | ||
39 | |||
40 | module_usb_serial_driver(serial_drivers, id_table); | ||
41 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c index c5179e269df6..cef6002acbd4 100644 --- a/drivers/vfio/pci/vfio_pci.c +++ b/drivers/vfio/pci/vfio_pci.c | |||
@@ -137,8 +137,27 @@ static void vfio_pci_disable(struct vfio_pci_device *vdev) | |||
137 | */ | 137 | */ |
138 | pci_write_config_word(pdev, PCI_COMMAND, PCI_COMMAND_INTX_DISABLE); | 138 | pci_write_config_word(pdev, PCI_COMMAND, PCI_COMMAND_INTX_DISABLE); |
139 | 139 | ||
140 | if (vdev->reset_works) | 140 | /* |
141 | __pci_reset_function(pdev); | 141 | * Careful, device_lock may already be held. This is the case if |
142 | * a driver unbind is blocked. Try to get the locks ourselves to | ||
143 | * prevent a deadlock. | ||
144 | */ | ||
145 | if (vdev->reset_works) { | ||
146 | bool reset_done = false; | ||
147 | |||
148 | if (pci_cfg_access_trylock(pdev)) { | ||
149 | if (device_trylock(&pdev->dev)) { | ||
150 | __pci_reset_function_locked(pdev); | ||
151 | reset_done = true; | ||
152 | device_unlock(&pdev->dev); | ||
153 | } | ||
154 | pci_cfg_access_unlock(pdev); | ||
155 | } | ||
156 | |||
157 | if (!reset_done) | ||
158 | pr_warn("%s: Unable to acquire locks for reset of %s\n", | ||
159 | __func__, dev_name(&pdev->dev)); | ||
160 | } | ||
142 | 161 | ||
143 | pci_restore_state(pdev); | 162 | pci_restore_state(pdev); |
144 | } | 163 | } |
diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c index c488da5db7c7..842f4507883e 100644 --- a/drivers/vfio/vfio.c +++ b/drivers/vfio/vfio.c | |||
@@ -494,27 +494,6 @@ static int vfio_group_nb_add_dev(struct vfio_group *group, struct device *dev) | |||
494 | return 0; | 494 | return 0; |
495 | } | 495 | } |
496 | 496 | ||
497 | static int vfio_group_nb_del_dev(struct vfio_group *group, struct device *dev) | ||
498 | { | ||
499 | struct vfio_device *device; | ||
500 | |||
501 | /* | ||
502 | * Expect to fall out here. If a device was in use, it would | ||
503 | * have been bound to a vfio sub-driver, which would have blocked | ||
504 | * in .remove at vfio_del_group_dev. Sanity check that we no | ||
505 | * longer track the device, so it's safe to remove. | ||
506 | */ | ||
507 | device = vfio_group_get_device(group, dev); | ||
508 | if (likely(!device)) | ||
509 | return 0; | ||
510 | |||
511 | WARN("Device %s removed from live group %d!\n", dev_name(dev), | ||
512 | iommu_group_id(group->iommu_group)); | ||
513 | |||
514 | vfio_device_put(device); | ||
515 | return 0; | ||
516 | } | ||
517 | |||
518 | static int vfio_group_nb_verify(struct vfio_group *group, struct device *dev) | 497 | static int vfio_group_nb_verify(struct vfio_group *group, struct device *dev) |
519 | { | 498 | { |
520 | /* We don't care what happens when the group isn't in use */ | 499 | /* We don't care what happens when the group isn't in use */ |
@@ -531,13 +510,11 @@ static int vfio_iommu_group_notifier(struct notifier_block *nb, | |||
531 | struct device *dev = data; | 510 | struct device *dev = data; |
532 | 511 | ||
533 | /* | 512 | /* |
534 | * Need to go through a group_lock lookup to get a reference or | 513 | * Need to go through a group_lock lookup to get a reference or we |
535 | * we risk racing a group being removed. Leave a WARN_ON for | 514 | * risk racing a group being removed. Ignore spurious notifies. |
536 | * debuging, but if the group no longer exists, a spurious notify | ||
537 | * is harmless. | ||
538 | */ | 515 | */ |
539 | group = vfio_group_try_get(group); | 516 | group = vfio_group_try_get(group); |
540 | if (WARN_ON(!group)) | 517 | if (!group) |
541 | return NOTIFY_OK; | 518 | return NOTIFY_OK; |
542 | 519 | ||
543 | switch (action) { | 520 | switch (action) { |
@@ -545,7 +522,13 @@ static int vfio_iommu_group_notifier(struct notifier_block *nb, | |||
545 | vfio_group_nb_add_dev(group, dev); | 522 | vfio_group_nb_add_dev(group, dev); |
546 | break; | 523 | break; |
547 | case IOMMU_GROUP_NOTIFY_DEL_DEVICE: | 524 | case IOMMU_GROUP_NOTIFY_DEL_DEVICE: |
548 | vfio_group_nb_del_dev(group, dev); | 525 | /* |
526 | * Nothing to do here. If the device is in use, then the | ||
527 | * vfio sub-driver should block the remove callback until | ||
528 | * it is unused. If the device is unused or attached to a | ||
529 | * stub driver, then it should be released and we don't | ||
530 | * care that it will be going away. | ||
531 | */ | ||
549 | break; | 532 | break; |
550 | case IOMMU_GROUP_NOTIFY_BIND_DRIVER: | 533 | case IOMMU_GROUP_NOTIFY_BIND_DRIVER: |
551 | pr_debug("%s: Device %s, group %d binding to driver\n", | 534 | pr_debug("%s: Device %s, group %d binding to driver\n", |
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c index a89c15de9f45..9b0f12c5c284 100644 --- a/drivers/video/aty/atyfb_base.c +++ b/drivers/video/aty/atyfb_base.c | |||
@@ -435,8 +435,8 @@ static int correct_chipset(struct atyfb_par *par) | |||
435 | const char *name; | 435 | const char *name; |
436 | int i; | 436 | int i; |
437 | 437 | ||
438 | for (i = ARRAY_SIZE(aty_chips); i > 0; i--) | 438 | for (i = (int)ARRAY_SIZE(aty_chips) - 1; i >= 0; i--) |
439 | if (par->pci_id == aty_chips[i - 1].pci_id) | 439 | if (par->pci_id == aty_chips[i].pci_id) |
440 | break; | 440 | break; |
441 | 441 | ||
442 | if (i < 0) | 442 | if (i < 0) |
diff --git a/drivers/video/nuc900fb.c b/drivers/video/nuc900fb.c index 8c527e5b293c..796e5112ceee 100644 --- a/drivers/video/nuc900fb.c +++ b/drivers/video/nuc900fb.c | |||
@@ -587,8 +587,7 @@ static int nuc900fb_probe(struct platform_device *pdev) | |||
587 | fbinfo->flags = FBINFO_FLAG_DEFAULT; | 587 | fbinfo->flags = FBINFO_FLAG_DEFAULT; |
588 | fbinfo->pseudo_palette = &fbi->pseudo_pal; | 588 | fbinfo->pseudo_palette = &fbi->pseudo_pal; |
589 | 589 | ||
590 | ret = request_irq(irq, nuc900fb_irqhandler, 0, | 590 | ret = request_irq(irq, nuc900fb_irqhandler, 0, pdev->name, fbi); |
591 | pdev->name, fbinfo); | ||
592 | if (ret) { | 591 | if (ret) { |
593 | dev_err(&pdev->dev, "cannot register irq handler %d -err %d\n", | 592 | dev_err(&pdev->dev, "cannot register irq handler %d -err %d\n", |
594 | irq, ret); | 593 | irq, ret); |
diff --git a/drivers/video/sgivwfb.c b/drivers/video/sgivwfb.c index b2a8912f6435..a9ac3ce2d0e9 100644 --- a/drivers/video/sgivwfb.c +++ b/drivers/video/sgivwfb.c | |||
@@ -713,7 +713,7 @@ static int sgivwfb_mmap(struct fb_info *info, | |||
713 | r = vm_iomap_memory(vma, sgivwfb_mem_phys, sgivwfb_mem_size); | 713 | r = vm_iomap_memory(vma, sgivwfb_mem_phys, sgivwfb_mem_size); |
714 | 714 | ||
715 | printk(KERN_DEBUG "sgivwfb: mmap framebuffer P(%lx)->V(%lx)\n", | 715 | printk(KERN_DEBUG "sgivwfb: mmap framebuffer P(%lx)->V(%lx)\n", |
716 | offset, vma->vm_start); | 716 | sgivwfb_mem_phys + (vma->vm_pgoff << PAGE_SHIFT), vma->vm_start); |
717 | 717 | ||
718 | return r; | 718 | return r; |
719 | } | 719 | } |
diff --git a/drivers/video/sh7760fb.c b/drivers/video/sh7760fb.c index a8c6c43a4658..1265b25f9f99 100644 --- a/drivers/video/sh7760fb.c +++ b/drivers/video/sh7760fb.c | |||
@@ -567,7 +567,7 @@ static int sh7760fb_remove(struct platform_device *dev) | |||
567 | fb_dealloc_cmap(&info->cmap); | 567 | fb_dealloc_cmap(&info->cmap); |
568 | sh7760fb_free_mem(info); | 568 | sh7760fb_free_mem(info); |
569 | if (par->irq >= 0) | 569 | if (par->irq >= 0) |
570 | free_irq(par->irq, par); | 570 | free_irq(par->irq, &par->vsync); |
571 | iounmap(par->base); | 571 | iounmap(par->base); |
572 | release_mem_region(par->ioarea->start, resource_size(par->ioarea)); | 572 | release_mem_region(par->ioarea->start, resource_size(par->ioarea)); |
573 | framebuffer_release(info); | 573 | framebuffer_release(info); |
diff --git a/drivers/video/vga16fb.c b/drivers/video/vga16fb.c index 830ded45fd47..2827333703d9 100644 --- a/drivers/video/vga16fb.c +++ b/drivers/video/vga16fb.c | |||
@@ -1265,7 +1265,6 @@ static void vga16fb_imageblit(struct fb_info *info, const struct fb_image *image | |||
1265 | 1265 | ||
1266 | static void vga16fb_destroy(struct fb_info *info) | 1266 | static void vga16fb_destroy(struct fb_info *info) |
1267 | { | 1267 | { |
1268 | struct platform_device *dev = container_of(info->device, struct platform_device, dev); | ||
1269 | iounmap(info->screen_base); | 1268 | iounmap(info->screen_base); |
1270 | fb_dealloc_cmap(&info->cmap); | 1269 | fb_dealloc_cmap(&info->cmap); |
1271 | /* XXX unshare VGA regions */ | 1270 | /* XXX unshare VGA regions */ |
diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c index f3d4a69e1e4e..6629b29a8202 100644 --- a/drivers/video/xilinxfb.c +++ b/drivers/video/xilinxfb.c | |||
@@ -341,8 +341,8 @@ static int xilinxfb_assign(struct platform_device *pdev, | |||
341 | 341 | ||
342 | if (drvdata->flags & BUS_ACCESS_FLAG) { | 342 | if (drvdata->flags & BUS_ACCESS_FLAG) { |
343 | /* Put a banner in the log (for DEBUG) */ | 343 | /* Put a banner in the log (for DEBUG) */ |
344 | dev_dbg(dev, "regs: phys=%x, virt=%p\n", drvdata->regs_phys, | 344 | dev_dbg(dev, "regs: phys=%pa, virt=%p\n", |
345 | drvdata->regs); | 345 | &drvdata->regs_phys, drvdata->regs); |
346 | } | 346 | } |
347 | /* Put a banner in the log (for DEBUG) */ | 347 | /* Put a banner in the log (for DEBUG) */ |
348 | dev_dbg(dev, "fb: phys=%llx, virt=%p, size=%x\n", | 348 | dev_dbg(dev, "fb: phys=%llx, virt=%p, size=%x\n", |
diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig index 9e02d60a364b..23eae5cb69c2 100644 --- a/drivers/xen/Kconfig +++ b/drivers/xen/Kconfig | |||
@@ -145,7 +145,7 @@ config SWIOTLB_XEN | |||
145 | 145 | ||
146 | config XEN_TMEM | 146 | config XEN_TMEM |
147 | tristate | 147 | tristate |
148 | depends on !ARM | 148 | depends on !ARM && !ARM64 |
149 | default m if (CLEANCACHE || FRONTSWAP) | 149 | default m if (CLEANCACHE || FRONTSWAP) |
150 | help | 150 | help |
151 | Shim to interface in-kernel Transcendent Memory hooks | 151 | Shim to interface in-kernel Transcendent Memory hooks |
diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile index eabd0ee1c2bc..14fe79d8634a 100644 --- a/drivers/xen/Makefile +++ b/drivers/xen/Makefile | |||
@@ -1,9 +1,8 @@ | |||
1 | ifneq ($(CONFIG_ARM),y) | 1 | ifeq ($(filter y, $(CONFIG_ARM) $(CONFIG_ARM64)),) |
2 | obj-y += manage.o | ||
3 | obj-$(CONFIG_HOTPLUG_CPU) += cpu_hotplug.o | 2 | obj-$(CONFIG_HOTPLUG_CPU) += cpu_hotplug.o |
4 | endif | 3 | endif |
5 | obj-$(CONFIG_X86) += fallback.o | 4 | obj-$(CONFIG_X86) += fallback.o |
6 | obj-y += grant-table.o features.o events.o balloon.o | 5 | obj-y += grant-table.o features.o events.o balloon.o manage.o |
7 | obj-y += xenbus/ | 6 | obj-y += xenbus/ |
8 | 7 | ||
9 | nostackp := $(call cc-option, -fno-stack-protector) | 8 | nostackp := $(call cc-option, -fno-stack-protector) |
diff --git a/drivers/xen/evtchn.c b/drivers/xen/evtchn.c index 8feecf01d55c..b6165e047f48 100644 --- a/drivers/xen/evtchn.c +++ b/drivers/xen/evtchn.c | |||
@@ -379,18 +379,12 @@ static long evtchn_ioctl(struct file *file, | |||
379 | if (unbind.port >= NR_EVENT_CHANNELS) | 379 | if (unbind.port >= NR_EVENT_CHANNELS) |
380 | break; | 380 | break; |
381 | 381 | ||
382 | spin_lock_irq(&port_user_lock); | ||
383 | |||
384 | rc = -ENOTCONN; | 382 | rc = -ENOTCONN; |
385 | if (get_port_user(unbind.port) != u) { | 383 | if (get_port_user(unbind.port) != u) |
386 | spin_unlock_irq(&port_user_lock); | ||
387 | break; | 384 | break; |
388 | } | ||
389 | 385 | ||
390 | disable_irq(irq_from_evtchn(unbind.port)); | 386 | disable_irq(irq_from_evtchn(unbind.port)); |
391 | 387 | ||
392 | spin_unlock_irq(&port_user_lock); | ||
393 | |||
394 | evtchn_unbind_from_user(u, unbind.port); | 388 | evtchn_unbind_from_user(u, unbind.port); |
395 | 389 | ||
396 | rc = 0; | 390 | rc = 0; |
@@ -490,26 +484,15 @@ static int evtchn_release(struct inode *inode, struct file *filp) | |||
490 | int i; | 484 | int i; |
491 | struct per_user_data *u = filp->private_data; | 485 | struct per_user_data *u = filp->private_data; |
492 | 486 | ||
493 | spin_lock_irq(&port_user_lock); | ||
494 | |||
495 | free_page((unsigned long)u->ring); | ||
496 | |||
497 | for (i = 0; i < NR_EVENT_CHANNELS; i++) { | 487 | for (i = 0; i < NR_EVENT_CHANNELS; i++) { |
498 | if (get_port_user(i) != u) | 488 | if (get_port_user(i) != u) |
499 | continue; | 489 | continue; |
500 | 490 | ||
501 | disable_irq(irq_from_evtchn(i)); | 491 | disable_irq(irq_from_evtchn(i)); |
502 | } | ||
503 | |||
504 | spin_unlock_irq(&port_user_lock); | ||
505 | |||
506 | for (i = 0; i < NR_EVENT_CHANNELS; i++) { | ||
507 | if (get_port_user(i) != u) | ||
508 | continue; | ||
509 | |||
510 | evtchn_unbind_from_user(get_port_user(i), i); | 492 | evtchn_unbind_from_user(get_port_user(i), i); |
511 | } | 493 | } |
512 | 494 | ||
495 | free_page((unsigned long)u->ring); | ||
513 | kfree(u->name); | 496 | kfree(u->name); |
514 | kfree(u); | 497 | kfree(u); |
515 | 498 | ||
diff --git a/drivers/xen/xenbus/xenbus_probe_frontend.c b/drivers/xen/xenbus/xenbus_probe_frontend.c index 6ed8a9df4472..34b20bfa4e8c 100644 --- a/drivers/xen/xenbus/xenbus_probe_frontend.c +++ b/drivers/xen/xenbus/xenbus_probe_frontend.c | |||
@@ -115,7 +115,6 @@ static int xenbus_frontend_dev_resume(struct device *dev) | |||
115 | return -EFAULT; | 115 | return -EFAULT; |
116 | } | 116 | } |
117 | 117 | ||
118 | INIT_WORK(&xdev->work, xenbus_frontend_delayed_resume); | ||
119 | queue_work(xenbus_frontend_wq, &xdev->work); | 118 | queue_work(xenbus_frontend_wq, &xdev->work); |
120 | 119 | ||
121 | return 0; | 120 | return 0; |
@@ -124,6 +123,16 @@ static int xenbus_frontend_dev_resume(struct device *dev) | |||
124 | return xenbus_dev_resume(dev); | 123 | return xenbus_dev_resume(dev); |
125 | } | 124 | } |
126 | 125 | ||
126 | static int xenbus_frontend_dev_probe(struct device *dev) | ||
127 | { | ||
128 | if (xen_store_domain_type == XS_LOCAL) { | ||
129 | struct xenbus_device *xdev = to_xenbus_device(dev); | ||
130 | INIT_WORK(&xdev->work, xenbus_frontend_delayed_resume); | ||
131 | } | ||
132 | |||
133 | return xenbus_dev_probe(dev); | ||
134 | } | ||
135 | |||
127 | static const struct dev_pm_ops xenbus_pm_ops = { | 136 | static const struct dev_pm_ops xenbus_pm_ops = { |
128 | .suspend = xenbus_dev_suspend, | 137 | .suspend = xenbus_dev_suspend, |
129 | .resume = xenbus_frontend_dev_resume, | 138 | .resume = xenbus_frontend_dev_resume, |
@@ -142,7 +151,7 @@ static struct xen_bus_type xenbus_frontend = { | |||
142 | .name = "xen", | 151 | .name = "xen", |
143 | .match = xenbus_match, | 152 | .match = xenbus_match, |
144 | .uevent = xenbus_uevent_frontend, | 153 | .uevent = xenbus_uevent_frontend, |
145 | .probe = xenbus_dev_probe, | 154 | .probe = xenbus_frontend_dev_probe, |
146 | .remove = xenbus_dev_remove, | 155 | .remove = xenbus_dev_remove, |
147 | .shutdown = xenbus_dev_shutdown, | 156 | .shutdown = xenbus_dev_shutdown, |
148 | .dev_attrs = xenbus_dev_attrs, | 157 | .dev_attrs = xenbus_dev_attrs, |
@@ -474,7 +483,11 @@ static int __init xenbus_probe_frontend_init(void) | |||
474 | 483 | ||
475 | register_xenstore_notifier(&xenstore_notifier); | 484 | register_xenstore_notifier(&xenstore_notifier); |
476 | 485 | ||
477 | xenbus_frontend_wq = create_workqueue("xenbus_frontend"); | 486 | if (xen_store_domain_type == XS_LOCAL) { |
487 | xenbus_frontend_wq = create_workqueue("xenbus_frontend"); | ||
488 | if (!xenbus_frontend_wq) | ||
489 | pr_warn("create xenbus frontend workqueue failed, S3 resume is likely to fail\n"); | ||
490 | } | ||
478 | 491 | ||
479 | return 0; | 492 | return 0; |
480 | } | 493 | } |
diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c index 998b17eda09d..9f6b96a09615 100644 --- a/fs/ocfs2/refcounttree.c +++ b/fs/ocfs2/refcounttree.c | |||
@@ -2965,6 +2965,11 @@ int ocfs2_duplicate_clusters_by_page(handle_t *handle, | |||
2965 | to = map_end & (PAGE_CACHE_SIZE - 1); | 2965 | to = map_end & (PAGE_CACHE_SIZE - 1); |
2966 | 2966 | ||
2967 | page = find_or_create_page(mapping, page_index, GFP_NOFS); | 2967 | page = find_or_create_page(mapping, page_index, GFP_NOFS); |
2968 | if (!page) { | ||
2969 | ret = -ENOMEM; | ||
2970 | mlog_errno(ret); | ||
2971 | break; | ||
2972 | } | ||
2968 | 2973 | ||
2969 | /* | 2974 | /* |
2970 | * In case PAGE_CACHE_SIZE <= CLUSTER_SIZE, This page | 2975 | * In case PAGE_CACHE_SIZE <= CLUSTER_SIZE, This page |
diff --git a/include/linux/firewire.h b/include/linux/firewire.h index 3b0e820375ab..5d7782e42b8f 100644 --- a/include/linux/firewire.h +++ b/include/linux/firewire.h | |||
@@ -436,6 +436,7 @@ struct fw_iso_context { | |||
436 | int type; | 436 | int type; |
437 | int channel; | 437 | int channel; |
438 | int speed; | 438 | int speed; |
439 | bool drop_overflow_headers; | ||
439 | size_t header_size; | 440 | size_t header_size; |
440 | union { | 441 | union { |
441 | fw_iso_callback_t sc; | 442 | fw_iso_callback_t sc; |
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index b62d4af6c667..45e921401b06 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
@@ -361,7 +361,8 @@ struct ssb_device_id { | |||
361 | __u16 vendor; | 361 | __u16 vendor; |
362 | __u16 coreid; | 362 | __u16 coreid; |
363 | __u8 revision; | 363 | __u8 revision; |
364 | }; | 364 | __u8 __pad; |
365 | } __attribute__((packed, aligned(2))); | ||
365 | #define SSB_DEVICE(_vendor, _coreid, _revision) \ | 366 | #define SSB_DEVICE(_vendor, _coreid, _revision) \ |
366 | { .vendor = _vendor, .coreid = _coreid, .revision = _revision, } | 367 | { .vendor = _vendor, .coreid = _coreid, .revision = _revision, } |
367 | #define SSB_DEVTABLE_END \ | 368 | #define SSB_DEVTABLE_END \ |
@@ -377,7 +378,7 @@ struct bcma_device_id { | |||
377 | __u16 id; | 378 | __u16 id; |
378 | __u8 rev; | 379 | __u8 rev; |
379 | __u8 class; | 380 | __u8 class; |
380 | }; | 381 | } __attribute__((packed,aligned(2))); |
381 | #define BCMA_CORE(_manuf, _id, _rev, _class) \ | 382 | #define BCMA_CORE(_manuf, _id, _rev, _class) \ |
382 | { .manuf = _manuf, .id = _id, .rev = _rev, .class = _class, } | 383 | { .manuf = _manuf, .id = _id, .rev = _rev, .class = _class, } |
383 | #define BCMA_CORETABLE_END \ | 384 | #define BCMA_CORETABLE_END \ |
diff --git a/include/linux/vmpressure.h b/include/linux/vmpressure.h index 76be077340ea..7dc17e2456de 100644 --- a/include/linux/vmpressure.h +++ b/include/linux/vmpressure.h | |||
@@ -12,7 +12,7 @@ struct vmpressure { | |||
12 | unsigned long scanned; | 12 | unsigned long scanned; |
13 | unsigned long reclaimed; | 13 | unsigned long reclaimed; |
14 | /* The lock is used to keep the scanned/reclaimed above in sync. */ | 14 | /* The lock is used to keep the scanned/reclaimed above in sync. */ |
15 | struct mutex sr_lock; | 15 | struct spinlock sr_lock; |
16 | 16 | ||
17 | /* The list of vmpressure_event structs. */ | 17 | /* The list of vmpressure_event structs. */ |
18 | struct list_head events; | 18 | struct list_head events; |
@@ -30,6 +30,7 @@ extern void vmpressure(gfp_t gfp, struct mem_cgroup *memcg, | |||
30 | extern void vmpressure_prio(gfp_t gfp, struct mem_cgroup *memcg, int prio); | 30 | extern void vmpressure_prio(gfp_t gfp, struct mem_cgroup *memcg, int prio); |
31 | 31 | ||
32 | extern void vmpressure_init(struct vmpressure *vmpr); | 32 | extern void vmpressure_init(struct vmpressure *vmpr); |
33 | extern void vmpressure_cleanup(struct vmpressure *vmpr); | ||
33 | extern struct vmpressure *memcg_to_vmpressure(struct mem_cgroup *memcg); | 34 | extern struct vmpressure *memcg_to_vmpressure(struct mem_cgroup *memcg); |
34 | extern struct cgroup_subsys_state *vmpressure_to_css(struct vmpressure *vmpr); | 35 | extern struct cgroup_subsys_state *vmpressure_to_css(struct vmpressure *vmpr); |
35 | extern struct vmpressure *css_to_vmpressure(struct cgroup_subsys_state *css); | 36 | extern struct vmpressure *css_to_vmpressure(struct cgroup_subsys_state *css); |
diff --git a/include/uapi/linux/firewire-cdev.h b/include/uapi/linux/firewire-cdev.h index d50036953497..1db453e4b550 100644 --- a/include/uapi/linux/firewire-cdev.h +++ b/include/uapi/linux/firewire-cdev.h | |||
@@ -215,8 +215,8 @@ struct fw_cdev_event_request2 { | |||
215 | * with the %FW_CDEV_ISO_INTERRUPT bit set, when explicitly requested with | 215 | * with the %FW_CDEV_ISO_INTERRUPT bit set, when explicitly requested with |
216 | * %FW_CDEV_IOC_FLUSH_ISO, or when there have been so many completed packets | 216 | * %FW_CDEV_IOC_FLUSH_ISO, or when there have been so many completed packets |
217 | * without the interrupt bit set that the kernel's internal buffer for @header | 217 | * without the interrupt bit set that the kernel's internal buffer for @header |
218 | * is about to overflow. (In the last case, kernels with ABI version < 5 drop | 218 | * is about to overflow. (In the last case, ABI versions < 5 drop header data |
219 | * header data up to the next interrupt packet.) | 219 | * up to the next interrupt packet.) |
220 | * | 220 | * |
221 | * Isochronous transmit events (context type %FW_CDEV_ISO_CONTEXT_TRANSMIT): | 221 | * Isochronous transmit events (context type %FW_CDEV_ISO_CONTEXT_TRANSMIT): |
222 | * | 222 | * |
diff --git a/kernel/Makefile b/kernel/Makefile index 470839d1a30e..35ef1185e359 100644 --- a/kernel/Makefile +++ b/kernel/Makefile | |||
@@ -2,7 +2,7 @@ | |||
2 | # Makefile for the linux kernel. | 2 | # Makefile for the linux kernel. |
3 | # | 3 | # |
4 | 4 | ||
5 | obj-y = fork.o exec_domain.o panic.o printk.o \ | 5 | obj-y = fork.o exec_domain.o panic.o \ |
6 | cpu.o exit.o itimer.o time.o softirq.o resource.o \ | 6 | cpu.o exit.o itimer.o time.o softirq.o resource.o \ |
7 | sysctl.o sysctl_binary.o capability.o ptrace.o timer.o user.o \ | 7 | sysctl.o sysctl_binary.o capability.o ptrace.o timer.o user.o \ |
8 | signal.o sys.o kmod.o workqueue.o pid.o task_work.o \ | 8 | signal.o sys.o kmod.o workqueue.o pid.o task_work.o \ |
@@ -24,6 +24,7 @@ endif | |||
24 | 24 | ||
25 | obj-y += sched/ | 25 | obj-y += sched/ |
26 | obj-y += power/ | 26 | obj-y += power/ |
27 | obj-y += printk/ | ||
27 | obj-y += cpu/ | 28 | obj-y += cpu/ |
28 | 29 | ||
29 | obj-$(CONFIG_CHECKPOINT_RESTORE) += kcmp.o | 30 | obj-$(CONFIG_CHECKPOINT_RESTORE) += kcmp.o |
diff --git a/kernel/printk/Makefile b/kernel/printk/Makefile new file mode 100644 index 000000000000..85405bdcf2b3 --- /dev/null +++ b/kernel/printk/Makefile | |||
@@ -0,0 +1,2 @@ | |||
1 | obj-y = printk.o | ||
2 | obj-$(CONFIG_A11Y_BRAILLE_CONSOLE) += braille.o | ||
diff --git a/kernel/printk/braille.c b/kernel/printk/braille.c new file mode 100644 index 000000000000..b51087fb9ace --- /dev/null +++ b/kernel/printk/braille.c | |||
@@ -0,0 +1,48 @@ | |||
1 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
2 | |||
3 | #include <linux/kernel.h> | ||
4 | #include <linux/console.h> | ||
5 | #include <linux/string.h> | ||
6 | |||
7 | #include "console_cmdline.h" | ||
8 | #include "braille.h" | ||
9 | |||
10 | char *_braille_console_setup(char **str, char **brl_options) | ||
11 | { | ||
12 | if (!memcmp(*str, "brl,", 4)) { | ||
13 | *brl_options = ""; | ||
14 | *str += 4; | ||
15 | } else if (!memcmp(str, "brl=", 4)) { | ||
16 | *brl_options = *str + 4; | ||
17 | *str = strchr(*brl_options, ','); | ||
18 | if (!*str) | ||
19 | pr_err("need port name after brl=\n"); | ||
20 | else | ||
21 | *((*str)++) = 0; | ||
22 | } | ||
23 | |||
24 | return *str; | ||
25 | } | ||
26 | |||
27 | int | ||
28 | _braille_register_console(struct console *console, struct console_cmdline *c) | ||
29 | { | ||
30 | int rtn = 0; | ||
31 | |||
32 | if (c->brl_options) { | ||
33 | console->flags |= CON_BRL; | ||
34 | rtn = braille_register_console(console, c->index, c->options, | ||
35 | c->brl_options); | ||
36 | } | ||
37 | |||
38 | return rtn; | ||
39 | } | ||
40 | |||
41 | int | ||
42 | _braille_unregister_console(struct console *console) | ||
43 | { | ||
44 | if (console->flags & CON_BRL) | ||
45 | return braille_unregister_console(console); | ||
46 | |||
47 | return 0; | ||
48 | } | ||
diff --git a/kernel/printk/braille.h b/kernel/printk/braille.h new file mode 100644 index 000000000000..769d771145c8 --- /dev/null +++ b/kernel/printk/braille.h | |||
@@ -0,0 +1,48 @@ | |||
1 | #ifndef _PRINTK_BRAILLE_H | ||
2 | #define _PRINTK_BRAILLE_H | ||
3 | |||
4 | #ifdef CONFIG_A11Y_BRAILLE_CONSOLE | ||
5 | |||
6 | static inline void | ||
7 | braille_set_options(struct console_cmdline *c, char *brl_options) | ||
8 | { | ||
9 | c->brl_options = brl_options; | ||
10 | } | ||
11 | |||
12 | char * | ||
13 | _braille_console_setup(char **str, char **brl_options); | ||
14 | |||
15 | int | ||
16 | _braille_register_console(struct console *console, struct console_cmdline *c); | ||
17 | |||
18 | int | ||
19 | _braille_unregister_console(struct console *console); | ||
20 | |||
21 | #else | ||
22 | |||
23 | static inline void | ||
24 | braille_set_options(struct console_cmdline *c, char *brl_options) | ||
25 | { | ||
26 | } | ||
27 | |||
28 | static inline char * | ||
29 | _braille_console_setup(char **str, char **brl_options) | ||
30 | { | ||
31 | return NULL; | ||
32 | } | ||
33 | |||
34 | static inline int | ||
35 | _braille_register_console(struct console *console, struct console_cmdline *c) | ||
36 | { | ||
37 | return 0; | ||
38 | } | ||
39 | |||
40 | static inline int | ||
41 | _braille_unregister_console(struct console *console) | ||
42 | { | ||
43 | return 0; | ||
44 | } | ||
45 | |||
46 | #endif | ||
47 | |||
48 | #endif | ||
diff --git a/kernel/printk/console_cmdline.h b/kernel/printk/console_cmdline.h new file mode 100644 index 000000000000..cbd69d842341 --- /dev/null +++ b/kernel/printk/console_cmdline.h | |||
@@ -0,0 +1,14 @@ | |||
1 | #ifndef _CONSOLE_CMDLINE_H | ||
2 | #define _CONSOLE_CMDLINE_H | ||
3 | |||
4 | struct console_cmdline | ||
5 | { | ||
6 | char name[8]; /* Name of the driver */ | ||
7 | int index; /* Minor dev. to use */ | ||
8 | char *options; /* Options for the driver */ | ||
9 | #ifdef CONFIG_A11Y_BRAILLE_CONSOLE | ||
10 | char *brl_options; /* Options for braille driver */ | ||
11 | #endif | ||
12 | }; | ||
13 | |||
14 | #endif | ||
diff --git a/kernel/printk.c b/kernel/printk/printk.c index 69b0890ed7e5..5b5a7080e2a5 100644 --- a/kernel/printk.c +++ b/kernel/printk/printk.c | |||
@@ -51,6 +51,9 @@ | |||
51 | #define CREATE_TRACE_POINTS | 51 | #define CREATE_TRACE_POINTS |
52 | #include <trace/events/printk.h> | 52 | #include <trace/events/printk.h> |
53 | 53 | ||
54 | #include "console_cmdline.h" | ||
55 | #include "braille.h" | ||
56 | |||
54 | /* printk's without a loglevel use this.. */ | 57 | /* printk's without a loglevel use this.. */ |
55 | #define DEFAULT_MESSAGE_LOGLEVEL CONFIG_DEFAULT_MESSAGE_LOGLEVEL | 58 | #define DEFAULT_MESSAGE_LOGLEVEL CONFIG_DEFAULT_MESSAGE_LOGLEVEL |
56 | 59 | ||
@@ -105,19 +108,11 @@ static struct console *exclusive_console; | |||
105 | /* | 108 | /* |
106 | * Array of consoles built from command line options (console=) | 109 | * Array of consoles built from command line options (console=) |
107 | */ | 110 | */ |
108 | struct console_cmdline | ||
109 | { | ||
110 | char name[8]; /* Name of the driver */ | ||
111 | int index; /* Minor dev. to use */ | ||
112 | char *options; /* Options for the driver */ | ||
113 | #ifdef CONFIG_A11Y_BRAILLE_CONSOLE | ||
114 | char *brl_options; /* Options for braille driver */ | ||
115 | #endif | ||
116 | }; | ||
117 | 111 | ||
118 | #define MAX_CMDLINECONSOLES 8 | 112 | #define MAX_CMDLINECONSOLES 8 |
119 | 113 | ||
120 | static struct console_cmdline console_cmdline[MAX_CMDLINECONSOLES]; | 114 | static struct console_cmdline console_cmdline[MAX_CMDLINECONSOLES]; |
115 | |||
121 | static int selected_console = -1; | 116 | static int selected_console = -1; |
122 | static int preferred_console = -1; | 117 | static int preferred_console = -1; |
123 | int console_set_on_cmdline; | 118 | int console_set_on_cmdline; |
@@ -178,7 +173,7 @@ static int console_may_schedule; | |||
178 | * 67 "g" | 173 | * 67 "g" |
179 | * 0032 00 00 00 padding to next message header | 174 | * 0032 00 00 00 padding to next message header |
180 | * | 175 | * |
181 | * The 'struct log' buffer header must never be directly exported to | 176 | * The 'struct printk_log' buffer header must never be directly exported to |
182 | * userspace, it is a kernel-private implementation detail that might | 177 | * userspace, it is a kernel-private implementation detail that might |
183 | * need to be changed in the future, when the requirements change. | 178 | * need to be changed in the future, when the requirements change. |
184 | * | 179 | * |
@@ -200,7 +195,7 @@ enum log_flags { | |||
200 | LOG_CONT = 8, /* text is a fragment of a continuation line */ | 195 | LOG_CONT = 8, /* text is a fragment of a continuation line */ |
201 | }; | 196 | }; |
202 | 197 | ||
203 | struct log { | 198 | struct printk_log { |
204 | u64 ts_nsec; /* timestamp in nanoseconds */ | 199 | u64 ts_nsec; /* timestamp in nanoseconds */ |
205 | u16 len; /* length of entire record */ | 200 | u16 len; /* length of entire record */ |
206 | u16 text_len; /* length of text buffer */ | 201 | u16 text_len; /* length of text buffer */ |
@@ -248,7 +243,7 @@ static u32 clear_idx; | |||
248 | #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) | 243 | #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) |
249 | #define LOG_ALIGN 4 | 244 | #define LOG_ALIGN 4 |
250 | #else | 245 | #else |
251 | #define LOG_ALIGN __alignof__(struct log) | 246 | #define LOG_ALIGN __alignof__(struct printk_log) |
252 | #endif | 247 | #endif |
253 | #define __LOG_BUF_LEN (1 << CONFIG_LOG_BUF_SHIFT) | 248 | #define __LOG_BUF_LEN (1 << CONFIG_LOG_BUF_SHIFT) |
254 | static char __log_buf[__LOG_BUF_LEN] __aligned(LOG_ALIGN); | 249 | static char __log_buf[__LOG_BUF_LEN] __aligned(LOG_ALIGN); |
@@ -259,35 +254,35 @@ static u32 log_buf_len = __LOG_BUF_LEN; | |||
259 | static volatile unsigned int logbuf_cpu = UINT_MAX; | 254 | static volatile unsigned int logbuf_cpu = UINT_MAX; |
260 | 255 | ||
261 | /* human readable text of the record */ | 256 | /* human readable text of the record */ |
262 | static char *log_text(const struct log *msg) | 257 | static char *log_text(const struct printk_log *msg) |
263 | { | 258 | { |
264 | return (char *)msg + sizeof(struct log); | 259 | return (char *)msg + sizeof(struct printk_log); |
265 | } | 260 | } |
266 | 261 | ||
267 | /* optional key/value pair dictionary attached to the record */ | 262 | /* optional key/value pair dictionary attached to the record */ |
268 | static char *log_dict(const struct log *msg) | 263 | static char *log_dict(const struct printk_log *msg) |
269 | { | 264 | { |
270 | return (char *)msg + sizeof(struct log) + msg->text_len; | 265 | return (char *)msg + sizeof(struct printk_log) + msg->text_len; |
271 | } | 266 | } |
272 | 267 | ||
273 | /* get record by index; idx must point to valid msg */ | 268 | /* get record by index; idx must point to valid msg */ |
274 | static struct log *log_from_idx(u32 idx) | 269 | static struct printk_log *log_from_idx(u32 idx) |
275 | { | 270 | { |
276 | struct log *msg = (struct log *)(log_buf + idx); | 271 | struct printk_log *msg = (struct printk_log *)(log_buf + idx); |
277 | 272 | ||
278 | /* | 273 | /* |
279 | * A length == 0 record is the end of buffer marker. Wrap around and | 274 | * A length == 0 record is the end of buffer marker. Wrap around and |
280 | * read the message at the start of the buffer. | 275 | * read the message at the start of the buffer. |
281 | */ | 276 | */ |
282 | if (!msg->len) | 277 | if (!msg->len) |
283 | return (struct log *)log_buf; | 278 | return (struct printk_log *)log_buf; |
284 | return msg; | 279 | return msg; |
285 | } | 280 | } |
286 | 281 | ||
287 | /* get next record; idx must point to valid msg */ | 282 | /* get next record; idx must point to valid msg */ |
288 | static u32 log_next(u32 idx) | 283 | static u32 log_next(u32 idx) |
289 | { | 284 | { |
290 | struct log *msg = (struct log *)(log_buf + idx); | 285 | struct printk_log *msg = (struct printk_log *)(log_buf + idx); |
291 | 286 | ||
292 | /* length == 0 indicates the end of the buffer; wrap */ | 287 | /* length == 0 indicates the end of the buffer; wrap */ |
293 | /* | 288 | /* |
@@ -296,7 +291,7 @@ static u32 log_next(u32 idx) | |||
296 | * return the one after that. | 291 | * return the one after that. |
297 | */ | 292 | */ |
298 | if (!msg->len) { | 293 | if (!msg->len) { |
299 | msg = (struct log *)log_buf; | 294 | msg = (struct printk_log *)log_buf; |
300 | return msg->len; | 295 | return msg->len; |
301 | } | 296 | } |
302 | return idx + msg->len; | 297 | return idx + msg->len; |
@@ -308,11 +303,11 @@ static void log_store(int facility, int level, | |||
308 | const char *dict, u16 dict_len, | 303 | const char *dict, u16 dict_len, |
309 | const char *text, u16 text_len) | 304 | const char *text, u16 text_len) |
310 | { | 305 | { |
311 | struct log *msg; | 306 | struct printk_log *msg; |
312 | u32 size, pad_len; | 307 | u32 size, pad_len; |
313 | 308 | ||
314 | /* number of '\0' padding bytes to next message */ | 309 | /* number of '\0' padding bytes to next message */ |
315 | size = sizeof(struct log) + text_len + dict_len; | 310 | size = sizeof(struct printk_log) + text_len + dict_len; |
316 | pad_len = (-size) & (LOG_ALIGN - 1); | 311 | pad_len = (-size) & (LOG_ALIGN - 1); |
317 | size += pad_len; | 312 | size += pad_len; |
318 | 313 | ||
@@ -324,7 +319,7 @@ static void log_store(int facility, int level, | |||
324 | else | 319 | else |
325 | free = log_first_idx - log_next_idx; | 320 | free = log_first_idx - log_next_idx; |
326 | 321 | ||
327 | if (free > size + sizeof(struct log)) | 322 | if (free > size + sizeof(struct printk_log)) |
328 | break; | 323 | break; |
329 | 324 | ||
330 | /* drop old messages until we have enough contiuous space */ | 325 | /* drop old messages until we have enough contiuous space */ |
@@ -332,18 +327,18 @@ static void log_store(int facility, int level, | |||
332 | log_first_seq++; | 327 | log_first_seq++; |
333 | } | 328 | } |
334 | 329 | ||
335 | if (log_next_idx + size + sizeof(struct log) >= log_buf_len) { | 330 | if (log_next_idx + size + sizeof(struct printk_log) >= log_buf_len) { |
336 | /* | 331 | /* |
337 | * This message + an additional empty header does not fit | 332 | * This message + an additional empty header does not fit |
338 | * at the end of the buffer. Add an empty header with len == 0 | 333 | * at the end of the buffer. Add an empty header with len == 0 |
339 | * to signify a wrap around. | 334 | * to signify a wrap around. |
340 | */ | 335 | */ |
341 | memset(log_buf + log_next_idx, 0, sizeof(struct log)); | 336 | memset(log_buf + log_next_idx, 0, sizeof(struct printk_log)); |
342 | log_next_idx = 0; | 337 | log_next_idx = 0; |
343 | } | 338 | } |
344 | 339 | ||
345 | /* fill message */ | 340 | /* fill message */ |
346 | msg = (struct log *)(log_buf + log_next_idx); | 341 | msg = (struct printk_log *)(log_buf + log_next_idx); |
347 | memcpy(log_text(msg), text, text_len); | 342 | memcpy(log_text(msg), text, text_len); |
348 | msg->text_len = text_len; | 343 | msg->text_len = text_len; |
349 | memcpy(log_dict(msg), dict, dict_len); | 344 | memcpy(log_dict(msg), dict, dict_len); |
@@ -356,7 +351,7 @@ static void log_store(int facility, int level, | |||
356 | else | 351 | else |
357 | msg->ts_nsec = local_clock(); | 352 | msg->ts_nsec = local_clock(); |
358 | memset(log_dict(msg) + dict_len, 0, pad_len); | 353 | memset(log_dict(msg) + dict_len, 0, pad_len); |
359 | msg->len = sizeof(struct log) + text_len + dict_len + pad_len; | 354 | msg->len = sizeof(struct printk_log) + text_len + dict_len + pad_len; |
360 | 355 | ||
361 | /* insert message */ | 356 | /* insert message */ |
362 | log_next_idx += msg->len; | 357 | log_next_idx += msg->len; |
@@ -479,7 +474,7 @@ static ssize_t devkmsg_read(struct file *file, char __user *buf, | |||
479 | size_t count, loff_t *ppos) | 474 | size_t count, loff_t *ppos) |
480 | { | 475 | { |
481 | struct devkmsg_user *user = file->private_data; | 476 | struct devkmsg_user *user = file->private_data; |
482 | struct log *msg; | 477 | struct printk_log *msg; |
483 | u64 ts_usec; | 478 | u64 ts_usec; |
484 | size_t i; | 479 | size_t i; |
485 | char cont = '-'; | 480 | char cont = '-'; |
@@ -724,14 +719,14 @@ void log_buf_kexec_setup(void) | |||
724 | VMCOREINFO_SYMBOL(log_first_idx); | 719 | VMCOREINFO_SYMBOL(log_first_idx); |
725 | VMCOREINFO_SYMBOL(log_next_idx); | 720 | VMCOREINFO_SYMBOL(log_next_idx); |
726 | /* | 721 | /* |
727 | * Export struct log size and field offsets. User space tools can | 722 | * Export struct printk_log size and field offsets. User space tools can |
728 | * parse it and detect any changes to structure down the line. | 723 | * parse it and detect any changes to structure down the line. |
729 | */ | 724 | */ |
730 | VMCOREINFO_STRUCT_SIZE(log); | 725 | VMCOREINFO_STRUCT_SIZE(printk_log); |
731 | VMCOREINFO_OFFSET(log, ts_nsec); | 726 | VMCOREINFO_OFFSET(printk_log, ts_nsec); |
732 | VMCOREINFO_OFFSET(log, len); | 727 | VMCOREINFO_OFFSET(printk_log, len); |
733 | VMCOREINFO_OFFSET(log, text_len); | 728 | VMCOREINFO_OFFSET(printk_log, text_len); |
734 | VMCOREINFO_OFFSET(log, dict_len); | 729 | VMCOREINFO_OFFSET(printk_log, dict_len); |
735 | } | 730 | } |
736 | #endif | 731 | #endif |
737 | 732 | ||
@@ -884,7 +879,7 @@ static size_t print_time(u64 ts, char *buf) | |||
884 | (unsigned long)ts, rem_nsec / 1000); | 879 | (unsigned long)ts, rem_nsec / 1000); |
885 | } | 880 | } |
886 | 881 | ||
887 | static size_t print_prefix(const struct log *msg, bool syslog, char *buf) | 882 | static size_t print_prefix(const struct printk_log *msg, bool syslog, char *buf) |
888 | { | 883 | { |
889 | size_t len = 0; | 884 | size_t len = 0; |
890 | unsigned int prefix = (msg->facility << 3) | msg->level; | 885 | unsigned int prefix = (msg->facility << 3) | msg->level; |
@@ -907,7 +902,7 @@ static size_t print_prefix(const struct log *msg, bool syslog, char *buf) | |||
907 | return len; | 902 | return len; |
908 | } | 903 | } |
909 | 904 | ||
910 | static size_t msg_print_text(const struct log *msg, enum log_flags prev, | 905 | static size_t msg_print_text(const struct printk_log *msg, enum log_flags prev, |
911 | bool syslog, char *buf, size_t size) | 906 | bool syslog, char *buf, size_t size) |
912 | { | 907 | { |
913 | const char *text = log_text(msg); | 908 | const char *text = log_text(msg); |
@@ -969,7 +964,7 @@ static size_t msg_print_text(const struct log *msg, enum log_flags prev, | |||
969 | static int syslog_print(char __user *buf, int size) | 964 | static int syslog_print(char __user *buf, int size) |
970 | { | 965 | { |
971 | char *text; | 966 | char *text; |
972 | struct log *msg; | 967 | struct printk_log *msg; |
973 | int len = 0; | 968 | int len = 0; |
974 | 969 | ||
975 | text = kmalloc(LOG_LINE_MAX + PREFIX_MAX, GFP_KERNEL); | 970 | text = kmalloc(LOG_LINE_MAX + PREFIX_MAX, GFP_KERNEL); |
@@ -1060,7 +1055,7 @@ static int syslog_print_all(char __user *buf, int size, bool clear) | |||
1060 | idx = clear_idx; | 1055 | idx = clear_idx; |
1061 | prev = 0; | 1056 | prev = 0; |
1062 | while (seq < log_next_seq) { | 1057 | while (seq < log_next_seq) { |
1063 | struct log *msg = log_from_idx(idx); | 1058 | struct printk_log *msg = log_from_idx(idx); |
1064 | 1059 | ||
1065 | len += msg_print_text(msg, prev, true, NULL, 0); | 1060 | len += msg_print_text(msg, prev, true, NULL, 0); |
1066 | prev = msg->flags; | 1061 | prev = msg->flags; |
@@ -1073,7 +1068,7 @@ static int syslog_print_all(char __user *buf, int size, bool clear) | |||
1073 | idx = clear_idx; | 1068 | idx = clear_idx; |
1074 | prev = 0; | 1069 | prev = 0; |
1075 | while (len > size && seq < log_next_seq) { | 1070 | while (len > size && seq < log_next_seq) { |
1076 | struct log *msg = log_from_idx(idx); | 1071 | struct printk_log *msg = log_from_idx(idx); |
1077 | 1072 | ||
1078 | len -= msg_print_text(msg, prev, true, NULL, 0); | 1073 | len -= msg_print_text(msg, prev, true, NULL, 0); |
1079 | prev = msg->flags; | 1074 | prev = msg->flags; |
@@ -1087,7 +1082,7 @@ static int syslog_print_all(char __user *buf, int size, bool clear) | |||
1087 | len = 0; | 1082 | len = 0; |
1088 | prev = 0; | 1083 | prev = 0; |
1089 | while (len >= 0 && seq < next_seq) { | 1084 | while (len >= 0 && seq < next_seq) { |
1090 | struct log *msg = log_from_idx(idx); | 1085 | struct printk_log *msg = log_from_idx(idx); |
1091 | int textlen; | 1086 | int textlen; |
1092 | 1087 | ||
1093 | textlen = msg_print_text(msg, prev, true, text, | 1088 | textlen = msg_print_text(msg, prev, true, text, |
@@ -1233,7 +1228,7 @@ int do_syslog(int type, char __user *buf, int len, bool from_file) | |||
1233 | 1228 | ||
1234 | error = 0; | 1229 | error = 0; |
1235 | while (seq < log_next_seq) { | 1230 | while (seq < log_next_seq) { |
1236 | struct log *msg = log_from_idx(idx); | 1231 | struct printk_log *msg = log_from_idx(idx); |
1237 | 1232 | ||
1238 | error += msg_print_text(msg, prev, true, NULL, 0); | 1233 | error += msg_print_text(msg, prev, true, NULL, 0); |
1239 | idx = log_next(idx); | 1234 | idx = log_next(idx); |
@@ -1719,10 +1714,10 @@ static struct cont { | |||
1719 | u8 level; | 1714 | u8 level; |
1720 | bool flushed:1; | 1715 | bool flushed:1; |
1721 | } cont; | 1716 | } cont; |
1722 | static struct log *log_from_idx(u32 idx) { return NULL; } | 1717 | static struct printk_log *log_from_idx(u32 idx) { return NULL; } |
1723 | static u32 log_next(u32 idx) { return 0; } | 1718 | static u32 log_next(u32 idx) { return 0; } |
1724 | static void call_console_drivers(int level, const char *text, size_t len) {} | 1719 | static void call_console_drivers(int level, const char *text, size_t len) {} |
1725 | static size_t msg_print_text(const struct log *msg, enum log_flags prev, | 1720 | static size_t msg_print_text(const struct printk_log *msg, enum log_flags prev, |
1726 | bool syslog, char *buf, size_t size) { return 0; } | 1721 | bool syslog, char *buf, size_t size) { return 0; } |
1727 | static size_t cont_print_text(char *text, size_t size) { return 0; } | 1722 | static size_t cont_print_text(char *text, size_t size) { return 0; } |
1728 | 1723 | ||
@@ -1761,23 +1756,23 @@ static int __add_preferred_console(char *name, int idx, char *options, | |||
1761 | * See if this tty is not yet registered, and | 1756 | * See if this tty is not yet registered, and |
1762 | * if we have a slot free. | 1757 | * if we have a slot free. |
1763 | */ | 1758 | */ |
1764 | for (i = 0; i < MAX_CMDLINECONSOLES && console_cmdline[i].name[0]; i++) | 1759 | for (i = 0, c = console_cmdline; |
1765 | if (strcmp(console_cmdline[i].name, name) == 0 && | 1760 | i < MAX_CMDLINECONSOLES && c->name[0]; |
1766 | console_cmdline[i].index == idx) { | 1761 | i++, c++) { |
1767 | if (!brl_options) | 1762 | if (strcmp(c->name, name) == 0 && c->index == idx) { |
1768 | selected_console = i; | 1763 | if (!brl_options) |
1769 | return 0; | 1764 | selected_console = i; |
1765 | return 0; | ||
1770 | } | 1766 | } |
1767 | } | ||
1771 | if (i == MAX_CMDLINECONSOLES) | 1768 | if (i == MAX_CMDLINECONSOLES) |
1772 | return -E2BIG; | 1769 | return -E2BIG; |
1773 | if (!brl_options) | 1770 | if (!brl_options) |
1774 | selected_console = i; | 1771 | selected_console = i; |
1775 | c = &console_cmdline[i]; | ||
1776 | strlcpy(c->name, name, sizeof(c->name)); | 1772 | strlcpy(c->name, name, sizeof(c->name)); |
1777 | c->options = options; | 1773 | c->options = options; |
1778 | #ifdef CONFIG_A11Y_BRAILLE_CONSOLE | 1774 | braille_set_options(c, brl_options); |
1779 | c->brl_options = brl_options; | 1775 | |
1780 | #endif | ||
1781 | c->index = idx; | 1776 | c->index = idx; |
1782 | return 0; | 1777 | return 0; |
1783 | } | 1778 | } |
@@ -1790,20 +1785,8 @@ static int __init console_setup(char *str) | |||
1790 | char *s, *options, *brl_options = NULL; | 1785 | char *s, *options, *brl_options = NULL; |
1791 | int idx; | 1786 | int idx; |
1792 | 1787 | ||
1793 | #ifdef CONFIG_A11Y_BRAILLE_CONSOLE | 1788 | if (_braille_console_setup(&str, &brl_options)) |
1794 | if (!memcmp(str, "brl,", 4)) { | 1789 | return 1; |
1795 | brl_options = ""; | ||
1796 | str += 4; | ||
1797 | } else if (!memcmp(str, "brl=", 4)) { | ||
1798 | brl_options = str + 4; | ||
1799 | str = strchr(brl_options, ','); | ||
1800 | if (!str) { | ||
1801 | printk(KERN_ERR "need port name after brl=\n"); | ||
1802 | return 1; | ||
1803 | } | ||
1804 | *(str++) = 0; | ||
1805 | } | ||
1806 | #endif | ||
1807 | 1790 | ||
1808 | /* | 1791 | /* |
1809 | * Decode str into name, index, options. | 1792 | * Decode str into name, index, options. |
@@ -1858,15 +1841,15 @@ int update_console_cmdline(char *name, int idx, char *name_new, int idx_new, cha | |||
1858 | struct console_cmdline *c; | 1841 | struct console_cmdline *c; |
1859 | int i; | 1842 | int i; |
1860 | 1843 | ||
1861 | for (i = 0; i < MAX_CMDLINECONSOLES && console_cmdline[i].name[0]; i++) | 1844 | for (i = 0, c = console_cmdline; |
1862 | if (strcmp(console_cmdline[i].name, name) == 0 && | 1845 | i < MAX_CMDLINECONSOLES && c->name[0]; |
1863 | console_cmdline[i].index == idx) { | 1846 | i++, c++) |
1864 | c = &console_cmdline[i]; | 1847 | if (strcmp(c->name, name) == 0 && c->index == idx) { |
1865 | strlcpy(c->name, name_new, sizeof(c->name)); | 1848 | strlcpy(c->name, name_new, sizeof(c->name)); |
1866 | c->name[sizeof(c->name) - 1] = 0; | 1849 | c->name[sizeof(c->name) - 1] = 0; |
1867 | c->options = options; | 1850 | c->options = options; |
1868 | c->index = idx_new; | 1851 | c->index = idx_new; |
1869 | return i; | 1852 | return i; |
1870 | } | 1853 | } |
1871 | /* not found */ | 1854 | /* not found */ |
1872 | return -1; | 1855 | return -1; |
@@ -2046,7 +2029,7 @@ void console_unlock(void) | |||
2046 | console_cont_flush(text, sizeof(text)); | 2029 | console_cont_flush(text, sizeof(text)); |
2047 | again: | 2030 | again: |
2048 | for (;;) { | 2031 | for (;;) { |
2049 | struct log *msg; | 2032 | struct printk_log *msg; |
2050 | size_t len; | 2033 | size_t len; |
2051 | int level; | 2034 | int level; |
2052 | 2035 | ||
@@ -2241,6 +2224,7 @@ void register_console(struct console *newcon) | |||
2241 | int i; | 2224 | int i; |
2242 | unsigned long flags; | 2225 | unsigned long flags; |
2243 | struct console *bcon = NULL; | 2226 | struct console *bcon = NULL; |
2227 | struct console_cmdline *c; | ||
2244 | 2228 | ||
2245 | /* | 2229 | /* |
2246 | * before we register a new CON_BOOT console, make sure we don't | 2230 | * before we register a new CON_BOOT console, make sure we don't |
@@ -2288,30 +2272,25 @@ void register_console(struct console *newcon) | |||
2288 | * See if this console matches one we selected on | 2272 | * See if this console matches one we selected on |
2289 | * the command line. | 2273 | * the command line. |
2290 | */ | 2274 | */ |
2291 | for (i = 0; i < MAX_CMDLINECONSOLES && console_cmdline[i].name[0]; | 2275 | for (i = 0, c = console_cmdline; |
2292 | i++) { | 2276 | i < MAX_CMDLINECONSOLES && c->name[0]; |
2293 | if (strcmp(console_cmdline[i].name, newcon->name) != 0) | 2277 | i++, c++) { |
2278 | if (strcmp(c->name, newcon->name) != 0) | ||
2294 | continue; | 2279 | continue; |
2295 | if (newcon->index >= 0 && | 2280 | if (newcon->index >= 0 && |
2296 | newcon->index != console_cmdline[i].index) | 2281 | newcon->index != c->index) |
2297 | continue; | 2282 | continue; |
2298 | if (newcon->index < 0) | 2283 | if (newcon->index < 0) |
2299 | newcon->index = console_cmdline[i].index; | 2284 | newcon->index = c->index; |
2300 | #ifdef CONFIG_A11Y_BRAILLE_CONSOLE | 2285 | |
2301 | if (console_cmdline[i].brl_options) { | 2286 | if (_braille_register_console(newcon, c)) |
2302 | newcon->flags |= CON_BRL; | ||
2303 | braille_register_console(newcon, | ||
2304 | console_cmdline[i].index, | ||
2305 | console_cmdline[i].options, | ||
2306 | console_cmdline[i].brl_options); | ||
2307 | return; | 2287 | return; |
2308 | } | 2288 | |
2309 | #endif | ||
2310 | if (newcon->setup && | 2289 | if (newcon->setup && |
2311 | newcon->setup(newcon, console_cmdline[i].options) != 0) | 2290 | newcon->setup(newcon, console_cmdline[i].options) != 0) |
2312 | break; | 2291 | break; |
2313 | newcon->flags |= CON_ENABLED; | 2292 | newcon->flags |= CON_ENABLED; |
2314 | newcon->index = console_cmdline[i].index; | 2293 | newcon->index = c->index; |
2315 | if (i == selected_console) { | 2294 | if (i == selected_console) { |
2316 | newcon->flags |= CON_CONSDEV; | 2295 | newcon->flags |= CON_CONSDEV; |
2317 | preferred_console = selected_console; | 2296 | preferred_console = selected_console; |
@@ -2394,13 +2373,13 @@ EXPORT_SYMBOL(register_console); | |||
2394 | int unregister_console(struct console *console) | 2373 | int unregister_console(struct console *console) |
2395 | { | 2374 | { |
2396 | struct console *a, *b; | 2375 | struct console *a, *b; |
2397 | int res = 1; | 2376 | int res; |
2398 | 2377 | ||
2399 | #ifdef CONFIG_A11Y_BRAILLE_CONSOLE | 2378 | res = _braille_unregister_console(console); |
2400 | if (console->flags & CON_BRL) | 2379 | if (res) |
2401 | return braille_unregister_console(console); | 2380 | return res; |
2402 | #endif | ||
2403 | 2381 | ||
2382 | res = 1; | ||
2404 | console_lock(); | 2383 | console_lock(); |
2405 | if (console_drivers == console) { | 2384 | if (console_drivers == console) { |
2406 | console_drivers=console->next; | 2385 | console_drivers=console->next; |
@@ -2666,7 +2645,7 @@ void kmsg_dump(enum kmsg_dump_reason reason) | |||
2666 | bool kmsg_dump_get_line_nolock(struct kmsg_dumper *dumper, bool syslog, | 2645 | bool kmsg_dump_get_line_nolock(struct kmsg_dumper *dumper, bool syslog, |
2667 | char *line, size_t size, size_t *len) | 2646 | char *line, size_t size, size_t *len) |
2668 | { | 2647 | { |
2669 | struct log *msg; | 2648 | struct printk_log *msg; |
2670 | size_t l = 0; | 2649 | size_t l = 0; |
2671 | bool ret = false; | 2650 | bool ret = false; |
2672 | 2651 | ||
@@ -2778,7 +2757,7 @@ bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog, | |||
2778 | idx = dumper->cur_idx; | 2757 | idx = dumper->cur_idx; |
2779 | prev = 0; | 2758 | prev = 0; |
2780 | while (seq < dumper->next_seq) { | 2759 | while (seq < dumper->next_seq) { |
2781 | struct log *msg = log_from_idx(idx); | 2760 | struct printk_log *msg = log_from_idx(idx); |
2782 | 2761 | ||
2783 | l += msg_print_text(msg, prev, true, NULL, 0); | 2762 | l += msg_print_text(msg, prev, true, NULL, 0); |
2784 | idx = log_next(idx); | 2763 | idx = log_next(idx); |
@@ -2791,7 +2770,7 @@ bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog, | |||
2791 | idx = dumper->cur_idx; | 2770 | idx = dumper->cur_idx; |
2792 | prev = 0; | 2771 | prev = 0; |
2793 | while (l > size && seq < dumper->next_seq) { | 2772 | while (l > size && seq < dumper->next_seq) { |
2794 | struct log *msg = log_from_idx(idx); | 2773 | struct printk_log *msg = log_from_idx(idx); |
2795 | 2774 | ||
2796 | l -= msg_print_text(msg, prev, true, NULL, 0); | 2775 | l -= msg_print_text(msg, prev, true, NULL, 0); |
2797 | idx = log_next(idx); | 2776 | idx = log_next(idx); |
@@ -2806,7 +2785,7 @@ bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog, | |||
2806 | l = 0; | 2785 | l = 0; |
2807 | prev = 0; | 2786 | prev = 0; |
2808 | while (seq < dumper->next_seq) { | 2787 | while (seq < dumper->next_seq) { |
2809 | struct log *msg = log_from_idx(idx); | 2788 | struct printk_log *msg = log_from_idx(idx); |
2810 | 2789 | ||
2811 | l += msg_print_text(msg, prev, syslog, buf + l, size - l); | 2790 | l += msg_print_text(msg, prev, syslog, buf + l, size - l); |
2812 | idx = log_next(idx); | 2791 | idx = log_next(idx); |
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index bb456f44b7b1..9565645e3202 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c | |||
@@ -851,7 +851,7 @@ void task_numa_fault(int node, int pages, bool migrated) | |||
851 | { | 851 | { |
852 | struct task_struct *p = current; | 852 | struct task_struct *p = current; |
853 | 853 | ||
854 | if (!sched_feat_numa(NUMA)) | 854 | if (!numabalancing_enabled) |
855 | return; | 855 | return; |
856 | 856 | ||
857 | /* FIXME: Allocate task-specific structure for placement policy here */ | 857 | /* FIXME: Allocate task-specific structure for placement policy here */ |
@@ -5786,7 +5786,7 @@ static void task_tick_fair(struct rq *rq, struct task_struct *curr, int queued) | |||
5786 | entity_tick(cfs_rq, se, queued); | 5786 | entity_tick(cfs_rq, se, queued); |
5787 | } | 5787 | } |
5788 | 5788 | ||
5789 | if (sched_feat_numa(NUMA)) | 5789 | if (numabalancing_enabled) |
5790 | task_tick_numa(rq, curr); | 5790 | task_tick_numa(rq, curr); |
5791 | 5791 | ||
5792 | update_rq_runnable_avg(rq, 1); | 5792 | update_rq_runnable_avg(rq, 1); |
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index ac09d98490aa..07f6fc468e17 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
@@ -2346,7 +2346,11 @@ static int do_proc_dointvec_ms_jiffies_conv(bool *negp, unsigned long *lvalp, | |||
2346 | int write, void *data) | 2346 | int write, void *data) |
2347 | { | 2347 | { |
2348 | if (write) { | 2348 | if (write) { |
2349 | *valp = msecs_to_jiffies(*negp ? -*lvalp : *lvalp); | 2349 | unsigned long jif = msecs_to_jiffies(*negp ? -*lvalp : *lvalp); |
2350 | |||
2351 | if (jif > INT_MAX) | ||
2352 | return 1; | ||
2353 | *valp = (int)jif; | ||
2350 | } else { | 2354 | } else { |
2351 | int val = *valp; | 2355 | int val = *valp; |
2352 | unsigned long lval; | 2356 | unsigned long lval; |
diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 243e710c6039..a92012a71702 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c | |||
@@ -1620,7 +1620,9 @@ static void __split_huge_page_refcount(struct page *page, | |||
1620 | ((1L << PG_referenced) | | 1620 | ((1L << PG_referenced) | |
1621 | (1L << PG_swapbacked) | | 1621 | (1L << PG_swapbacked) | |
1622 | (1L << PG_mlocked) | | 1622 | (1L << PG_mlocked) | |
1623 | (1L << PG_uptodate))); | 1623 | (1L << PG_uptodate) | |
1624 | (1L << PG_active) | | ||
1625 | (1L << PG_unevictable))); | ||
1624 | page_tail->flags |= (1L << PG_dirty); | 1626 | page_tail->flags |= (1L << PG_dirty); |
1625 | 1627 | ||
1626 | /* clear PageTail before overwriting first_page */ | 1628 | /* clear PageTail before overwriting first_page */ |
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 00a7a664b9c1..c290a1cf3862 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -6335,6 +6335,7 @@ static void mem_cgroup_css_offline(struct cgroup *cont) | |||
6335 | mem_cgroup_invalidate_reclaim_iterators(memcg); | 6335 | mem_cgroup_invalidate_reclaim_iterators(memcg); |
6336 | mem_cgroup_reparent_charges(memcg); | 6336 | mem_cgroup_reparent_charges(memcg); |
6337 | mem_cgroup_destroy_all_caches(memcg); | 6337 | mem_cgroup_destroy_all_caches(memcg); |
6338 | vmpressure_cleanup(&memcg->vmpressure); | ||
6338 | } | 6339 | } |
6339 | 6340 | ||
6340 | static void mem_cgroup_css_free(struct cgroup *cont) | 6341 | static void mem_cgroup_css_free(struct cgroup *cont) |
diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 74310017296e..4baf12e534d1 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c | |||
@@ -732,7 +732,10 @@ static int mbind_range(struct mm_struct *mm, unsigned long start, | |||
732 | if (prev) { | 732 | if (prev) { |
733 | vma = prev; | 733 | vma = prev; |
734 | next = vma->vm_next; | 734 | next = vma->vm_next; |
735 | continue; | 735 | if (mpol_equal(vma_policy(vma), new_pol)) |
736 | continue; | ||
737 | /* vma_merge() joined vma && vma->next, case 8 */ | ||
738 | goto replace; | ||
736 | } | 739 | } |
737 | if (vma->vm_start != vmstart) { | 740 | if (vma->vm_start != vmstart) { |
738 | err = split_vma(vma->vm_mm, vma, vmstart, 1); | 741 | err = split_vma(vma->vm_mm, vma, vmstart, 1); |
@@ -744,6 +747,7 @@ static int mbind_range(struct mm_struct *mm, unsigned long start, | |||
744 | if (err) | 747 | if (err) |
745 | goto out; | 748 | goto out; |
746 | } | 749 | } |
750 | replace: | ||
747 | err = vma_replace_policy(vma, new_pol); | 751 | err = vma_replace_policy(vma, new_pol); |
748 | if (err) | 752 | if (err) |
749 | goto out; | 753 | goto out; |
@@ -865,7 +865,7 @@ again: remove_next = 1 + (end > next->vm_end); | |||
865 | if (next->anon_vma) | 865 | if (next->anon_vma) |
866 | anon_vma_merge(vma, next); | 866 | anon_vma_merge(vma, next); |
867 | mm->map_count--; | 867 | mm->map_count--; |
868 | vma_set_policy(vma, vma_policy(next)); | 868 | mpol_put(vma_policy(next)); |
869 | kmem_cache_free(vm_area_cachep, next); | 869 | kmem_cache_free(vm_area_cachep, next); |
870 | /* | 870 | /* |
871 | * In mprotect's case 6 (see comments on vma_merge), | 871 | * In mprotect's case 6 (see comments on vma_merge), |
@@ -512,12 +512,7 @@ EXPORT_SYMBOL(__lru_cache_add); | |||
512 | */ | 512 | */ |
513 | void lru_cache_add(struct page *page) | 513 | void lru_cache_add(struct page *page) |
514 | { | 514 | { |
515 | if (PageActive(page)) { | 515 | VM_BUG_ON(PageActive(page) && PageUnevictable(page)); |
516 | VM_BUG_ON(PageUnevictable(page)); | ||
517 | } else if (PageUnevictable(page)) { | ||
518 | VM_BUG_ON(PageActive(page)); | ||
519 | } | ||
520 | |||
521 | VM_BUG_ON(PageLRU(page)); | 516 | VM_BUG_ON(PageLRU(page)); |
522 | __lru_cache_add(page); | 517 | __lru_cache_add(page); |
523 | } | 518 | } |
@@ -539,6 +534,7 @@ void add_page_to_unevictable_list(struct page *page) | |||
539 | 534 | ||
540 | spin_lock_irq(&zone->lru_lock); | 535 | spin_lock_irq(&zone->lru_lock); |
541 | lruvec = mem_cgroup_page_lruvec(page, zone); | 536 | lruvec = mem_cgroup_page_lruvec(page, zone); |
537 | ClearPageActive(page); | ||
542 | SetPageUnevictable(page); | 538 | SetPageUnevictable(page); |
543 | SetPageLRU(page); | 539 | SetPageLRU(page); |
544 | add_page_to_lru_list(page, lruvec, LRU_UNEVICTABLE); | 540 | add_page_to_lru_list(page, lruvec, LRU_UNEVICTABLE); |
@@ -774,8 +770,6 @@ EXPORT_SYMBOL(__pagevec_release); | |||
774 | void lru_add_page_tail(struct page *page, struct page *page_tail, | 770 | void lru_add_page_tail(struct page *page, struct page *page_tail, |
775 | struct lruvec *lruvec, struct list_head *list) | 771 | struct lruvec *lruvec, struct list_head *list) |
776 | { | 772 | { |
777 | int uninitialized_var(active); | ||
778 | enum lru_list lru; | ||
779 | const int file = 0; | 773 | const int file = 0; |
780 | 774 | ||
781 | VM_BUG_ON(!PageHead(page)); | 775 | VM_BUG_ON(!PageHead(page)); |
@@ -787,20 +781,6 @@ void lru_add_page_tail(struct page *page, struct page *page_tail, | |||
787 | if (!list) | 781 | if (!list) |
788 | SetPageLRU(page_tail); | 782 | SetPageLRU(page_tail); |
789 | 783 | ||
790 | if (page_evictable(page_tail)) { | ||
791 | if (PageActive(page)) { | ||
792 | SetPageActive(page_tail); | ||
793 | active = 1; | ||
794 | lru = LRU_ACTIVE_ANON; | ||
795 | } else { | ||
796 | active = 0; | ||
797 | lru = LRU_INACTIVE_ANON; | ||
798 | } | ||
799 | } else { | ||
800 | SetPageUnevictable(page_tail); | ||
801 | lru = LRU_UNEVICTABLE; | ||
802 | } | ||
803 | |||
804 | if (likely(PageLRU(page))) | 784 | if (likely(PageLRU(page))) |
805 | list_add_tail(&page_tail->lru, &page->lru); | 785 | list_add_tail(&page_tail->lru, &page->lru); |
806 | else if (list) { | 786 | else if (list) { |
@@ -816,13 +796,13 @@ void lru_add_page_tail(struct page *page, struct page *page_tail, | |||
816 | * Use the standard add function to put page_tail on the list, | 796 | * Use the standard add function to put page_tail on the list, |
817 | * but then correct its position so they all end up in order. | 797 | * but then correct its position so they all end up in order. |
818 | */ | 798 | */ |
819 | add_page_to_lru_list(page_tail, lruvec, lru); | 799 | add_page_to_lru_list(page_tail, lruvec, page_lru(page_tail)); |
820 | list_head = page_tail->lru.prev; | 800 | list_head = page_tail->lru.prev; |
821 | list_move_tail(&page_tail->lru, list_head); | 801 | list_move_tail(&page_tail->lru, list_head); |
822 | } | 802 | } |
823 | 803 | ||
824 | if (!PageUnevictable(page)) | 804 | if (!PageUnevictable(page)) |
825 | update_page_reclaim_stat(lruvec, file, active); | 805 | update_page_reclaim_stat(lruvec, file, PageActive(page_tail)); |
826 | } | 806 | } |
827 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ | 807 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ |
828 | 808 | ||
@@ -833,7 +813,6 @@ static void __pagevec_lru_add_fn(struct page *page, struct lruvec *lruvec, | |||
833 | int active = PageActive(page); | 813 | int active = PageActive(page); |
834 | enum lru_list lru = page_lru(page); | 814 | enum lru_list lru = page_lru(page); |
835 | 815 | ||
836 | VM_BUG_ON(PageUnevictable(page)); | ||
837 | VM_BUG_ON(PageLRU(page)); | 816 | VM_BUG_ON(PageLRU(page)); |
838 | 817 | ||
839 | SetPageLRU(page); | 818 | SetPageLRU(page); |
diff --git a/mm/vmpressure.c b/mm/vmpressure.c index 736a6011c2c8..0c1e37d829fa 100644 --- a/mm/vmpressure.c +++ b/mm/vmpressure.c | |||
@@ -180,12 +180,12 @@ static void vmpressure_work_fn(struct work_struct *work) | |||
180 | if (!vmpr->scanned) | 180 | if (!vmpr->scanned) |
181 | return; | 181 | return; |
182 | 182 | ||
183 | mutex_lock(&vmpr->sr_lock); | 183 | spin_lock(&vmpr->sr_lock); |
184 | scanned = vmpr->scanned; | 184 | scanned = vmpr->scanned; |
185 | reclaimed = vmpr->reclaimed; | 185 | reclaimed = vmpr->reclaimed; |
186 | vmpr->scanned = 0; | 186 | vmpr->scanned = 0; |
187 | vmpr->reclaimed = 0; | 187 | vmpr->reclaimed = 0; |
188 | mutex_unlock(&vmpr->sr_lock); | 188 | spin_unlock(&vmpr->sr_lock); |
189 | 189 | ||
190 | do { | 190 | do { |
191 | if (vmpressure_event(vmpr, scanned, reclaimed)) | 191 | if (vmpressure_event(vmpr, scanned, reclaimed)) |
@@ -240,13 +240,13 @@ void vmpressure(gfp_t gfp, struct mem_cgroup *memcg, | |||
240 | if (!scanned) | 240 | if (!scanned) |
241 | return; | 241 | return; |
242 | 242 | ||
243 | mutex_lock(&vmpr->sr_lock); | 243 | spin_lock(&vmpr->sr_lock); |
244 | vmpr->scanned += scanned; | 244 | vmpr->scanned += scanned; |
245 | vmpr->reclaimed += reclaimed; | 245 | vmpr->reclaimed += reclaimed; |
246 | scanned = vmpr->scanned; | 246 | scanned = vmpr->scanned; |
247 | mutex_unlock(&vmpr->sr_lock); | 247 | spin_unlock(&vmpr->sr_lock); |
248 | 248 | ||
249 | if (scanned < vmpressure_win || work_pending(&vmpr->work)) | 249 | if (scanned < vmpressure_win) |
250 | return; | 250 | return; |
251 | schedule_work(&vmpr->work); | 251 | schedule_work(&vmpr->work); |
252 | } | 252 | } |
@@ -367,8 +367,24 @@ void vmpressure_unregister_event(struct cgroup *cg, struct cftype *cft, | |||
367 | */ | 367 | */ |
368 | void vmpressure_init(struct vmpressure *vmpr) | 368 | void vmpressure_init(struct vmpressure *vmpr) |
369 | { | 369 | { |
370 | mutex_init(&vmpr->sr_lock); | 370 | spin_lock_init(&vmpr->sr_lock); |
371 | mutex_init(&vmpr->events_lock); | 371 | mutex_init(&vmpr->events_lock); |
372 | INIT_LIST_HEAD(&vmpr->events); | 372 | INIT_LIST_HEAD(&vmpr->events); |
373 | INIT_WORK(&vmpr->work, vmpressure_work_fn); | 373 | INIT_WORK(&vmpr->work, vmpressure_work_fn); |
374 | } | 374 | } |
375 | |||
376 | /** | ||
377 | * vmpressure_cleanup() - shuts down vmpressure control structure | ||
378 | * @vmpr: Structure to be cleaned up | ||
379 | * | ||
380 | * This function should be called before the structure in which it is | ||
381 | * embedded is cleaned up. | ||
382 | */ | ||
383 | void vmpressure_cleanup(struct vmpressure *vmpr) | ||
384 | { | ||
385 | /* | ||
386 | * Make sure there is no pending work before eventfd infrastructure | ||
387 | * goes away. | ||
388 | */ | ||
389 | flush_work(&vmpr->work); | ||
390 | } | ||
@@ -257,7 +257,7 @@ int zbud_alloc(struct zbud_pool *pool, int size, gfp_t gfp, | |||
257 | 257 | ||
258 | if (size <= 0 || gfp & __GFP_HIGHMEM) | 258 | if (size <= 0 || gfp & __GFP_HIGHMEM) |
259 | return -EINVAL; | 259 | return -EINVAL; |
260 | if (size > PAGE_SIZE - ZHDR_SIZE_ALIGNED) | 260 | if (size > PAGE_SIZE - ZHDR_SIZE_ALIGNED - CHUNK_SIZE) |
261 | return -ENOSPC; | 261 | return -ENOSPC; |
262 | chunks = size_to_chunks(size); | 262 | chunks = size_to_chunks(size); |
263 | spin_lock(&pool->lock); | 263 | spin_lock(&pool->lock); |
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c index 69af490cce44..4b99c9a27044 100644 --- a/net/bridge/br_multicast.c +++ b/net/bridge/br_multicast.c | |||
@@ -619,6 +619,9 @@ rehash: | |||
619 | mp->br = br; | 619 | mp->br = br; |
620 | mp->addr = *group; | 620 | mp->addr = *group; |
621 | 621 | ||
622 | setup_timer(&mp->timer, br_multicast_group_expired, | ||
623 | (unsigned long)mp); | ||
624 | |||
622 | hlist_add_head_rcu(&mp->hlist[mdb->ver], &mdb->mhash[hash]); | 625 | hlist_add_head_rcu(&mp->hlist[mdb->ver], &mdb->mhash[hash]); |
623 | mdb->size++; | 626 | mdb->size++; |
624 | 627 | ||
@@ -1126,7 +1129,6 @@ static int br_ip4_multicast_query(struct net_bridge *br, | |||
1126 | if (!mp) | 1129 | if (!mp) |
1127 | goto out; | 1130 | goto out; |
1128 | 1131 | ||
1129 | setup_timer(&mp->timer, br_multicast_group_expired, (unsigned long)mp); | ||
1130 | mod_timer(&mp->timer, now + br->multicast_membership_interval); | 1132 | mod_timer(&mp->timer, now + br->multicast_membership_interval); |
1131 | mp->timer_armed = true; | 1133 | mp->timer_armed = true; |
1132 | 1134 | ||
@@ -1204,7 +1206,6 @@ static int br_ip6_multicast_query(struct net_bridge *br, | |||
1204 | if (!mp) | 1206 | if (!mp) |
1205 | goto out; | 1207 | goto out; |
1206 | 1208 | ||
1207 | setup_timer(&mp->timer, br_multicast_group_expired, (unsigned long)mp); | ||
1208 | mod_timer(&mp->timer, now + br->multicast_membership_interval); | 1209 | mod_timer(&mp->timer, now + br->multicast_membership_interval); |
1209 | mp->timer_armed = true; | 1210 | mp->timer_armed = true; |
1210 | 1211 | ||
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index b7de821f98df..9232c68941ab 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c | |||
@@ -2767,6 +2767,7 @@ EXPORT_SYMBOL(neigh_app_ns); | |||
2767 | 2767 | ||
2768 | #ifdef CONFIG_SYSCTL | 2768 | #ifdef CONFIG_SYSCTL |
2769 | static int zero; | 2769 | static int zero; |
2770 | static int int_max = INT_MAX; | ||
2770 | static int unres_qlen_max = INT_MAX / SKB_TRUESIZE(ETH_FRAME_LEN); | 2771 | static int unres_qlen_max = INT_MAX / SKB_TRUESIZE(ETH_FRAME_LEN); |
2771 | 2772 | ||
2772 | static int proc_unres_qlen(struct ctl_table *ctl, int write, | 2773 | static int proc_unres_qlen(struct ctl_table *ctl, int write, |
@@ -2819,19 +2820,25 @@ static struct neigh_sysctl_table { | |||
2819 | .procname = "mcast_solicit", | 2820 | .procname = "mcast_solicit", |
2820 | .maxlen = sizeof(int), | 2821 | .maxlen = sizeof(int), |
2821 | .mode = 0644, | 2822 | .mode = 0644, |
2822 | .proc_handler = proc_dointvec, | 2823 | .extra1 = &zero, |
2824 | .extra2 = &int_max, | ||
2825 | .proc_handler = proc_dointvec_minmax, | ||
2823 | }, | 2826 | }, |
2824 | [NEIGH_VAR_UCAST_PROBE] = { | 2827 | [NEIGH_VAR_UCAST_PROBE] = { |
2825 | .procname = "ucast_solicit", | 2828 | .procname = "ucast_solicit", |
2826 | .maxlen = sizeof(int), | 2829 | .maxlen = sizeof(int), |
2827 | .mode = 0644, | 2830 | .mode = 0644, |
2828 | .proc_handler = proc_dointvec, | 2831 | .extra1 = &zero, |
2832 | .extra2 = &int_max, | ||
2833 | .proc_handler = proc_dointvec_minmax, | ||
2829 | }, | 2834 | }, |
2830 | [NEIGH_VAR_APP_PROBE] = { | 2835 | [NEIGH_VAR_APP_PROBE] = { |
2831 | .procname = "app_solicit", | 2836 | .procname = "app_solicit", |
2832 | .maxlen = sizeof(int), | 2837 | .maxlen = sizeof(int), |
2833 | .mode = 0644, | 2838 | .mode = 0644, |
2834 | .proc_handler = proc_dointvec, | 2839 | .extra1 = &zero, |
2840 | .extra2 = &int_max, | ||
2841 | .proc_handler = proc_dointvec_minmax, | ||
2835 | }, | 2842 | }, |
2836 | [NEIGH_VAR_RETRANS_TIME] = { | 2843 | [NEIGH_VAR_RETRANS_TIME] = { |
2837 | .procname = "retrans_time", | 2844 | .procname = "retrans_time", |
@@ -2874,7 +2881,9 @@ static struct neigh_sysctl_table { | |||
2874 | .procname = "proxy_qlen", | 2881 | .procname = "proxy_qlen", |
2875 | .maxlen = sizeof(int), | 2882 | .maxlen = sizeof(int), |
2876 | .mode = 0644, | 2883 | .mode = 0644, |
2877 | .proc_handler = proc_dointvec, | 2884 | .extra1 = &zero, |
2885 | .extra2 = &int_max, | ||
2886 | .proc_handler = proc_dointvec_minmax, | ||
2878 | }, | 2887 | }, |
2879 | [NEIGH_VAR_ANYCAST_DELAY] = { | 2888 | [NEIGH_VAR_ANYCAST_DELAY] = { |
2880 | .procname = "anycast_delay", | 2889 | .procname = "anycast_delay", |
@@ -2916,19 +2925,25 @@ static struct neigh_sysctl_table { | |||
2916 | .procname = "gc_thresh1", | 2925 | .procname = "gc_thresh1", |
2917 | .maxlen = sizeof(int), | 2926 | .maxlen = sizeof(int), |
2918 | .mode = 0644, | 2927 | .mode = 0644, |
2919 | .proc_handler = proc_dointvec, | 2928 | .extra1 = &zero, |
2929 | .extra2 = &int_max, | ||
2930 | .proc_handler = proc_dointvec_minmax, | ||
2920 | }, | 2931 | }, |
2921 | [NEIGH_VAR_GC_THRESH2] = { | 2932 | [NEIGH_VAR_GC_THRESH2] = { |
2922 | .procname = "gc_thresh2", | 2933 | .procname = "gc_thresh2", |
2923 | .maxlen = sizeof(int), | 2934 | .maxlen = sizeof(int), |
2924 | .mode = 0644, | 2935 | .mode = 0644, |
2925 | .proc_handler = proc_dointvec, | 2936 | .extra1 = &zero, |
2937 | .extra2 = &int_max, | ||
2938 | .proc_handler = proc_dointvec_minmax, | ||
2926 | }, | 2939 | }, |
2927 | [NEIGH_VAR_GC_THRESH3] = { | 2940 | [NEIGH_VAR_GC_THRESH3] = { |
2928 | .procname = "gc_thresh3", | 2941 | .procname = "gc_thresh3", |
2929 | .maxlen = sizeof(int), | 2942 | .maxlen = sizeof(int), |
2930 | .mode = 0644, | 2943 | .mode = 0644, |
2931 | .proc_handler = proc_dointvec, | 2944 | .extra1 = &zero, |
2945 | .extra2 = &int_max, | ||
2946 | .proc_handler = proc_dointvec_minmax, | ||
2932 | }, | 2947 | }, |
2933 | {}, | 2948 | {}, |
2934 | }, | 2949 | }, |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 20e02d2605ec..3df4d4ccf440 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -309,7 +309,8 @@ EXPORT_SYMBOL(__alloc_skb); | |||
309 | * @frag_size: size of fragment, or 0 if head was kmalloced | 309 | * @frag_size: size of fragment, or 0 if head was kmalloced |
310 | * | 310 | * |
311 | * Allocate a new &sk_buff. Caller provides space holding head and | 311 | * Allocate a new &sk_buff. Caller provides space holding head and |
312 | * skb_shared_info. @data must have been allocated by kmalloc() | 312 | * skb_shared_info. @data must have been allocated by kmalloc() only if |
313 | * @frag_size is 0, otherwise data should come from the page allocator. | ||
313 | * The return is the new skb buffer. | 314 | * The return is the new skb buffer. |
314 | * On a failure the return is %NULL, and @data is not freed. | 315 | * On a failure the return is %NULL, and @data is not freed. |
315 | * Notes : | 316 | * Notes : |
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index 49616fed9340..108a1e9c9eac 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c | |||
@@ -2133,7 +2133,7 @@ static void trie_show_stats(struct seq_file *seq, struct trie_stat *stat) | |||
2133 | max--; | 2133 | max--; |
2134 | 2134 | ||
2135 | pointers = 0; | 2135 | pointers = 0; |
2136 | for (i = 1; i <= max; i++) | 2136 | for (i = 1; i < max; i++) |
2137 | if (stat->nodesizes[i] != 0) { | 2137 | if (stat->nodesizes[i] != 0) { |
2138 | seq_printf(seq, " %u: %u", i, stat->nodesizes[i]); | 2138 | seq_printf(seq, " %u: %u", i, stat->nodesizes[i]); |
2139 | pointers += (1<<i) * stat->nodesizes[i]; | 2139 | pointers += (1<<i) * stat->nodesizes[i]; |
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c index b2c123c44d69..610e324348d1 100644 --- a/net/ipv4/sysctl_net_ipv4.c +++ b/net/ipv4/sysctl_net_ipv4.c | |||
@@ -36,6 +36,8 @@ static int tcp_adv_win_scale_min = -31; | |||
36 | static int tcp_adv_win_scale_max = 31; | 36 | static int tcp_adv_win_scale_max = 31; |
37 | static int ip_ttl_min = 1; | 37 | static int ip_ttl_min = 1; |
38 | static int ip_ttl_max = 255; | 38 | static int ip_ttl_max = 255; |
39 | static int tcp_syn_retries_min = 1; | ||
40 | static int tcp_syn_retries_max = MAX_TCP_SYNCNT; | ||
39 | static int ip_ping_group_range_min[] = { 0, 0 }; | 41 | static int ip_ping_group_range_min[] = { 0, 0 }; |
40 | static int ip_ping_group_range_max[] = { GID_T_MAX, GID_T_MAX }; | 42 | static int ip_ping_group_range_max[] = { GID_T_MAX, GID_T_MAX }; |
41 | 43 | ||
@@ -332,7 +334,9 @@ static struct ctl_table ipv4_table[] = { | |||
332 | .data = &sysctl_tcp_syn_retries, | 334 | .data = &sysctl_tcp_syn_retries, |
333 | .maxlen = sizeof(int), | 335 | .maxlen = sizeof(int), |
334 | .mode = 0644, | 336 | .mode = 0644, |
335 | .proc_handler = proc_dointvec | 337 | .proc_handler = proc_dointvec_minmax, |
338 | .extra1 = &tcp_syn_retries_min, | ||
339 | .extra2 = &tcp_syn_retries_max | ||
336 | }, | 340 | }, |
337 | { | 341 | { |
338 | .procname = "tcp_synack_retries", | 342 | .procname = "tcp_synack_retries", |
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c index 583e8d435f9a..03986d31fa41 100644 --- a/net/ipv6/ip6mr.c +++ b/net/ipv6/ip6mr.c | |||
@@ -259,10 +259,12 @@ static void __net_exit ip6mr_rules_exit(struct net *net) | |||
259 | { | 259 | { |
260 | struct mr6_table *mrt, *next; | 260 | struct mr6_table *mrt, *next; |
261 | 261 | ||
262 | rtnl_lock(); | ||
262 | list_for_each_entry_safe(mrt, next, &net->ipv6.mr6_tables, list) { | 263 | list_for_each_entry_safe(mrt, next, &net->ipv6.mr6_tables, list) { |
263 | list_del(&mrt->list); | 264 | list_del(&mrt->list); |
264 | ip6mr_free_table(mrt); | 265 | ip6mr_free_table(mrt); |
265 | } | 266 | } |
267 | rtnl_unlock(); | ||
266 | fib_rules_unregister(net->ipv6.mr6_rules_ops); | 268 | fib_rules_unregister(net->ipv6.mr6_rules_ops); |
267 | } | 269 | } |
268 | #else | 270 | #else |
@@ -289,7 +291,10 @@ static int __net_init ip6mr_rules_init(struct net *net) | |||
289 | 291 | ||
290 | static void __net_exit ip6mr_rules_exit(struct net *net) | 292 | static void __net_exit ip6mr_rules_exit(struct net *net) |
291 | { | 293 | { |
294 | rtnl_lock(); | ||
292 | ip6mr_free_table(net->ipv6.mrt6); | 295 | ip6mr_free_table(net->ipv6.mrt6); |
296 | net->ipv6.mrt6 = NULL; | ||
297 | rtnl_unlock(); | ||
293 | } | 298 | } |
294 | #endif | 299 | #endif |
295 | 300 | ||
diff --git a/net/key/af_key.c b/net/key/af_key.c index 9da862070dd8..ab8bd2cabfa0 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c | |||
@@ -2081,6 +2081,7 @@ static int pfkey_xfrm_policy2msg(struct sk_buff *skb, const struct xfrm_policy * | |||
2081 | pol->sadb_x_policy_type = IPSEC_POLICY_NONE; | 2081 | pol->sadb_x_policy_type = IPSEC_POLICY_NONE; |
2082 | } | 2082 | } |
2083 | pol->sadb_x_policy_dir = dir+1; | 2083 | pol->sadb_x_policy_dir = dir+1; |
2084 | pol->sadb_x_policy_reserved = 0; | ||
2084 | pol->sadb_x_policy_id = xp->index; | 2085 | pol->sadb_x_policy_id = xp->index; |
2085 | pol->sadb_x_policy_priority = xp->priority; | 2086 | pol->sadb_x_policy_priority = xp->priority; |
2086 | 2087 | ||
@@ -3137,7 +3138,9 @@ static int pfkey_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *t, struct | |||
3137 | pol->sadb_x_policy_exttype = SADB_X_EXT_POLICY; | 3138 | pol->sadb_x_policy_exttype = SADB_X_EXT_POLICY; |
3138 | pol->sadb_x_policy_type = IPSEC_POLICY_IPSEC; | 3139 | pol->sadb_x_policy_type = IPSEC_POLICY_IPSEC; |
3139 | pol->sadb_x_policy_dir = XFRM_POLICY_OUT + 1; | 3140 | pol->sadb_x_policy_dir = XFRM_POLICY_OUT + 1; |
3141 | pol->sadb_x_policy_reserved = 0; | ||
3140 | pol->sadb_x_policy_id = xp->index; | 3142 | pol->sadb_x_policy_id = xp->index; |
3143 | pol->sadb_x_policy_priority = xp->priority; | ||
3141 | 3144 | ||
3142 | /* Set sadb_comb's. */ | 3145 | /* Set sadb_comb's. */ |
3143 | if (x->id.proto == IPPROTO_AH) | 3146 | if (x->id.proto == IPPROTO_AH) |
@@ -3525,6 +3528,7 @@ static int pfkey_send_migrate(const struct xfrm_selector *sel, u8 dir, u8 type, | |||
3525 | pol->sadb_x_policy_exttype = SADB_X_EXT_POLICY; | 3528 | pol->sadb_x_policy_exttype = SADB_X_EXT_POLICY; |
3526 | pol->sadb_x_policy_type = IPSEC_POLICY_IPSEC; | 3529 | pol->sadb_x_policy_type = IPSEC_POLICY_IPSEC; |
3527 | pol->sadb_x_policy_dir = dir + 1; | 3530 | pol->sadb_x_policy_dir = dir + 1; |
3531 | pol->sadb_x_policy_reserved = 0; | ||
3528 | pol->sadb_x_policy_id = 0; | 3532 | pol->sadb_x_policy_id = 0; |
3529 | pol->sadb_x_policy_priority = 0; | 3533 | pol->sadb_x_policy_priority = 0; |
3530 | 3534 | ||
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 8184d121ff09..43dd7525bfcb 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -666,6 +666,8 @@ static void ieee80211_get_et_stats(struct wiphy *wiphy, | |||
666 | if (sta->sdata->dev != dev) | 666 | if (sta->sdata->dev != dev) |
667 | continue; | 667 | continue; |
668 | 668 | ||
669 | sinfo.filled = 0; | ||
670 | sta_set_sinfo(sta, &sinfo); | ||
669 | i = 0; | 671 | i = 0; |
670 | ADD_STA_STATS(sta); | 672 | ADD_STA_STATS(sta); |
671 | } | 673 | } |
diff --git a/net/mac80211/rc80211_minstrel.c b/net/mac80211/rc80211_minstrel.c index ac7ef5414bde..e6512e2ffd20 100644 --- a/net/mac80211/rc80211_minstrel.c +++ b/net/mac80211/rc80211_minstrel.c | |||
@@ -290,7 +290,7 @@ minstrel_get_rate(void *priv, struct ieee80211_sta *sta, | |||
290 | struct minstrel_rate *msr, *mr; | 290 | struct minstrel_rate *msr, *mr; |
291 | unsigned int ndx; | 291 | unsigned int ndx; |
292 | bool mrr_capable; | 292 | bool mrr_capable; |
293 | bool prev_sample = mi->prev_sample; | 293 | bool prev_sample; |
294 | int delta; | 294 | int delta; |
295 | int sampling_ratio; | 295 | int sampling_ratio; |
296 | 296 | ||
@@ -314,6 +314,7 @@ minstrel_get_rate(void *priv, struct ieee80211_sta *sta, | |||
314 | (mi->sample_count + mi->sample_deferred / 2); | 314 | (mi->sample_count + mi->sample_deferred / 2); |
315 | 315 | ||
316 | /* delta < 0: no sampling required */ | 316 | /* delta < 0: no sampling required */ |
317 | prev_sample = mi->prev_sample; | ||
317 | mi->prev_sample = false; | 318 | mi->prev_sample = false; |
318 | if (delta < 0 || (!mrr_capable && prev_sample)) | 319 | if (delta < 0 || (!mrr_capable && prev_sample)) |
319 | return; | 320 | return; |
diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c index 5b2d3012b983..f5aed963b22e 100644 --- a/net/mac80211/rc80211_minstrel_ht.c +++ b/net/mac80211/rc80211_minstrel_ht.c | |||
@@ -804,10 +804,18 @@ minstrel_ht_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta, | |||
804 | 804 | ||
805 | sample_group = &minstrel_mcs_groups[sample_idx / MCS_GROUP_RATES]; | 805 | sample_group = &minstrel_mcs_groups[sample_idx / MCS_GROUP_RATES]; |
806 | info->flags |= IEEE80211_TX_CTL_RATE_CTRL_PROBE; | 806 | info->flags |= IEEE80211_TX_CTL_RATE_CTRL_PROBE; |
807 | rate->count = 1; | ||
808 | |||
809 | if (sample_idx / MCS_GROUP_RATES == MINSTREL_CCK_GROUP) { | ||
810 | int idx = sample_idx % ARRAY_SIZE(mp->cck_rates); | ||
811 | rate->idx = mp->cck_rates[idx]; | ||
812 | rate->flags = 0; | ||
813 | return; | ||
814 | } | ||
815 | |||
807 | rate->idx = sample_idx % MCS_GROUP_RATES + | 816 | rate->idx = sample_idx % MCS_GROUP_RATES + |
808 | (sample_group->streams - 1) * MCS_GROUP_RATES; | 817 | (sample_group->streams - 1) * MCS_GROUP_RATES; |
809 | rate->flags = IEEE80211_TX_RC_MCS | sample_group->flags; | 818 | rate->flags = IEEE80211_TX_RC_MCS | sample_group->flags; |
810 | rate->count = 1; | ||
811 | } | 819 | } |
812 | 820 | ||
813 | static void | 821 | static void |
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 23dbcfc69b3b..2c5a79bd3777 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -936,8 +936,14 @@ ieee80211_rx_h_check(struct ieee80211_rx_data *rx) | |||
936 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; | 936 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; |
937 | struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); | 937 | struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); |
938 | 938 | ||
939 | /* Drop duplicate 802.11 retransmissions (IEEE 802.11 Chap. 9.2.9) */ | 939 | /* |
940 | if (rx->sta && !is_multicast_ether_addr(hdr->addr1)) { | 940 | * Drop duplicate 802.11 retransmissions |
941 | * (IEEE 802.11-2012: 9.3.2.10 "Duplicate detection and recovery") | ||
942 | */ | ||
943 | if (rx->skb->len >= 24 && rx->sta && | ||
944 | !ieee80211_is_ctl(hdr->frame_control) && | ||
945 | !ieee80211_is_qos_nullfunc(hdr->frame_control) && | ||
946 | !is_multicast_ether_addr(hdr->addr1)) { | ||
941 | if (unlikely(ieee80211_has_retry(hdr->frame_control) && | 947 | if (unlikely(ieee80211_has_retry(hdr->frame_control) && |
942 | rx->sta->last_seq_ctrl[rx->seqno_idx] == | 948 | rx->sta->last_seq_ctrl[rx->seqno_idx] == |
943 | hdr->seq_ctrl)) { | 949 | hdr->seq_ctrl)) { |
diff --git a/net/netfilter/nf_conntrack_expect.c b/net/netfilter/nf_conntrack_expect.c index c63b618cd619..4fd1ca94fd4a 100644 --- a/net/netfilter/nf_conntrack_expect.c +++ b/net/netfilter/nf_conntrack_expect.c | |||
@@ -293,6 +293,11 @@ void nf_ct_expect_init(struct nf_conntrack_expect *exp, unsigned int class, | |||
293 | sizeof(exp->tuple.dst.u3) - len); | 293 | sizeof(exp->tuple.dst.u3) - len); |
294 | 294 | ||
295 | exp->tuple.dst.u.all = *dst; | 295 | exp->tuple.dst.u.all = *dst; |
296 | |||
297 | #ifdef CONFIG_NF_NAT_NEEDED | ||
298 | memset(&exp->saved_addr, 0, sizeof(exp->saved_addr)); | ||
299 | memset(&exp->saved_proto, 0, sizeof(exp->saved_proto)); | ||
300 | #endif | ||
296 | } | 301 | } |
297 | EXPORT_SYMBOL_GPL(nf_ct_expect_init); | 302 | EXPORT_SYMBOL_GPL(nf_ct_expect_init); |
298 | 303 | ||
diff --git a/net/netfilter/xt_socket.c b/net/netfilter/xt_socket.c index f8b71911037a..20b15916f403 100644 --- a/net/netfilter/xt_socket.c +++ b/net/netfilter/xt_socket.c | |||
@@ -172,7 +172,7 @@ socket_match(const struct sk_buff *skb, struct xt_action_param *par, | |||
172 | 172 | ||
173 | /* Ignore non-transparent sockets, | 173 | /* Ignore non-transparent sockets, |
174 | if XT_SOCKET_TRANSPARENT is used */ | 174 | if XT_SOCKET_TRANSPARENT is used */ |
175 | if (info && info->flags & XT_SOCKET_TRANSPARENT) | 175 | if (info->flags & XT_SOCKET_TRANSPARENT) |
176 | transparent = ((sk->sk_state != TCP_TIME_WAIT && | 176 | transparent = ((sk->sk_state != TCP_TIME_WAIT && |
177 | inet_sk(sk)->transparent) || | 177 | inet_sk(sk)->transparent) || |
178 | (sk->sk_state == TCP_TIME_WAIT && | 178 | (sk->sk_state == TCP_TIME_WAIT && |
@@ -196,7 +196,11 @@ socket_match(const struct sk_buff *skb, struct xt_action_param *par, | |||
196 | static bool | 196 | static bool |
197 | socket_mt4_v0(const struct sk_buff *skb, struct xt_action_param *par) | 197 | socket_mt4_v0(const struct sk_buff *skb, struct xt_action_param *par) |
198 | { | 198 | { |
199 | return socket_match(skb, par, NULL); | 199 | static struct xt_socket_mtinfo1 xt_info_v0 = { |
200 | .flags = 0, | ||
201 | }; | ||
202 | |||
203 | return socket_match(skb, par, &xt_info_v0); | ||
200 | } | 204 | } |
201 | 205 | ||
202 | static bool | 206 | static bool |
@@ -314,7 +318,7 @@ socket_mt6_v1_v2(const struct sk_buff *skb, struct xt_action_param *par) | |||
314 | 318 | ||
315 | /* Ignore non-transparent sockets, | 319 | /* Ignore non-transparent sockets, |
316 | if XT_SOCKET_TRANSPARENT is used */ | 320 | if XT_SOCKET_TRANSPARENT is used */ |
317 | if (info && info->flags & XT_SOCKET_TRANSPARENT) | 321 | if (info->flags & XT_SOCKET_TRANSPARENT) |
318 | transparent = ((sk->sk_state != TCP_TIME_WAIT && | 322 | transparent = ((sk->sk_state != TCP_TIME_WAIT && |
319 | inet_sk(sk)->transparent) || | 323 | inet_sk(sk)->transparent) || |
320 | (sk->sk_state == TCP_TIME_WAIT && | 324 | (sk->sk_state == TCP_TIME_WAIT && |
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c index 2fd6dbea327a..512718adb0d5 100644 --- a/net/netlink/genetlink.c +++ b/net/netlink/genetlink.c | |||
@@ -571,7 +571,7 @@ static int genl_family_rcv_msg(struct genl_family *family, | |||
571 | !capable(CAP_NET_ADMIN)) | 571 | !capable(CAP_NET_ADMIN)) |
572 | return -EPERM; | 572 | return -EPERM; |
573 | 573 | ||
574 | if (nlh->nlmsg_flags & NLM_F_DUMP) { | 574 | if ((nlh->nlmsg_flags & NLM_F_DUMP) == NLM_F_DUMP) { |
575 | struct netlink_dump_control c = { | 575 | struct netlink_dump_control c = { |
576 | .dump = ops->dumpit, | 576 | .dump = ops->dumpit, |
577 | .done = ops->done, | 577 | .done = ops->done, |
@@ -877,8 +877,10 @@ static int ctrl_getfamily(struct sk_buff *skb, struct genl_info *info) | |||
877 | #ifdef CONFIG_MODULES | 877 | #ifdef CONFIG_MODULES |
878 | if (res == NULL) { | 878 | if (res == NULL) { |
879 | genl_unlock(); | 879 | genl_unlock(); |
880 | up_read(&cb_lock); | ||
880 | request_module("net-pf-%d-proto-%d-family-%s", | 881 | request_module("net-pf-%d-proto-%d-family-%s", |
881 | PF_NETLINK, NETLINK_GENERIC, name); | 882 | PF_NETLINK, NETLINK_GENERIC, name); |
883 | down_read(&cb_lock); | ||
882 | genl_lock(); | 884 | genl_lock(); |
883 | res = genl_family_find_byname(name); | 885 | res = genl_family_find_byname(name); |
884 | } | 886 | } |
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c index 71a568862557..7a42c81a19eb 100644 --- a/net/sched/sch_cbq.c +++ b/net/sched/sch_cbq.c | |||
@@ -1465,6 +1465,7 @@ static int cbq_dump_wrr(struct sk_buff *skb, struct cbq_class *cl) | |||
1465 | unsigned char *b = skb_tail_pointer(skb); | 1465 | unsigned char *b = skb_tail_pointer(skb); |
1466 | struct tc_cbq_wrropt opt; | 1466 | struct tc_cbq_wrropt opt; |
1467 | 1467 | ||
1468 | memset(&opt, 0, sizeof(opt)); | ||
1468 | opt.flags = 0; | 1469 | opt.flags = 0; |
1469 | opt.allot = cl->allot; | 1470 | opt.allot = cl->allot; |
1470 | opt.priority = cl->priority + 1; | 1471 | opt.priority = cl->priority + 1; |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 1cc47aca7f05..25d217d90807 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -4770,9 +4770,9 @@ do { \ | |||
4770 | FILL_IN_MESH_PARAM_IF_SET(tb, cfg, dot11MeshForwarding, 0, 1, | 4770 | FILL_IN_MESH_PARAM_IF_SET(tb, cfg, dot11MeshForwarding, 0, 1, |
4771 | mask, NL80211_MESHCONF_FORWARDING, | 4771 | mask, NL80211_MESHCONF_FORWARDING, |
4772 | nla_get_u8); | 4772 | nla_get_u8); |
4773 | FILL_IN_MESH_PARAM_IF_SET(tb, cfg, rssi_threshold, 1, 255, | 4773 | FILL_IN_MESH_PARAM_IF_SET(tb, cfg, rssi_threshold, -255, 0, |
4774 | mask, NL80211_MESHCONF_RSSI_THRESHOLD, | 4774 | mask, NL80211_MESHCONF_RSSI_THRESHOLD, |
4775 | nla_get_u32); | 4775 | nla_get_s32); |
4776 | FILL_IN_MESH_PARAM_IF_SET(tb, cfg, ht_opmode, 0, 16, | 4776 | FILL_IN_MESH_PARAM_IF_SET(tb, cfg, ht_opmode, 0, 16, |
4777 | mask, NL80211_MESHCONF_HT_OPMODE, | 4777 | mask, NL80211_MESHCONF_HT_OPMODE, |
4778 | nla_get_u16); | 4778 | nla_get_u16); |
@@ -6613,12 +6613,14 @@ EXPORT_SYMBOL(cfg80211_testmode_alloc_event_skb); | |||
6613 | 6613 | ||
6614 | void cfg80211_testmode_event(struct sk_buff *skb, gfp_t gfp) | 6614 | void cfg80211_testmode_event(struct sk_buff *skb, gfp_t gfp) |
6615 | { | 6615 | { |
6616 | struct cfg80211_registered_device *rdev = ((void **)skb->cb)[0]; | ||
6616 | void *hdr = ((void **)skb->cb)[1]; | 6617 | void *hdr = ((void **)skb->cb)[1]; |
6617 | struct nlattr *data = ((void **)skb->cb)[2]; | 6618 | struct nlattr *data = ((void **)skb->cb)[2]; |
6618 | 6619 | ||
6619 | nla_nest_end(skb, data); | 6620 | nla_nest_end(skb, data); |
6620 | genlmsg_end(skb, hdr); | 6621 | genlmsg_end(skb, hdr); |
6621 | genlmsg_multicast(skb, 0, nl80211_testmode_mcgrp.id, gfp); | 6622 | genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), skb, 0, |
6623 | nl80211_testmode_mcgrp.id, gfp); | ||
6622 | } | 6624 | } |
6623 | EXPORT_SYMBOL(cfg80211_testmode_event); | 6625 | EXPORT_SYMBOL(cfg80211_testmode_event); |
6624 | #endif | 6626 | #endif |
@@ -10064,7 +10066,8 @@ void cfg80211_mgmt_tx_status(struct wireless_dev *wdev, u64 cookie, | |||
10064 | 10066 | ||
10065 | genlmsg_end(msg, hdr); | 10067 | genlmsg_end(msg, hdr); |
10066 | 10068 | ||
10067 | genlmsg_multicast(msg, 0, nl80211_mlme_mcgrp.id, gfp); | 10069 | genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0, |
10070 | nl80211_mlme_mcgrp.id, gfp); | ||
10068 | return; | 10071 | return; |
10069 | 10072 | ||
10070 | nla_put_failure: | 10073 | nla_put_failure: |
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 5a24c986f34b..5a950f36bae4 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
@@ -2279,7 +2279,9 @@ void wiphy_regulatory_deregister(struct wiphy *wiphy) | |||
2279 | static void reg_timeout_work(struct work_struct *work) | 2279 | static void reg_timeout_work(struct work_struct *work) |
2280 | { | 2280 | { |
2281 | REG_DBG_PRINT("Timeout while waiting for CRDA to reply, restoring regulatory settings\n"); | 2281 | REG_DBG_PRINT("Timeout while waiting for CRDA to reply, restoring regulatory settings\n"); |
2282 | rtnl_lock(); | ||
2282 | restore_regulatory_settings(true); | 2283 | restore_regulatory_settings(true); |
2284 | rtnl_unlock(); | ||
2283 | } | 2285 | } |
2284 | 2286 | ||
2285 | int __init regulatory_init(void) | 2287 | int __init regulatory_init(void) |
diff --git a/net/wireless/sme.c b/net/wireless/sme.c index 1d3cfb1a3f28..81c8a10d743c 100644 --- a/net/wireless/sme.c +++ b/net/wireless/sme.c | |||
@@ -34,8 +34,10 @@ struct cfg80211_conn { | |||
34 | CFG80211_CONN_SCAN_AGAIN, | 34 | CFG80211_CONN_SCAN_AGAIN, |
35 | CFG80211_CONN_AUTHENTICATE_NEXT, | 35 | CFG80211_CONN_AUTHENTICATE_NEXT, |
36 | CFG80211_CONN_AUTHENTICATING, | 36 | CFG80211_CONN_AUTHENTICATING, |
37 | CFG80211_CONN_AUTH_FAILED, | ||
37 | CFG80211_CONN_ASSOCIATE_NEXT, | 38 | CFG80211_CONN_ASSOCIATE_NEXT, |
38 | CFG80211_CONN_ASSOCIATING, | 39 | CFG80211_CONN_ASSOCIATING, |
40 | CFG80211_CONN_ASSOC_FAILED, | ||
39 | CFG80211_CONN_DEAUTH, | 41 | CFG80211_CONN_DEAUTH, |
40 | CFG80211_CONN_CONNECTED, | 42 | CFG80211_CONN_CONNECTED, |
41 | } state; | 43 | } state; |
@@ -164,6 +166,8 @@ static int cfg80211_conn_do_work(struct wireless_dev *wdev) | |||
164 | NULL, 0, | 166 | NULL, 0, |
165 | params->key, params->key_len, | 167 | params->key, params->key_len, |
166 | params->key_idx, NULL, 0); | 168 | params->key_idx, NULL, 0); |
169 | case CFG80211_CONN_AUTH_FAILED: | ||
170 | return -ENOTCONN; | ||
167 | case CFG80211_CONN_ASSOCIATE_NEXT: | 171 | case CFG80211_CONN_ASSOCIATE_NEXT: |
168 | BUG_ON(!rdev->ops->assoc); | 172 | BUG_ON(!rdev->ops->assoc); |
169 | wdev->conn->state = CFG80211_CONN_ASSOCIATING; | 173 | wdev->conn->state = CFG80211_CONN_ASSOCIATING; |
@@ -188,10 +192,17 @@ static int cfg80211_conn_do_work(struct wireless_dev *wdev) | |||
188 | WLAN_REASON_DEAUTH_LEAVING, | 192 | WLAN_REASON_DEAUTH_LEAVING, |
189 | false); | 193 | false); |
190 | return err; | 194 | return err; |
195 | case CFG80211_CONN_ASSOC_FAILED: | ||
196 | cfg80211_mlme_deauth(rdev, wdev->netdev, params->bssid, | ||
197 | NULL, 0, | ||
198 | WLAN_REASON_DEAUTH_LEAVING, false); | ||
199 | return -ENOTCONN; | ||
191 | case CFG80211_CONN_DEAUTH: | 200 | case CFG80211_CONN_DEAUTH: |
192 | cfg80211_mlme_deauth(rdev, wdev->netdev, params->bssid, | 201 | cfg80211_mlme_deauth(rdev, wdev->netdev, params->bssid, |
193 | NULL, 0, | 202 | NULL, 0, |
194 | WLAN_REASON_DEAUTH_LEAVING, false); | 203 | WLAN_REASON_DEAUTH_LEAVING, false); |
204 | /* free directly, disconnected event already sent */ | ||
205 | cfg80211_sme_free(wdev); | ||
195 | return 0; | 206 | return 0; |
196 | default: | 207 | default: |
197 | return 0; | 208 | return 0; |
@@ -371,7 +382,7 @@ bool cfg80211_sme_rx_assoc_resp(struct wireless_dev *wdev, u16 status) | |||
371 | return true; | 382 | return true; |
372 | } | 383 | } |
373 | 384 | ||
374 | wdev->conn->state = CFG80211_CONN_DEAUTH; | 385 | wdev->conn->state = CFG80211_CONN_ASSOC_FAILED; |
375 | schedule_work(&rdev->conn_work); | 386 | schedule_work(&rdev->conn_work); |
376 | return false; | 387 | return false; |
377 | } | 388 | } |
@@ -383,7 +394,13 @@ void cfg80211_sme_deauth(struct wireless_dev *wdev) | |||
383 | 394 | ||
384 | void cfg80211_sme_auth_timeout(struct wireless_dev *wdev) | 395 | void cfg80211_sme_auth_timeout(struct wireless_dev *wdev) |
385 | { | 396 | { |
386 | cfg80211_sme_free(wdev); | 397 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); |
398 | |||
399 | if (!wdev->conn) | ||
400 | return; | ||
401 | |||
402 | wdev->conn->state = CFG80211_CONN_AUTH_FAILED; | ||
403 | schedule_work(&rdev->conn_work); | ||
387 | } | 404 | } |
388 | 405 | ||
389 | void cfg80211_sme_disassoc(struct wireless_dev *wdev) | 406 | void cfg80211_sme_disassoc(struct wireless_dev *wdev) |
@@ -399,7 +416,13 @@ void cfg80211_sme_disassoc(struct wireless_dev *wdev) | |||
399 | 416 | ||
400 | void cfg80211_sme_assoc_timeout(struct wireless_dev *wdev) | 417 | void cfg80211_sme_assoc_timeout(struct wireless_dev *wdev) |
401 | { | 418 | { |
402 | cfg80211_sme_disassoc(wdev); | 419 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); |
420 | |||
421 | if (!wdev->conn) | ||
422 | return; | ||
423 | |||
424 | wdev->conn->state = CFG80211_CONN_ASSOC_FAILED; | ||
425 | schedule_work(&rdev->conn_work); | ||
403 | } | 426 | } |
404 | 427 | ||
405 | static int cfg80211_sme_connect(struct wireless_dev *wdev, | 428 | static int cfg80211_sme_connect(struct wireless_dev *wdev, |