├── ch340g ├── Module.symvers ├── built-in.o ├── modules.order ├── ch34x.ko ├── ch34x.o ├── ch34x.mod.o ├── .tmp_versions │ └── ch34x.mod ├── .built-in.o.cmd ├── .ch34x.ko.cmd ├── Makefile ├── readme.txt ├── ch34x.mod.c ├── .ch34x.mod.o.cmd ├── ch34x.c └── .ch34x.o.cmd ├── ch341ser_mac.zip ├── ch341ser_linux.zip ├── ch341ser_windows.zip ├── old340 └── CH341SER_LINUX │ ├── Makefile │ ├── readme.txt │ └── ch34x.c └── README.md /ch340g/Module.symvers: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch340g/built-in.o: -------------------------------------------------------------------------------- 1 | ! 2 | -------------------------------------------------------------------------------- /ch340g/modules.order: -------------------------------------------------------------------------------- 1 | kernel//media/d/A8C0-05DE/arduino/ch340g/ch34x.ko 2 | -------------------------------------------------------------------------------- /ch340g/ch34x.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lizard43/CH340G/HEAD/ch340g/ch34x.ko -------------------------------------------------------------------------------- /ch340g/ch34x.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lizard43/CH340G/HEAD/ch340g/ch34x.o -------------------------------------------------------------------------------- /ch341ser_mac.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lizard43/CH340G/HEAD/ch341ser_mac.zip -------------------------------------------------------------------------------- /ch340g/ch34x.mod.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lizard43/CH340G/HEAD/ch340g/ch34x.mod.o -------------------------------------------------------------------------------- /ch341ser_linux.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lizard43/CH340G/HEAD/ch341ser_linux.zip -------------------------------------------------------------------------------- /ch341ser_windows.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lizard43/CH340G/HEAD/ch341ser_windows.zip -------------------------------------------------------------------------------- /ch340g/.tmp_versions/ch34x.mod: -------------------------------------------------------------------------------- 1 | /media/d/A8C0-05DE/arduino/ch340g/ch34x.ko 2 | /media/d/A8C0-05DE/arduino/ch340g/ch34x.o 3 | -------------------------------------------------------------------------------- /ch340g/.built-in.o.cmd: -------------------------------------------------------------------------------- 1 | cmd_/media/d/A8C0-05DE/arduino/ch340g/built-in.o := rm -f /media/d/A8C0-05DE/arduino/ch340g/built-in.o; ar rcsD /media/d/A8C0-05DE/arduino/ch340g/built-in.o 2 | -------------------------------------------------------------------------------- /ch340g/.ch34x.ko.cmd: -------------------------------------------------------------------------------- 1 | cmd_/media/d/A8C0-05DE/arduino/ch340g/ch34x.ko := ld -r -m elf_x86_64 -T /usr/src/linux-headers-3.11.0-12-generic/scripts/module-common.lds --build-id -o /media/d/A8C0-05DE/arduino/ch340g/ch34x.ko /media/d/A8C0-05DE/arduino/ch340g/ch34x.o /media/d/A8C0-05DE/arduino/ch340g/ch34x.mod.o 2 | -------------------------------------------------------------------------------- /ch340g/Makefile: -------------------------------------------------------------------------------- 1 | ifeq ($(KERNELRELEASE), ) 2 | KERNELDIR := /lib/modules/$(shell uname -r)/build 3 | PWD :=$(shell pwd) 4 | default: 5 | $(MAKE) -C $(KERNELDIR) M=$(PWD) 6 | clean: 7 | rm -rf .tmp_versions Module.symvers *.mod.c *.o *.ko .*.cmd Module.markers modules.order 8 | load: 9 | modprobe usbserial 10 | insmod ch34x.ko 11 | unload: 12 | rmmod ch34x 13 | else 14 | obj-m := ch34x.o 15 | endif 16 | -------------------------------------------------------------------------------- /old340/CH341SER_LINUX/Makefile: -------------------------------------------------------------------------------- 1 | ifeq ($(KERNELRELEASE), ) 2 | KERNELDIR := /lib/modules/$(shell uname -r)/build 3 | PWD :=$(shell pwd) 4 | default: 5 | $(MAKE) -C $(KERNELDIR) M=$(PWD) 6 | clean: 7 | rm -rf .tmp_versions Module.symvers *.mod.c *.o *.ko .*.cmd Module.markers modules.order 8 | load: 9 | modprobe usbserial 10 | insmod ch34x.ko 11 | unload: 12 | rmmod ch34x 13 | else 14 | obj-m := ch34x.o 15 | endif 16 | -------------------------------------------------------------------------------- /ch340g/readme.txt: -------------------------------------------------------------------------------- 1 | // ChangeLog 2 | // 1.0 - 1.1 modified to solve transmition between ch341 and ch341 3 | 4 | Instructions 5 | 6 | Note: 1.Please run followed executable programs as root privilege 7 | 2.Current Driver support versions of linux kernel range from 2.6.25 to 3.9.10 8 | 3.Current Driver support 32bits and 64bits linux systems 9 | 10 | Usage: 11 | (load or unload linux driver of CH34x) 12 | //compile 13 | #make 14 | //load ch34x chips driver 15 | #make load 16 | //unload ch34x chips driver 17 | #make unload 18 | 19 | 20 | -------------------------------------------------------------------------------- /old340/CH341SER_LINUX/readme.txt: -------------------------------------------------------------------------------- 1 | // ChangeLog 2 | // 1.0 - 1.1 modified to solve transmition between ch341 and ch341 3 | 4 | Instructions 5 | 6 | Note: 1.Please run followed executable programs as root privilege 7 | 2.Current Driver support versions of linux kernel range from 2.6.25 to 3.9.10 8 | 3.Current Driver support 32bits and 64bits linux systems 9 | 10 | Usage: 11 | (load or unload linux driver of CH34x) 12 | //compile 13 | #make 14 | //load ch34x chips driver 15 | #make load 16 | //unload ch34x chips driver 17 | #make unload 18 | 19 | 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CH340G 2 | Some Arduino clones use a CH340G USB chip and you'll need to install a driver 3 | 4 | The zip files are from the vendor site. 5 | The Windows seems to work ~ok. 6 | I don't have a Mac, can't vouch for that driver. 7 | The Linux driver as-is only support 3.9 or less kernel versions 8 | 9 | In order to support 3.9+ kernels, the ch34x.c file needed to be edited. This change is in the ch340g folder. 10 | The old, original file for ref is in the old340 folder 11 | 12 | The difference is that between kernel version, they renamed the struct usb_serial_port port number field from 'number' to 'port_number' 13 | 14 | Diff the ch34x.c files to see what I'm talking about. 15 | 16 | To build and install just do: 17 | 18 | make 19 | 20 | make load 21 | -------------------------------------------------------------------------------- /ch340g/ch34x.mod.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | MODULE_INFO(vermagic, VERMAGIC_STRING); 6 | 7 | struct module __this_module 8 | __attribute__((section(".gnu.linkonce.this_module"))) = { 9 | .name = KBUILD_MODNAME, 10 | .init = init_module, 11 | #ifdef CONFIG_MODULE_UNLOAD 12 | .exit = cleanup_module, 13 | #endif 14 | .arch = MODULE_ARCH_INIT, 15 | }; 16 | 17 | static const struct modversion_info ____versions[] 18 | __used 19 | __attribute__((section("__versions"))) = { 20 | { 0x7dc216d9, __VMLINUX_SYMBOL_STR(module_layout) }, 21 | { 0x65b3d, __VMLINUX_SYMBOL_STR(usb_serial_deregister_drivers) }, 22 | { 0xf72d9d03, __VMLINUX_SYMBOL_STR(usb_serial_register_drivers) }, 23 | { 0xe57f8184, __VMLINUX_SYMBOL_STR(usb_serial_port_softint) }, 24 | { 0x69acdf38, __VMLINUX_SYMBOL_STR(memcpy) }, 25 | { 0x37a0cba, __VMLINUX_SYMBOL_STR(kfree) }, 26 | { 0x346c7121, __VMLINUX_SYMBOL_STR(dev_set_drvdata) }, 27 | { 0xf432dd3d, __VMLINUX_SYMBOL_STR(__init_waitqueue_head) }, 28 | { 0xa6327d27, __VMLINUX_SYMBOL_STR(kmem_cache_alloc_trace) }, 29 | { 0xdf08d9a5, __VMLINUX_SYMBOL_STR(kmalloc_caches) }, 30 | { 0xbe2ac387, __VMLINUX_SYMBOL_STR(__dynamic_dev_dbg) }, 31 | { 0x1d1ced3b, __VMLINUX_SYMBOL_STR(tty_flip_buffer_push) }, 32 | { 0xc22a600c, __VMLINUX_SYMBOL_STR(tty_insert_flip_string_flags) }, 33 | { 0x27f3756a, __VMLINUX_SYMBOL_STR(tty_buffer_request_room) }, 34 | { 0xcf21d241, __VMLINUX_SYMBOL_STR(__wake_up) }, 35 | { 0xf0fdf6cb, __VMLINUX_SYMBOL_STR(__stack_chk_fail) }, 36 | { 0x63e35191, __VMLINUX_SYMBOL_STR(dev_err) }, 37 | { 0x3d12fced, __VMLINUX_SYMBOL_STR(usb_submit_urb) }, 38 | { 0xd69cb086, __VMLINUX_SYMBOL_STR(usb_clear_halt) }, 39 | { 0x85004b35, __VMLINUX_SYMBOL_STR(tty_encode_baud_rate) }, 40 | { 0xf2997713, __VMLINUX_SYMBOL_STR(tty_termios_hw_change) }, 41 | { 0x67b27ec1, __VMLINUX_SYMBOL_STR(tty_std_termios) }, 42 | { 0x96104781, __VMLINUX_SYMBOL_STR(usb_kill_urb) }, 43 | { 0x9c55cec, __VMLINUX_SYMBOL_STR(schedule_timeout_interruptible) }, 44 | { 0x409873e3, __VMLINUX_SYMBOL_STR(tty_termios_baud_rate) }, 45 | { 0xb5dcab5b, __VMLINUX_SYMBOL_STR(remove_wait_queue) }, 46 | { 0xd62c833f, __VMLINUX_SYMBOL_STR(schedule_timeout) }, 47 | { 0x5860aad4, __VMLINUX_SYMBOL_STR(add_wait_queue) }, 48 | { 0xffd5a395, __VMLINUX_SYMBOL_STR(default_wake_function) }, 49 | { 0xe8c1d643, __VMLINUX_SYMBOL_STR(usb_control_msg) }, 50 | { 0xd2f1b260, __VMLINUX_SYMBOL_STR(interruptible_sleep_on) }, 51 | { 0x78303ea1, __VMLINUX_SYMBOL_STR(current_task) }, 52 | { 0x8f64aa4, __VMLINUX_SYMBOL_STR(_raw_spin_unlock_irqrestore) }, 53 | { 0x9327f5ce, __VMLINUX_SYMBOL_STR(_raw_spin_lock_irqsave) }, 54 | { 0x44d787a, __VMLINUX_SYMBOL_STR(dev_get_drvdata) }, 55 | { 0xbdfb6dbb, __VMLINUX_SYMBOL_STR(__fentry__) }, 56 | }; 57 | 58 | static const char __module_depends[] 59 | __used 60 | __attribute__((section(".modinfo"))) = 61 | "depends=usbserial"; 62 | 63 | MODULE_ALIAS("usb:v1A86p7523d*dc*dsc*dp*ic*isc*ip*in*"); 64 | MODULE_ALIAS("usb:v1A86p5523d*dc*dsc*dp*ic*isc*ip*in*"); 65 | 66 | MODULE_INFO(srcversion, "D4FEF6202913273ADCE8371"); 67 | -------------------------------------------------------------------------------- /ch340g/.ch34x.mod.o.cmd: -------------------------------------------------------------------------------- 1 | cmd_/media/d/A8C0-05DE/arduino/ch340g/ch34x.mod.o := gcc -Wp,-MD,/media/d/A8C0-05DE/arduino/ch340g/.ch34x.mod.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-linux-gnu/4.8/include -I/usr/src/linux-headers-3.11.0-12-generic/arch/x86/include -Iarch/x86/include/generated -Iinclude -I/usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi -Iarch/x86/include/generated/uapi -I/usr/src/linux-headers-3.11.0-12-generic/include/uapi -Iinclude/generated/uapi -include /usr/src/linux-headers-3.11.0-12-generic/include/linux/kconfig.h -Iubuntu/include -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -O2 -m64 -mno-sse -mpreferred-stack-boundary=3 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -fstack-protector -DCONFIG_X86_X32_ABI -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -Wframe-larger-than=1024 -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -pg -mfentry -DCC_USING_FENTRY -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -DCC_HAVE_ASM_GOTO -D"KBUILD_STR(s)=\#s" -D"KBUILD_BASENAME=KBUILD_STR(ch34x.mod)" -D"KBUILD_MODNAME=KBUILD_STR(ch34x)" -DMODULE -c -o /media/d/A8C0-05DE/arduino/ch340g/ch34x.mod.o /media/d/A8C0-05DE/arduino/ch340g/ch34x.mod.c 2 | 3 | source_/media/d/A8C0-05DE/arduino/ch340g/ch34x.mod.o := /media/d/A8C0-05DE/arduino/ch340g/ch34x.mod.c 4 | 5 | deps_/media/d/A8C0-05DE/arduino/ch340g/ch34x.mod.o := \ 6 | $(wildcard include/config/module/unload.h) \ 7 | include/linux/module.h \ 8 | $(wildcard include/config/sysfs.h) \ 9 | $(wildcard include/config/modules.h) \ 10 | $(wildcard include/config/unused/symbols.h) \ 11 | $(wildcard include/config/module/sig.h) \ 12 | $(wildcard include/config/generic/bug.h) \ 13 | $(wildcard include/config/kallsyms.h) \ 14 | $(wildcard include/config/smp.h) \ 15 | $(wildcard include/config/tracepoints.h) \ 16 | $(wildcard include/config/tracing.h) \ 17 | $(wildcard include/config/event/tracing.h) \ 18 | $(wildcard include/config/ftrace/mcount/record.h) \ 19 | $(wildcard include/config/constructors.h) \ 20 | $(wildcard include/config/debug/set/module/ronx.h) \ 21 | include/linux/list.h \ 22 | $(wildcard include/config/debug/list.h) \ 23 | include/linux/types.h \ 24 | $(wildcard include/config/uid16.h) \ 25 | $(wildcard include/config/lbdaf.h) \ 26 | $(wildcard include/config/arch/dma/addr/t/64bit.h) \ 27 | $(wildcard include/config/phys/addr/t/64bit.h) \ 28 | $(wildcard include/config/64bit.h) \ 29 | include/uapi/linux/types.h \ 30 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/types.h \ 31 | /usr/src/linux-headers-3.11.0-12-generic/include/uapi/asm-generic/types.h \ 32 | include/asm-generic/int-ll64.h \ 33 | include/uapi/asm-generic/int-ll64.h \ 34 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/bitsperlong.h \ 35 | include/asm-generic/bitsperlong.h \ 36 | include/uapi/asm-generic/bitsperlong.h \ 37 | /usr/src/linux-headers-3.11.0-12-generic/include/uapi/linux/posix_types.h \ 38 | include/linux/stddef.h \ 39 | include/uapi/linux/stddef.h \ 40 | include/linux/compiler.h \ 41 | $(wildcard include/config/sparse/rcu/pointer.h) \ 42 | $(wildcard include/config/trace/branch/profiling.h) \ 43 | $(wildcard include/config/profile/all/branches.h) \ 44 | $(wildcard include/config/enable/must/check.h) \ 45 | $(wildcard include/config/enable/warn/deprecated.h) \ 46 | $(wildcard include/config/kprobes.h) \ 47 | include/linux/compiler-gcc.h \ 48 | $(wildcard include/config/arch/supports/optimized/inlining.h) \ 49 | $(wildcard include/config/optimize/inlining.h) \ 50 | include/linux/compiler-gcc4.h \ 51 | $(wildcard include/config/arch/use/builtin/bswap.h) \ 52 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/posix_types.h \ 53 | $(wildcard include/config/x86/32.h) \ 54 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/posix_types_64.h \ 55 | /usr/src/linux-headers-3.11.0-12-generic/include/uapi/asm-generic/posix_types.h \ 56 | include/linux/poison.h \ 57 | $(wildcard include/config/illegal/pointer/value.h) \ 58 | /usr/src/linux-headers-3.11.0-12-generic/include/uapi/linux/const.h \ 59 | include/linux/stat.h \ 60 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/stat.h \ 61 | include/uapi/linux/stat.h \ 62 | include/linux/time.h \ 63 | $(wildcard include/config/arch/uses/gettimeoffset.h) \ 64 | include/linux/cache.h \ 65 | $(wildcard include/config/arch/has/cache/line/size.h) \ 66 | include/linux/kernel.h \ 67 | $(wildcard include/config/preempt/voluntary.h) \ 68 | $(wildcard include/config/debug/atomic/sleep.h) \ 69 | $(wildcard include/config/prove/locking.h) \ 70 | $(wildcard include/config/ring/buffer.h) \ 71 | /usr/lib/gcc/x86_64-linux-gnu/4.8/include/stdarg.h \ 72 | include/linux/linkage.h \ 73 | include/linux/stringify.h \ 74 | include/linux/export.h \ 75 | $(wildcard include/config/have/underscore/symbol/prefix.h) \ 76 | $(wildcard include/config/modversions.h) \ 77 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/linkage.h \ 78 | $(wildcard include/config/x86/64.h) \ 79 | $(wildcard include/config/x86/alignment/16.h) \ 80 | include/linux/bitops.h \ 81 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/bitops.h \ 82 | $(wildcard include/config/x86/cmov.h) \ 83 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/alternative.h \ 84 | $(wildcard include/config/paravirt.h) \ 85 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/asm.h \ 86 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/cpufeature.h \ 87 | $(wildcard include/config/x86/debug/static/cpu/has.h) \ 88 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/required-features.h \ 89 | $(wildcard include/config/x86/minimum/cpu/family.h) \ 90 | $(wildcard include/config/math/emulation.h) \ 91 | $(wildcard include/config/x86/pae.h) \ 92 | $(wildcard include/config/x86/cmpxchg64.h) \ 93 | $(wildcard include/config/x86/use/3dnow.h) \ 94 | $(wildcard include/config/x86/p6/nop.h) \ 95 | $(wildcard include/config/matom.h) \ 96 | include/asm-generic/bitops/find.h \ 97 | $(wildcard include/config/generic/find/first/bit.h) \ 98 | include/asm-generic/bitops/sched.h \ 99 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/arch_hweight.h \ 100 | include/asm-generic/bitops/const_hweight.h \ 101 | include/asm-generic/bitops/le.h \ 102 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/byteorder.h \ 103 | include/linux/byteorder/little_endian.h \ 104 | include/uapi/linux/byteorder/little_endian.h \ 105 | include/linux/swab.h \ 106 | include/uapi/linux/swab.h \ 107 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/swab.h \ 108 | include/linux/byteorder/generic.h \ 109 | include/asm-generic/bitops/ext2-atomic-setbit.h \ 110 | include/linux/log2.h \ 111 | $(wildcard include/config/arch/has/ilog2/u32.h) \ 112 | $(wildcard include/config/arch/has/ilog2/u64.h) \ 113 | include/linux/typecheck.h \ 114 | include/linux/printk.h \ 115 | $(wildcard include/config/early/printk.h) \ 116 | $(wildcard include/config/printk.h) \ 117 | $(wildcard include/config/dynamic/debug.h) \ 118 | include/linux/init.h \ 119 | $(wildcard include/config/broken/rodata.h) \ 120 | include/linux/kern_levels.h \ 121 | include/linux/dynamic_debug.h \ 122 | include/uapi/linux/kernel.h \ 123 | /usr/src/linux-headers-3.11.0-12-generic/include/uapi/linux/sysinfo.h \ 124 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/cache.h \ 125 | $(wildcard include/config/x86/l1/cache/shift.h) \ 126 | $(wildcard include/config/x86/internode/cache/shift.h) \ 127 | $(wildcard include/config/x86/vsmp.h) \ 128 | include/linux/seqlock.h \ 129 | include/linux/spinlock.h \ 130 | $(wildcard include/config/debug/spinlock.h) \ 131 | $(wildcard include/config/generic/lockbreak.h) \ 132 | $(wildcard include/config/preempt.h) \ 133 | $(wildcard include/config/debug/lock/alloc.h) \ 134 | include/linux/preempt.h \ 135 | $(wildcard include/config/debug/preempt.h) \ 136 | $(wildcard include/config/preempt/tracer.h) \ 137 | $(wildcard include/config/context/tracking.h) \ 138 | $(wildcard include/config/preempt/count.h) \ 139 | $(wildcard include/config/preempt/notifiers.h) \ 140 | include/linux/thread_info.h \ 141 | $(wildcard include/config/compat.h) \ 142 | $(wildcard include/config/debug/stack/usage.h) \ 143 | include/linux/bug.h \ 144 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/bug.h \ 145 | $(wildcard include/config/bug.h) \ 146 | $(wildcard include/config/debug/bugverbose.h) \ 147 | include/asm-generic/bug.h \ 148 | $(wildcard include/config/generic/bug/relative/pointers.h) \ 149 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/thread_info.h \ 150 | $(wildcard include/config/ia32/emulation.h) \ 151 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/page.h \ 152 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/page_types.h \ 153 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/page_64_types.h \ 154 | $(wildcard include/config/physical/start.h) \ 155 | $(wildcard include/config/physical/align.h) \ 156 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/page_64.h \ 157 | $(wildcard include/config/debug/virtual.h) \ 158 | $(wildcard include/config/flatmem.h) \ 159 | include/linux/range.h \ 160 | include/asm-generic/memory_model.h \ 161 | $(wildcard include/config/discontigmem.h) \ 162 | $(wildcard include/config/sparsemem/vmemmap.h) \ 163 | $(wildcard include/config/sparsemem.h) \ 164 | include/asm-generic/getorder.h \ 165 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/processor.h \ 166 | $(wildcard include/config/cc/stackprotector.h) \ 167 | $(wildcard include/config/m486.h) \ 168 | $(wildcard include/config/x86/debugctlmsr.h) \ 169 | $(wildcard include/config/xen.h) \ 170 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/processor-flags.h \ 171 | $(wildcard include/config/vm86.h) \ 172 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/processor-flags.h \ 173 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/vm86.h \ 174 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/ptrace.h \ 175 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/segment.h \ 176 | $(wildcard include/config/x86/32/lazy/gs.h) \ 177 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/ptrace.h \ 178 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/ptrace-abi.h \ 179 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/paravirt_types.h \ 180 | $(wildcard include/config/x86/local/apic.h) \ 181 | $(wildcard include/config/paravirt/debug.h) \ 182 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/desc_defs.h \ 183 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/kmap_types.h \ 184 | $(wildcard include/config/debug/highmem.h) \ 185 | include/asm-generic/kmap_types.h \ 186 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/pgtable_types.h \ 187 | $(wildcard include/config/kmemcheck.h) \ 188 | $(wildcard include/config/mem/soft/dirty.h) \ 189 | $(wildcard include/config/compat/vdso.h) \ 190 | $(wildcard include/config/proc/fs.h) \ 191 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/pgtable_64_types.h \ 192 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/sparsemem.h \ 193 | include/asm-generic/ptrace.h \ 194 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/vm86.h \ 195 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/math_emu.h \ 196 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/sigcontext.h \ 197 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/sigcontext.h \ 198 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/current.h \ 199 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/percpu.h \ 200 | $(wildcard include/config/x86/64/smp.h) \ 201 | include/asm-generic/percpu.h \ 202 | $(wildcard include/config/have/setup/per/cpu/area.h) \ 203 | include/linux/threads.h \ 204 | $(wildcard include/config/nr/cpus.h) \ 205 | $(wildcard include/config/base/small.h) \ 206 | include/linux/percpu-defs.h \ 207 | $(wildcard include/config/debug/force/weak/per/cpu.h) \ 208 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/msr.h \ 209 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/msr.h \ 210 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/msr-index.h \ 211 | /usr/src/linux-headers-3.11.0-12-generic/include/uapi/linux/ioctl.h \ 212 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/ioctl.h \ 213 | include/asm-generic/ioctl.h \ 214 | include/uapi/asm-generic/ioctl.h \ 215 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/errno.h \ 216 | /usr/src/linux-headers-3.11.0-12-generic/include/uapi/asm-generic/errno.h \ 217 | /usr/src/linux-headers-3.11.0-12-generic/include/uapi/asm-generic/errno-base.h \ 218 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/cpumask.h \ 219 | include/linux/cpumask.h \ 220 | $(wildcard include/config/cpumask/offstack.h) \ 221 | $(wildcard include/config/hotplug/cpu.h) \ 222 | $(wildcard include/config/debug/per/cpu/maps.h) \ 223 | $(wildcard include/config/disable/obsolete/cpumask/functions.h) \ 224 | include/linux/bitmap.h \ 225 | include/linux/string.h \ 226 | $(wildcard include/config/binary/printf.h) \ 227 | include/uapi/linux/string.h \ 228 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/string.h \ 229 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/string_64.h \ 230 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/paravirt.h \ 231 | $(wildcard include/config/paravirt/spinlocks.h) \ 232 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/nops.h \ 233 | $(wildcard include/config/mk7.h) \ 234 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/special_insns.h \ 235 | include/linux/personality.h \ 236 | include/uapi/linux/personality.h \ 237 | include/linux/math64.h \ 238 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/div64.h \ 239 | include/asm-generic/div64.h \ 240 | include/linux/err.h \ 241 | include/linux/irqflags.h \ 242 | $(wildcard include/config/trace/irqflags.h) \ 243 | $(wildcard include/config/irqsoff/tracer.h) \ 244 | $(wildcard include/config/trace/irqflags/support.h) \ 245 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/irqflags.h \ 246 | include/linux/atomic.h \ 247 | $(wildcard include/config/arch/has/atomic/or.h) \ 248 | $(wildcard include/config/generic/atomic64.h) \ 249 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/atomic.h \ 250 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/cmpxchg.h \ 251 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/cmpxchg_64.h \ 252 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/atomic64_64.h \ 253 | include/asm-generic/atomic-long.h \ 254 | include/linux/bottom_half.h \ 255 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/barrier.h \ 256 | $(wildcard include/config/x86/ppro/fence.h) \ 257 | $(wildcard include/config/x86/oostore.h) \ 258 | include/linux/spinlock_types.h \ 259 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/spinlock_types.h \ 260 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/rwlock.h \ 261 | include/linux/lockdep.h \ 262 | $(wildcard include/config/lockdep.h) \ 263 | $(wildcard include/config/lock/stat.h) \ 264 | $(wildcard include/config/prove/rcu.h) \ 265 | include/linux/rwlock_types.h \ 266 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/spinlock.h \ 267 | include/linux/rwlock.h \ 268 | include/linux/spinlock_api_smp.h \ 269 | $(wildcard include/config/inline/spin/lock.h) \ 270 | $(wildcard include/config/inline/spin/lock/bh.h) \ 271 | $(wildcard include/config/inline/spin/lock/irq.h) \ 272 | $(wildcard include/config/inline/spin/lock/irqsave.h) \ 273 | $(wildcard include/config/inline/spin/trylock.h) \ 274 | $(wildcard include/config/inline/spin/trylock/bh.h) \ 275 | $(wildcard include/config/uninline/spin/unlock.h) \ 276 | $(wildcard include/config/inline/spin/unlock/bh.h) \ 277 | $(wildcard include/config/inline/spin/unlock/irq.h) \ 278 | $(wildcard include/config/inline/spin/unlock/irqrestore.h) \ 279 | include/linux/rwlock_api_smp.h \ 280 | $(wildcard include/config/inline/read/lock.h) \ 281 | $(wildcard include/config/inline/write/lock.h) \ 282 | $(wildcard include/config/inline/read/lock/bh.h) \ 283 | $(wildcard include/config/inline/write/lock/bh.h) \ 284 | $(wildcard include/config/inline/read/lock/irq.h) \ 285 | $(wildcard include/config/inline/write/lock/irq.h) \ 286 | $(wildcard include/config/inline/read/lock/irqsave.h) \ 287 | $(wildcard include/config/inline/write/lock/irqsave.h) \ 288 | $(wildcard include/config/inline/read/trylock.h) \ 289 | $(wildcard include/config/inline/write/trylock.h) \ 290 | $(wildcard include/config/inline/read/unlock.h) \ 291 | $(wildcard include/config/inline/write/unlock.h) \ 292 | $(wildcard include/config/inline/read/unlock/bh.h) \ 293 | $(wildcard include/config/inline/write/unlock/bh.h) \ 294 | $(wildcard include/config/inline/read/unlock/irq.h) \ 295 | $(wildcard include/config/inline/write/unlock/irq.h) \ 296 | $(wildcard include/config/inline/read/unlock/irqrestore.h) \ 297 | $(wildcard include/config/inline/write/unlock/irqrestore.h) \ 298 | include/uapi/linux/time.h \ 299 | include/linux/uidgid.h \ 300 | $(wildcard include/config/uidgid/strict/type/checks.h) \ 301 | $(wildcard include/config/user/ns.h) \ 302 | include/linux/highuid.h \ 303 | include/linux/kmod.h \ 304 | include/linux/gfp.h \ 305 | $(wildcard include/config/numa.h) \ 306 | $(wildcard include/config/highmem.h) \ 307 | $(wildcard include/config/zone/dma.h) \ 308 | $(wildcard include/config/zone/dma32.h) \ 309 | $(wildcard include/config/pm/sleep.h) \ 310 | $(wildcard include/config/cma.h) \ 311 | include/linux/mmzone.h \ 312 | $(wildcard include/config/force/max/zoneorder.h) \ 313 | $(wildcard include/config/memory/isolation.h) \ 314 | $(wildcard include/config/memcg.h) \ 315 | $(wildcard include/config/compaction.h) \ 316 | $(wildcard include/config/memory/hotplug.h) \ 317 | $(wildcard include/config/have/memblock/node/map.h) \ 318 | $(wildcard include/config/flat/node/mem/map.h) \ 319 | $(wildcard include/config/no/bootmem.h) \ 320 | $(wildcard include/config/numa/balancing.h) \ 321 | $(wildcard include/config/have/memory/present.h) \ 322 | $(wildcard include/config/have/memoryless/nodes.h) \ 323 | $(wildcard include/config/need/node/memmap/size.h) \ 324 | $(wildcard include/config/need/multiple/nodes.h) \ 325 | $(wildcard include/config/have/arch/early/pfn/to/nid.h) \ 326 | $(wildcard include/config/sparsemem/extreme.h) \ 327 | $(wildcard include/config/have/arch/pfn/valid.h) \ 328 | $(wildcard include/config/nodes/span/other/nodes.h) \ 329 | $(wildcard include/config/holes/in/zone.h) \ 330 | $(wildcard include/config/arch/has/holes/memorymodel.h) \ 331 | include/linux/wait.h \ 332 | include/uapi/linux/wait.h \ 333 | include/linux/numa.h \ 334 | $(wildcard include/config/nodes/shift.h) \ 335 | include/linux/nodemask.h \ 336 | $(wildcard include/config/movable/node.h) \ 337 | include/linux/pageblock-flags.h \ 338 | $(wildcard include/config/hugetlb/page.h) \ 339 | $(wildcard include/config/hugetlb/page/size/variable.h) \ 340 | include/linux/page-flags-layout.h \ 341 | include/generated/bounds.h \ 342 | include/linux/memory_hotplug.h \ 343 | $(wildcard include/config/memory/hotremove.h) \ 344 | $(wildcard include/config/have/arch/nodedata/extension.h) \ 345 | $(wildcard include/config/have/bootmem/info/node.h) \ 346 | include/linux/notifier.h \ 347 | include/linux/errno.h \ 348 | include/uapi/linux/errno.h \ 349 | include/linux/mutex.h \ 350 | $(wildcard include/config/debug/mutexes.h) \ 351 | $(wildcard include/config/mutex/spin/on/owner.h) \ 352 | $(wildcard include/config/have/arch/mutex/cpu/relax.h) \ 353 | include/linux/rwsem.h \ 354 | $(wildcard include/config/rwsem/generic/spinlock.h) \ 355 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/rwsem.h \ 356 | include/linux/srcu.h \ 357 | include/linux/rcupdate.h \ 358 | $(wildcard include/config/rcu/torture/test.h) \ 359 | $(wildcard include/config/tree/rcu.h) \ 360 | $(wildcard include/config/tree/preempt/rcu.h) \ 361 | $(wildcard include/config/rcu/trace.h) \ 362 | $(wildcard include/config/preempt/rcu.h) \ 363 | $(wildcard include/config/rcu/user/qs.h) \ 364 | $(wildcard include/config/tiny/rcu.h) \ 365 | $(wildcard include/config/debug/objects/rcu/head.h) \ 366 | $(wildcard include/config/rcu/nocb/cpu.h) \ 367 | include/linux/completion.h \ 368 | include/linux/debugobjects.h \ 369 | $(wildcard include/config/debug/objects.h) \ 370 | $(wildcard include/config/debug/objects/free.h) \ 371 | include/linux/rcutree.h \ 372 | include/linux/workqueue.h \ 373 | $(wildcard include/config/debug/objects/work.h) \ 374 | $(wildcard include/config/freezer.h) \ 375 | include/linux/timer.h \ 376 | $(wildcard include/config/timer/stats.h) \ 377 | $(wildcard include/config/debug/objects/timers.h) \ 378 | include/linux/ktime.h \ 379 | $(wildcard include/config/ktime/scalar.h) \ 380 | include/linux/jiffies.h \ 381 | include/linux/timex.h \ 382 | include/uapi/linux/timex.h \ 383 | /usr/src/linux-headers-3.11.0-12-generic/include/uapi/linux/param.h \ 384 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/param.h \ 385 | include/asm-generic/param.h \ 386 | $(wildcard include/config/hz.h) \ 387 | include/uapi/asm-generic/param.h \ 388 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/timex.h \ 389 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/tsc.h \ 390 | $(wildcard include/config/x86/tsc.h) \ 391 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/mmzone.h \ 392 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/mmzone_64.h \ 393 | include/linux/mmdebug.h \ 394 | $(wildcard include/config/debug/vm.h) \ 395 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/smp.h \ 396 | $(wildcard include/config/x86/io/apic.h) \ 397 | $(wildcard include/config/x86/32/smp.h) \ 398 | $(wildcard include/config/debug/nmi/selftest.h) \ 399 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/mpspec.h \ 400 | $(wildcard include/config/x86/numaq.h) \ 401 | $(wildcard include/config/eisa.h) \ 402 | $(wildcard include/config/x86/mpparse.h) \ 403 | $(wildcard include/config/acpi.h) \ 404 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/mpspec_def.h \ 405 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/x86_init.h \ 406 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/bootparam.h \ 407 | include/linux/screen_info.h \ 408 | include/uapi/linux/screen_info.h \ 409 | include/linux/apm_bios.h \ 410 | include/uapi/linux/apm_bios.h \ 411 | include/linux/edd.h \ 412 | include/uapi/linux/edd.h \ 413 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/e820.h \ 414 | $(wildcard include/config/efi.h) \ 415 | $(wildcard include/config/hibernation.h) \ 416 | $(wildcard include/config/memtest.h) \ 417 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/e820.h \ 418 | $(wildcard include/config/intel/txt.h) \ 419 | include/linux/ioport.h \ 420 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/ist.h \ 421 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/ist.h \ 422 | include/video/edid.h \ 423 | $(wildcard include/config/x86.h) \ 424 | include/uapi/video/edid.h \ 425 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/apicdef.h \ 426 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/apic.h \ 427 | $(wildcard include/config/x86/x2apic.h) \ 428 | include/linux/pm.h \ 429 | $(wildcard include/config/vt/console/sleep.h) \ 430 | $(wildcard include/config/pm.h) \ 431 | $(wildcard include/config/pm/runtime.h) \ 432 | $(wildcard include/config/pm/clk.h) \ 433 | $(wildcard include/config/pm/generic/domains.h) \ 434 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/fixmap.h \ 435 | $(wildcard include/config/paravirt/clock.h) \ 436 | $(wildcard include/config/provide/ohci1394/dma/init.h) \ 437 | $(wildcard include/config/x86/visws/apic.h) \ 438 | $(wildcard include/config/pci/mmconfig.h) \ 439 | $(wildcard include/config/x86/intel/mid.h) \ 440 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/acpi.h \ 441 | $(wildcard include/config/acpi/numa.h) \ 442 | include/acpi/pdc_intel.h \ 443 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/numa.h \ 444 | $(wildcard include/config/numa/emu.h) \ 445 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/topology.h \ 446 | $(wildcard include/config/x86/ht.h) \ 447 | include/asm-generic/topology.h \ 448 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/mmu.h \ 449 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/realmode.h \ 450 | $(wildcard include/config/acpi/sleep.h) \ 451 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/io.h \ 452 | $(wildcard include/config/mtrr.h) \ 453 | include/asm-generic/iomap.h \ 454 | $(wildcard include/config/has/ioport.h) \ 455 | $(wildcard include/config/pci.h) \ 456 | $(wildcard include/config/generic/iomap.h) \ 457 | include/asm-generic/pci_iomap.h \ 458 | $(wildcard include/config/no/generic/pci/ioport/map.h) \ 459 | $(wildcard include/config/generic/pci/iomap.h) \ 460 | include/linux/vmalloc.h \ 461 | $(wildcard include/config/mmu.h) \ 462 | include/linux/rbtree.h \ 463 | include/xen/xen.h \ 464 | $(wildcard include/config/xen/dom0.h) \ 465 | include/xen/interface/xen.h \ 466 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/xen/interface.h \ 467 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/xen/interface_64.h \ 468 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/pvclock-abi.h \ 469 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/xen/hypervisor.h \ 470 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/pvclock.h \ 471 | include/linux/clocksource.h \ 472 | $(wildcard include/config/arch/clocksource/data.h) \ 473 | $(wildcard include/config/clocksource/watchdog.h) \ 474 | $(wildcard include/config/clksrc/of.h) \ 475 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/clocksource.h \ 476 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/vsyscall.h \ 477 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/vsyscall.h \ 478 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/vvar.h \ 479 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/idle.h \ 480 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/io_apic.h \ 481 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/irq_vectors.h \ 482 | $(wildcard include/config/have/kvm.h) \ 483 | include/linux/topology.h \ 484 | $(wildcard include/config/sched/smt.h) \ 485 | $(wildcard include/config/sched/mc.h) \ 486 | $(wildcard include/config/sched/book.h) \ 487 | $(wildcard include/config/use/percpu/numa/node/id.h) \ 488 | include/linux/smp.h \ 489 | $(wildcard include/config/use/generic/smp/helpers.h) \ 490 | include/linux/percpu.h \ 491 | $(wildcard include/config/need/per/cpu/embed/first/chunk.h) \ 492 | $(wildcard include/config/need/per/cpu/page/first/chunk.h) \ 493 | include/linux/pfn.h \ 494 | include/linux/sysctl.h \ 495 | $(wildcard include/config/sysctl.h) \ 496 | include/uapi/linux/sysctl.h \ 497 | include/linux/elf.h \ 498 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/elf.h \ 499 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/user.h \ 500 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/user_64.h \ 501 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/auxvec.h \ 502 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/vdso.h \ 503 | include/uapi/linux/elf.h \ 504 | /usr/src/linux-headers-3.11.0-12-generic/include/uapi/linux/elf-em.h \ 505 | include/linux/kobject.h \ 506 | include/linux/sysfs.h \ 507 | include/linux/kobject_ns.h \ 508 | include/linux/kref.h \ 509 | include/linux/moduleparam.h \ 510 | $(wildcard include/config/alpha.h) \ 511 | $(wildcard include/config/ia64.h) \ 512 | $(wildcard include/config/ppc64.h) \ 513 | include/linux/tracepoint.h \ 514 | include/linux/static_key.h \ 515 | include/linux/jump_label.h \ 516 | $(wildcard include/config/jump/label.h) \ 517 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/jump_label.h \ 518 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/module.h \ 519 | $(wildcard include/config/m586.h) \ 520 | $(wildcard include/config/m586tsc.h) \ 521 | $(wildcard include/config/m586mmx.h) \ 522 | $(wildcard include/config/mcore2.h) \ 523 | $(wildcard include/config/m686.h) \ 524 | $(wildcard include/config/mpentiumii.h) \ 525 | $(wildcard include/config/mpentiumiii.h) \ 526 | $(wildcard include/config/mpentiumm.h) \ 527 | $(wildcard include/config/mpentium4.h) \ 528 | $(wildcard include/config/mk6.h) \ 529 | $(wildcard include/config/mk8.h) \ 530 | $(wildcard include/config/melan.h) \ 531 | $(wildcard include/config/mcrusoe.h) \ 532 | $(wildcard include/config/mefficeon.h) \ 533 | $(wildcard include/config/mwinchipc6.h) \ 534 | $(wildcard include/config/mwinchip3d.h) \ 535 | $(wildcard include/config/mcyrixiii.h) \ 536 | $(wildcard include/config/mviac3/2.h) \ 537 | $(wildcard include/config/mviac7.h) \ 538 | $(wildcard include/config/mgeodegx1.h) \ 539 | $(wildcard include/config/mgeode/lx.h) \ 540 | include/asm-generic/module.h \ 541 | $(wildcard include/config/have/mod/arch/specific.h) \ 542 | $(wildcard include/config/modules/use/elf/rel.h) \ 543 | $(wildcard include/config/modules/use/elf/rela.h) \ 544 | include/linux/vermagic.h \ 545 | include/generated/utsrelease.h \ 546 | 547 | /media/d/A8C0-05DE/arduino/ch340g/ch34x.mod.o: $(deps_/media/d/A8C0-05DE/arduino/ch340g/ch34x.mod.o) 548 | 549 | $(deps_/media/d/A8C0-05DE/arduino/ch340g/ch34x.mod.o): 550 | -------------------------------------------------------------------------------- /old340/CH341SER_LINUX/ch34x.c: -------------------------------------------------------------------------------- 1 | // 2013.7 2 | //******************************************** 3 | //** Copyright (C) WCH 2002-2013 ****** 4 | //** Web: http://www.winchiphead.com ****** 5 | //******************************************** 6 | //** Driver for USB to serial adaptor CH34X** 7 | //** GCC ** 8 | //******************************************** 9 | 10 | // Support linux kernel version 2.6.25 and later 11 | // 12 | 13 | #include 14 | #ifndef KERNEL_VERSION 15 | #define KERNEL_VERSION(ver, rel, seq) ((ver << 16) | (rel << 8) | (seq)) 16 | #endif 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | //#include 31 | #include 32 | #include 33 | 34 | #define DRIVER_DESC "WCH CH34x USB to serial adaptor driver" 35 | #define DRIVER_AUTHOR "" 36 | 37 | #define CH34x_VENDOR_ID 0x1A86 38 | #define CH340_PRODUCT_ID 0x7523 39 | #define CH341_PRODUCT_ID 0x5523 40 | 41 | #define CH34x_CLOSING_WAIT (30 * HZ) 42 | 43 | #define CH34x_BUF_SIZE 1024 44 | #define CH34x_TMP_BUF_SIZE 1024 45 | 46 | //Vendor define 47 | #define VENDOR_WRITE_TYPE 0x40 48 | #define VENDOR_READ_TYPE 0xC0 49 | 50 | #define VENDOR_READ 0x95 51 | #define VENDOR_WRITE 0x9A 52 | #define VENDOR_SERIAL_INIT 0xA1 53 | #define VENDOR_MODEM_OUT 0xA4 54 | #define VENDOR_VERSION 0x5F 55 | 56 | //For CMD 0xA4 57 | #define UART_CTS 0x01 58 | #define UART_DSR 0x02 59 | #define UART_RING 0x04 60 | #define UART_DCD 0x08 61 | #define CONTROL_OUT 0x10 62 | #define CONTROL_DTR 0x20 63 | #define CONTROL_RTS 0x40 64 | 65 | //Uart state 66 | #define UART_STATE 0x00 67 | #define UART_OVERRUN_ERROR 0x01 68 | #define UART_BREAK_ERROR //no define 69 | #define UART_PARITY_ERROR 0x02 70 | #define UART_FRAME_ERROR 0x06 71 | #define UART_RECV_ERROR 0x02 72 | #define UART_STATE_TRANSIENT_MASK 0x07 73 | 74 | //Port state 75 | #define PORTA_STATE 0x01 76 | #define PORTB_STATE 0x02 77 | #define PORTC_STATE 0x03 78 | 79 | //CH34x Baud Rate 80 | #define CH34x_BAUDRATE_FACTOR 1532620800 81 | #define CH34x_BAUDRATE_DIVMAX 3 82 | 83 | #define DEBUG_CH34x 84 | #undef DEBUG_CH34x 85 | 86 | #ifdef DEBUG_CH34x 87 | #define dbg_ch34x( format, arg... ) \ 88 | printk( KERN_DEBUG "%d: " format "\n", __LINE__, ##arg ) 89 | #else 90 | #define dbg_ch34x( format, arg... ) \ 91 | do{ \ 92 | if(0) \ 93 | printk(KERN_DEBUG "%d: " format "\n", __LINE__, ##arg); \ 94 | } while (0) 95 | #endif 96 | 97 | #ifdef DEBUG_CH34x 98 | #define err_ch34x( format, arg... ) \ 99 | printk(KERN_ERR KBUILD_MODNAME ": " format "\n", ##arg) 100 | #else 101 | #define err_ch34x( format, arg... ) \ 102 | do{ \ 103 | if(0) \ 104 | printk( KERN_ERR KBUILD_MODNAME ": " format "\n", ##arg)\ 105 | }while(0) 106 | #endif 107 | 108 | // For debug 109 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,1)) 110 | static int debug = 1; 111 | #endif 112 | 113 | struct ch34x_buf { 114 | unsigned int buf_size; 115 | char *buf_buf; 116 | char *buf_get; 117 | char *buf_put; 118 | }; 119 | 120 | struct ch34x_private { 121 | spinlock_t lock; //access lock 122 | struct ch34x_buf *buf; 123 | int write_urb_in_use; 124 | unsigned baud_rate; 125 | wait_queue_head_t delta_msr_wait; 126 | u8 line_control; 127 | u8 line_status; 128 | u8 termios_initialized; 129 | }; 130 | 131 | static struct usb_device_id id_table [] = { 132 | { USB_DEVICE(CH34x_VENDOR_ID, CH340_PRODUCT_ID) }, 133 | { USB_DEVICE(CH34x_VENDOR_ID, CH341_PRODUCT_ID) }, 134 | { } //End 135 | }; 136 | MODULE_DEVICE_TABLE( usb, id_table ); 137 | 138 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,2)) 139 | static struct usb_driver ch34x_driver = { 140 | .name = "ch34x", 141 | .probe = usb_serial_probe, 142 | .disconnect = usb_serial_disconnect, 143 | .id_table = id_table, 144 | .suspend = usb_serial_suspend, 145 | .resume = usb_serial_resume, 146 | .no_dynamic_id = 1, 147 | .supports_autosuspend = 1, 148 | }; 149 | #endif 150 | 151 | // ch34x_buf_alloc 152 | // Allocate a circular buffer and all associated memory 153 | static struct ch34x_buf *ch34x_buf_alloc( unsigned int size ) 154 | { 155 | struct ch34x_buf *pb; 156 | 157 | if( size == 0 ) 158 | return NULL; 159 | 160 | pb = kmalloc( sizeof(struct ch34x_buf), GFP_KERNEL ); 161 | if( pb == NULL ) 162 | return NULL; 163 | 164 | pb->buf_buf = kmalloc( size, GFP_KERNEL ); 165 | if( pb->buf_buf == NULL ) { 166 | kfree(pb); 167 | return NULL; 168 | } 169 | 170 | pb->buf_size = size; 171 | pb->buf_get = pb->buf_put = pb->buf_buf; 172 | 173 | return pb; 174 | } 175 | 176 | // ch34x_buf_free 177 | // Free the buffer and all associated memory 178 | static void ch34x_buf_free( struct ch34x_buf *pb ) 179 | { 180 | if( pb ) { 181 | kfree( pb->buf_buf ); 182 | kfree( pb ); 183 | } 184 | } 185 | 186 | // ch34x_buf_clear 187 | // Clear out all data in the circular buffer 188 | static void ch34x_buf_clear( struct ch34x_buf *pb ) 189 | { 190 | if( pb != NULL ) 191 | pb->buf_get = pb->buf_put; 192 | // equivalent to a get of all data available 193 | } 194 | 195 | // ch34x_buf_data_avail 196 | // Return the number of bytes of data available in he circular buffer 197 | static unsigned int ch34x_buf_data_avail( struct ch34x_buf *pb ) 198 | { 199 | if( pb == NULL ) 200 | return 0; 201 | 202 | return ((pb->buf_size + pb->buf_put - pb->buf_get) % pb->buf_size ); 203 | } 204 | 205 | // ch34x_buf_space_avail 206 | // Return the number of bytes of space available in the circular 207 | static unsigned int ch34x_buf_space_avail( struct ch34x_buf *pb ) 208 | { 209 | if( pb == NULL ) 210 | return 0; 211 | 212 | return ((pb->buf_size + pb->buf_get - pb->buf_put - 1) % pb->buf_size ); 213 | } 214 | 215 | // ch34x_buf_put 216 | // Copy data from a user buffer and put it into the circular buffer. 217 | // Restrict to the amount of space available 218 | // Return the number of bytes copied 219 | static unsigned int ch34x_buf_put( struct ch34x_buf *pb, 220 | const char *buf, unsigned int count ) 221 | { 222 | unsigned int len; 223 | 224 | if( pb == NULL ) 225 | return 0; 226 | 227 | len = ch34x_buf_space_avail(pb); 228 | if( count > len ) 229 | count = len; 230 | else if( count == 0 ) 231 | return 0; 232 | 233 | len = pb->buf_buf + pb->buf_size - pb->buf_put; 234 | if( count > len ) { 235 | memcpy( pb->buf_put, buf, len ); 236 | memcpy( pb->buf_buf, buf+len, count - len ); 237 | pb->buf_put = pb->buf_buf + count - len; 238 | } 239 | else { 240 | memcpy( pb->buf_put, buf, count ); 241 | if( count < len ) 242 | pb->buf_put += count; 243 | else if( count == len ) 244 | pb->buf_put = pb->buf_buf; 245 | } 246 | 247 | return count; 248 | } 249 | 250 | static unsigned int ch34x_buf_get( struct ch34x_buf *pb, 251 | char *buf, unsigned int count ) 252 | { 253 | unsigned int len; 254 | 255 | if( pb == NULL ) 256 | return 0; 257 | 258 | len = ch34x_buf_data_avail(pb); 259 | if( count > len ) 260 | count = len; 261 | else if( count == 0 ) 262 | return 0; 263 | 264 | len = pb->buf_buf + pb->buf_size - pb->buf_get; 265 | if( count > len ) { 266 | memcpy( buf, pb->buf_get, len ); 267 | memcpy( buf+len, pb->buf_buf, count - len ); 268 | pb->buf_get = pb->buf_buf + count - len; 269 | } 270 | else { 271 | memcpy( buf, pb->buf_get, count ); 272 | if( count < len ) 273 | pb->buf_get += count; 274 | else if( count == len ) 275 | pb->buf_get = pb->buf_buf; 276 | } 277 | 278 | return count; 279 | } 280 | 281 | static int ch34x_vendor_read( __u8 request, 282 | __u16 value, 283 | __u16 index, 284 | struct usb_serial *serial, 285 | unsigned char *buf, 286 | __u16 len ) 287 | { 288 | int retval; 289 | 290 | retval = usb_control_msg( serial->dev, usb_rcvctrlpipe(serial->dev, 0), 291 | request, VENDOR_READ_TYPE, value, index, buf, len, 1000 ); 292 | dbg_ch34x("0x%x:0x%x:0x%x:0x%x %d - %d", 293 | VENDOR_READ_TYPE, request, value, index, retval, len ); 294 | 295 | return retval; 296 | } 297 | 298 | static int ch34x_vendor_write( __u8 request, 299 | __u16 value, 300 | __u16 index, 301 | struct usb_serial *serial, 302 | unsigned char *buf, 303 | __u16 len ) 304 | { 305 | int retval; 306 | 307 | retval = usb_control_msg( serial->dev, 308 | usb_sndctrlpipe(serial->dev, 0), 309 | request, 310 | VENDOR_WRITE_TYPE, 311 | value, index, buf, len, 1000 ); 312 | 313 | return retval; 314 | } 315 | 316 | static int set_control_lines( struct usb_serial *serial, 317 | u8 value ) 318 | { 319 | int retval; 320 | 321 | retval = ch34x_vendor_write( VENDOR_MODEM_OUT, (unsigned short)value, 322 | 0x0000, serial, NULL, 0x00 ); 323 | dbg_ch34x("%s - value=%d, retval=%d", __func__, value, retval ); 324 | 325 | return retval; 326 | } 327 | 328 | static int ch34x_get_baud_rate( unsigned int baud_rate, 329 | unsigned char *a, unsigned char *b ) 330 | { 331 | unsigned long factor = 0; 332 | short divisor = 0; 333 | 334 | if( !baud_rate ) 335 | return -EINVAL; 336 | 337 | factor = (CH34x_BAUDRATE_FACTOR / baud_rate); 338 | divisor = CH34x_BAUDRATE_DIVMAX; 339 | 340 | while( (factor > 0xfff0) && divisor ) { 341 | factor >>= 3; 342 | divisor --; 343 | } 344 | 345 | if( factor > 0xfff0 ) 346 | return -EINVAL; 347 | 348 | factor = 0x10000 - factor; 349 | *a = (factor & 0xff00) >> 8; 350 | *b = divisor; 351 | 352 | return 0; 353 | } 354 | 355 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) 356 | static void ch34x_set_termios( struct tty_struct *tty, 357 | struct usb_serial_port *port, struct ktermios *old_termios ) 358 | { 359 | #else 360 | static void ch34x_set_termios( struct usb_serial_port *port, 361 | struct ktermios *old_termios ) 362 | { 363 | struct tty_struct *tty = port->tty; 364 | #endif 365 | struct usb_serial *serial = port->serial; 366 | struct ch34x_private *priv = usb_get_serial_port_data(port); 367 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,1)) //sure 368 | struct ktermios *termios = &tty->termios; 369 | #else 370 | struct ktermios *termios = tty->termios; 371 | #endif 372 | unsigned int baud_rate; 373 | unsigned int cflag; 374 | unsigned long flags; 375 | u8 control; 376 | 377 | unsigned char divisor = 0; 378 | unsigned char reg_count = 0; 379 | unsigned char factor = 0; 380 | unsigned char reg_value = 0; 381 | unsigned short value = 0; 382 | unsigned short index = 0; 383 | 384 | dbg_ch34x("%s - port:%d", __func__, port->number); 385 | 386 | spin_lock_irqsave( &priv->lock, flags ); 387 | if( !priv->termios_initialized ) { 388 | *(termios) = tty_std_termios; 389 | termios->c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL; 390 | termios->c_ispeed = 9600; 391 | termios->c_ospeed = 9600; 392 | priv->termios_initialized = 1; 393 | } 394 | spin_unlock_irqrestore( &priv->lock, flags ); 395 | 396 | /* 397 | * The ch34x is reported to lose bytes if you change serial setting 398 | * even to the same vaules as before. Thus we actually need to filter 399 | * in this specific case. 400 | */ 401 | if( !tty_termios_hw_change(termios, old_termios) ) 402 | return; 403 | 404 | cflag = termios->c_cflag; 405 | dbg_ch34x("%s (%d) cflag=0x%x\n", __func__, port->number, cflag ); 406 | 407 | // Get the byte size 408 | switch( cflag & CSIZE ) 409 | { 410 | case CS5: 411 | reg_value |= 0x00; 412 | break; 413 | case CS6: 414 | reg_value |= 0x01; 415 | break; 416 | case CS7: 417 | reg_value |= 0x02; 418 | break; 419 | case CS8: 420 | reg_value |= 0x03; 421 | break; 422 | default: 423 | reg_value |= 0x03; 424 | break; 425 | } 426 | dbg_ch34x("%s - data bits = %d", __func__, reg_value + 0x05 ); 427 | 428 | // Figure out the stop bits 429 | if( cflag & CSTOPB ) { 430 | reg_value |= 0x04; 431 | dbg_ch34x("%s - stop bits = 2", __func__); 432 | } 433 | else 434 | dbg_ch34x("%s - stop bits = 1", __func__); 435 | 436 | // Determine the parity 437 | if( cflag & PARENB ) 438 | if( cflag & PARODD ) { 439 | reg_value |= (0x08 | 0x00); 440 | dbg_ch34x("%s - parity = odd", __func__); 441 | } 442 | else { 443 | reg_value |= (0x08 | 0x10); 444 | dbg_ch34x("%s - parity = even", __func__); 445 | } 446 | else 447 | dbg_ch34x("%s - parity = none", __func__); 448 | 449 | // Determine the baud rate 450 | baud_rate = tty_get_baud_rate( tty ); 451 | dbg_ch34x("%s = baud_rate = %d", __func__, baud_rate); 452 | ch34x_get_baud_rate( baud_rate, &factor, &divisor ); 453 | dbg_ch34x("----->>>> baud_rate = %d, factor:0x%x, divisor:0x%x", 454 | baud_rate, factor, divisor ); 455 | 456 | //enable SFR_UART RX and TX 457 | reg_value |= 0xc0; 458 | //enable SFR_UART Control register and timer 459 | reg_count |= 0x9c; 460 | 461 | value |= reg_count; 462 | value |= (unsigned short)reg_value << 8; 463 | index |= 0x80 | divisor; 464 | index |= (unsigned short)factor << 8; 465 | ch34x_vendor_write( VENDOR_SERIAL_INIT, value, index, serial, NULL, 0 ); 466 | 467 | // change control lines if we are switching to or from B0 468 | spin_lock_irqsave( &priv->lock, flags ); 469 | control = priv->line_control; 470 | if( (cflag & CBAUD) == B0 ) 471 | priv->line_control &= ~(CONTROL_DTR | CONTROL_RTS); 472 | else 473 | priv->line_control |= (CONTROL_DTR | CONTROL_RTS); 474 | 475 | if( control != priv->line_control ) { 476 | control = priv->line_control; 477 | spin_unlock_irqrestore( &priv->lock, flags ); 478 | set_control_lines( serial, control ); 479 | } 480 | else 481 | spin_unlock_irqrestore( &priv->lock, flags ); 482 | 483 | if( cflag & CRTSCTS ) 484 | ch34x_vendor_write( VENDOR_WRITE, 0x2727, 0x0101, serial, NULL, 0); 485 | 486 | // FIXME: Need to read back resulting baud rate 487 | if( baud_rate ) 488 | tty_encode_baud_rate(tty, baud_rate, baud_rate); 489 | 490 | } 491 | 492 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,3)) 493 | static int ch34x_tiocmget( struct tty_struct *tty ) 494 | { 495 | struct usb_serial_port *port = tty->driver_data; 496 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) 497 | static int ch34x_tiocmget( struct tty_struct *tty, 498 | struct file *filp ) 499 | { 500 | struct usb_serial_port *port = tty->driver_data; 501 | #else 502 | static int ch34x_tiocmget( struct usb_serial_port *port, 503 | struct file *filp ) 504 | { 505 | #endif 506 | struct ch34x_private *priv = usb_get_serial_port_data(port); 507 | unsigned long flags; 508 | unsigned int mcr; 509 | /*unsigned int msr;*/ 510 | unsigned int retval; 511 | 512 | dbg_ch34x("%s - port:%d", __func__, port->number); 513 | 514 | if( !usb_get_intfdata( port->serial->interface) ) 515 | return -ENODEV; 516 | 517 | spin_lock_irqsave( &priv->lock, flags ); 518 | mcr = priv->line_control; 519 | spin_unlock_irqrestore( &priv->lock, flags ); 520 | 521 | retval = ((mcr & CONTROL_DTR) ? TIOCM_DTR : 0) | 522 | ((mcr & CONTROL_RTS) ? TIOCM_RTS : 0) | 523 | ((mcr & UART_CTS) ? TIOCM_CTS : 0) | 524 | ((mcr & UART_DSR) ? TIOCM_DSR : 0) | 525 | ((mcr & UART_RING) ? TIOCM_RI : 0) | 526 | ((mcr & UART_DCD) ? TIOCM_CD : 0); 527 | 528 | dbg_ch34x("%s - retval=0x%x", __func__, retval); 529 | 530 | return retval; 531 | } 532 | 533 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32) && \ 534 | LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) ) 535 | static void ch34x_close( struct tty_struct *tty, 536 | struct usb_serial_port *port, struct file *filp ) 537 | { 538 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32) ) 539 | static void ch34x_close( struct usb_serial_port *port ) 540 | { 541 | struct tty_struct *tty = port->port.tty; 542 | #elif (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)) 543 | static void ch34x_close( struct usb_serial_port *port, 544 | struct file *filp ) 545 | { 546 | struct tty_struct *tty = port->tty; 547 | #endif 548 | struct ch34x_private *priv = usb_get_serial_port_data(port); 549 | unsigned long flags; 550 | unsigned int c_cflag; 551 | int bps; 552 | long timeout; 553 | wait_queue_t wait; 554 | 555 | dbg_ch34x("%s - port:%d", __func__, port->number); 556 | 557 | // wait for data do drain from the buffer 558 | spin_lock_irqsave( &priv->lock, flags ); 559 | timeout = CH34x_CLOSING_WAIT; 560 | init_waitqueue_entry( &wait, current ); 561 | add_wait_queue( &tty->write_wait, &wait ); 562 | for(;;) { 563 | set_current_state( TASK_INTERRUPTIBLE ); 564 | if( ch34x_buf_data_avail(priv->buf) == 0 || timeout == 0 || 565 | signal_pending(current) || port->serial->disconnected ) 566 | break; 567 | spin_unlock_irqrestore( &priv->lock, flags ); 568 | timeout = schedule_timeout( timeout ); 569 | spin_lock_irqsave( &priv->lock, flags ); 570 | } 571 | set_current_state( TASK_RUNNING ); 572 | remove_wait_queue( &tty->write_wait, &wait ); 573 | // clear out any remaining data in the buffer 574 | ch34x_buf_clear( priv->buf ); 575 | spin_unlock_irqrestore( &priv->lock, flags ); 576 | 577 | bps = tty_get_baud_rate( tty ); 578 | if( bps > 1200 ) 579 | timeout = max( (HZ * 2560) / bps, HZ / 10 ); 580 | else 581 | timeout = 2 * HZ; 582 | schedule_timeout_interruptible(timeout); 583 | 584 | // shutdown our urbs 585 | usb_kill_urb(port->interrupt_in_urb); 586 | usb_kill_urb(port->read_urb); 587 | usb_kill_urb(port->write_urb); 588 | /*usb_serial_generic_close(port, filp);*/ 589 | 590 | if( tty ) { 591 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,1)) //sure 592 | c_cflag = tty->termios.c_cflag; 593 | #else 594 | c_cflag = tty->termios->c_cflag; 595 | #endif 596 | if( c_cflag & HUPCL ) { 597 | // drop DTR and RTS 598 | spin_lock_irqsave( &priv->lock, flags ); 599 | priv->line_control = 0; 600 | spin_unlock_irqrestore( &priv->lock, flags ); 601 | set_control_lines( port->serial, 0 ); 602 | } 603 | } 604 | } 605 | 606 | // kernel version 607 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32) \ 608 | && LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) 609 | static int ch34x_open( struct tty_struct *tty, 610 | struct usb_serial_port *port, struct file *filp ) 611 | { 612 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)) 613 | static int ch34x_open( struct tty_struct *tty, 614 | struct usb_serial_port *port ) 615 | { 616 | #elif (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)) 617 | static int ch34x_open( struct usb_serial_port *port, 618 | struct file *filp ) 619 | { 620 | struct tty_struct *tty = port->tty; 621 | #endif 622 | struct ktermios tmp_termios; 623 | struct usb_serial *serial = port->serial; 624 | int retval; 625 | 626 | dbg_ch34x("%s - port:%d", __func__, port->number ); 627 | 628 | usb_clear_halt( serial->dev, port->write_urb->pipe ); 629 | usb_clear_halt( serial->dev, port->read_urb->pipe ); 630 | 631 | if( tty ) { 632 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) 633 | ch34x_set_termios( tty, port, &tmp_termios ); 634 | #else 635 | ch34x_set_termios( port, &tmp_termios ); 636 | #endif 637 | } 638 | 639 | dbg_ch34x("%s - submit read urb", __func__); 640 | port->read_urb->dev = serial->dev; 641 | retval = usb_submit_urb( port->read_urb, GFP_KERNEL ); 642 | if(retval) { 643 | dev_err( &port->dev, "%s - failed submit read urb,error %d\n", 644 | __func__, retval ); 645 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32) && \ 646 | LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) ) 647 | ch34x_close(tty, port, NULL); 648 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)) 649 | ch34x_close(port); 650 | #elif (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)) 651 | ch34x_close(port, filp); 652 | #endif 653 | goto err_out; 654 | } 655 | 656 | dbg_ch34x("%s - submit interrupt urb", __func__ ); 657 | port->interrupt_in_urb->dev = serial->dev; 658 | retval = usb_submit_urb( port->interrupt_in_urb, GFP_KERNEL ); 659 | if(retval) { 660 | dev_err( &port->dev, "%s - failed submit interrupt urb,error %d\n", 661 | __func__, retval ); 662 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32) && \ 663 | LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) ) 664 | ch34x_close(tty, port, NULL); 665 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)) 666 | ch34x_close(port); 667 | #elif (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)) 668 | ch34x_close(port, filp); 669 | #endif 670 | goto err_out; 671 | } 672 | 673 | err_out: 674 | return retval; 675 | } 676 | 677 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,3)) 678 | static int ch34x_tiocmset( struct tty_struct *tty, 679 | unsigned int set, unsigned int clear ) 680 | { 681 | struct usb_serial_port *port = tty->driver_data; 682 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) 683 | static int ch34x_tiocmset( struct tty_struct *tty, 684 | struct file *filp, unsigned int set, unsigned int clear ) 685 | { 686 | struct usb_serial_port *port = tty->driver_data; 687 | #else 688 | static int ch34x_tiocmset( struct usb_serial_port *port, 689 | struct file *filp, unsigned int set, unsigned int clear ) 690 | { 691 | #endif 692 | struct ch34x_private *priv = usb_get_serial_port_data(port); 693 | unsigned long flags; 694 | /*unsigned int mcr = priv->line_control;*/ 695 | u8 control; 696 | 697 | dbg_ch34x("%s - port:%d", __func__, port->number); 698 | 699 | if( !usb_get_intfdata(port->serial->interface) ) 700 | return -ENODEV; 701 | 702 | spin_lock_irqsave( &priv->lock, flags ); 703 | if( set & TIOCM_RTS ) 704 | priv->line_control |= CONTROL_RTS; 705 | if( set & TIOCM_DTR ) 706 | priv->line_control |= CONTROL_DTR; 707 | if( clear & TIOCM_RTS ) 708 | priv->line_control &= ~CONTROL_RTS; 709 | if( clear & TIOCM_DTR ) 710 | priv->line_control &= ~CONTROL_DTR; 711 | control = priv->line_control; 712 | spin_unlock_irqrestore( &priv->lock, flags ); 713 | 714 | return set_control_lines( port->serial, control ); 715 | } 716 | 717 | static int wait_modem_info( struct usb_serial_port *port, 718 | unsigned int arg ) 719 | { 720 | struct ch34x_private *priv = usb_get_serial_port_data(port); 721 | unsigned long flags; 722 | unsigned int prevstatus; 723 | unsigned int status; 724 | unsigned int changed; 725 | 726 | dbg_ch34x("%s -port:%d", __func__, port->number); 727 | 728 | spin_lock_irqsave( &priv->lock, flags ); 729 | prevstatus = priv->line_status; 730 | spin_unlock_irqrestore( &priv->lock, flags ); 731 | 732 | while(1) { 733 | interruptible_sleep_on( &priv->delta_msr_wait ); 734 | // see if a signal did it 735 | if( signal_pending(current) ) 736 | return -ERESTARTSYS; 737 | 738 | spin_lock_irqsave( &priv->lock, flags ); 739 | status = priv->line_status; 740 | spin_unlock_irqrestore( &priv->lock, flags ); 741 | 742 | changed = prevstatus ^ status; 743 | 744 | if( ((arg & TIOCM_RNG) && (changed & UART_RING)) || 745 | ((arg & TIOCM_DSR) && (changed & UART_DSR)) || 746 | ((arg & TIOCM_CD) && (changed & UART_DCD)) || 747 | ((arg & TIOCM_CTS) && (changed & UART_CTS)) ) 748 | return 0; 749 | 750 | prevstatus = status; 751 | } 752 | 753 | // Not reatched 754 | return 0; 755 | } 756 | 757 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,3)) 758 | static int ch34x_ioctl( struct tty_struct *tty, 759 | unsigned int cmd, unsigned long arg ) 760 | { 761 | struct usb_serial_port *port = tty->driver_data; 762 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) 763 | static int ch34x_ioctl( struct tty_struct *tty, 764 | struct file *filp, unsigned int cmd, unsigned long arg ) 765 | { 766 | struct usb_serial_port *port = tty->driver_data; 767 | #else 768 | static int ch34x_ioctl( struct usb_serial_port *port, 769 | struct file *filp, unsigned int cmd, unsigned long arg ) 770 | { 771 | //struct usb_serial_port *port = tty->driver_data; 772 | #endif 773 | dbg_ch34x("%s - port:%d, cmd=0x%04x", __func__, port->number, cmd); 774 | 775 | switch(cmd) 776 | { 777 | // Note here 778 | case TIOCMIWAIT: 779 | dbg_ch34x("%s - port:%d TIOCMIWAIT", __func__, port->number); 780 | return wait_modem_info(port, arg); 781 | default: 782 | dbg_ch34x("%s not supported=0x%04x", __func__, cmd); 783 | break; 784 | } 785 | 786 | return -ENOIOCTLCMD; 787 | } 788 | 789 | static void ch34x_send( struct usb_serial_port *port ) 790 | { 791 | int count; 792 | int retval; 793 | struct ch34x_private *priv = usb_get_serial_port_data( port ); 794 | unsigned long flags; 795 | 796 | dbg_ch34x("%s - port:%d", __func__, port->number ); 797 | 798 | spin_lock_irqsave( &priv->lock, flags ); 799 | if( priv->write_urb_in_use ) { 800 | spin_unlock_irqrestore( &priv->lock, flags ); 801 | return; 802 | } 803 | 804 | count = ch34x_buf_get( priv->buf, port->write_urb->transfer_buffer, 805 | port->bulk_out_size ); 806 | if( count == 0 ) { 807 | spin_unlock_irqrestore( &priv->lock, flags ); 808 | return; 809 | } 810 | 811 | priv->write_urb_in_use = 1; 812 | spin_unlock_irqrestore( &priv->lock, flags ); 813 | 814 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,1)) 815 | usb_serial_debug_data( &port->dev, __func__, count, 816 | port->write_urb->transfer_buffer ); 817 | #else 818 | usb_serial_debug_data( debug, &port->dev, __func__, count, 819 | port->write_urb->transfer_buffer ); 820 | #endif 821 | 822 | port->write_urb->transfer_buffer_length = count; 823 | port->write_urb->dev = port->serial->dev; 824 | retval = usb_submit_urb( port->write_urb, GFP_ATOMIC ); 825 | if( retval ) { 826 | dev_err( &port->dev, "%s - failed submitting write urb,error %d\n" 827 | , __func__, retval ); 828 | priv->write_urb_in_use = 0; 829 | // reschedule ch34x_send 830 | } 831 | 832 | usb_serial_port_softint( port ); 833 | } 834 | 835 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) 836 | static int ch34x_write( struct tty_struct *tty, 837 | struct usb_serial_port *port, const unsigned char *buf, int count ) 838 | #else 839 | static int ch34x_write( struct usb_serial_port *port, 840 | const unsigned char *buf, int count ) 841 | #endif 842 | { 843 | struct ch34x_private *priv = usb_get_serial_port_data(port); 844 | unsigned long flags; 845 | 846 | dbg_ch34x("%s - port:%d, %d bytes", __func__, port->number, count); 847 | 848 | if( !count ) 849 | return count; 850 | 851 | spin_lock_irqsave( &priv->lock, flags ); 852 | count = ch34x_buf_put( priv->buf, buf, count ); 853 | spin_unlock_irqrestore( &priv->lock, flags ); 854 | 855 | ch34x_send(port); 856 | 857 | return count; 858 | } 859 | 860 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) 861 | static int ch34x_write_room( struct tty_struct *tty ) 862 | { 863 | struct usb_serial_port *port = tty->driver_data; 864 | #else 865 | static int ch34x_write_room( struct usb_serial_port *port ) 866 | { 867 | #endif 868 | struct ch34x_private *priv = usb_get_serial_port_data( port ); 869 | int room = 0; 870 | unsigned long flags; 871 | 872 | dbg_ch34x("%s - port:%d", __func__, port->number ); 873 | 874 | spin_lock_irqsave( &priv->lock, flags ); 875 | room = ch34x_buf_space_avail( priv->buf ); 876 | spin_unlock_irqrestore( &priv->lock, flags ); 877 | 878 | dbg_ch34x("%s - room:%d", __func__, room ); 879 | return room; 880 | } 881 | 882 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) 883 | static int ch34x_chars_in_buffer( struct tty_struct *tty ) 884 | { 885 | struct usb_serial_port *port = tty->driver_data; 886 | #else 887 | static int ch34x_chars_in_buffer( struct usb_serial_port *port ) 888 | { 889 | #endif 890 | struct ch34x_private *priv = usb_get_serial_port_data(port); 891 | int chars = 0; 892 | unsigned long flags; 893 | 894 | dbg_ch34x("%s - port:%d", __func__, port->number ); 895 | 896 | spin_lock_irqsave( &priv->lock, flags ); 897 | chars = ch34x_buf_data_avail( priv->buf ); 898 | spin_unlock_irqrestore( &priv->lock, flags ); 899 | 900 | dbg_ch34x("%s - chars:%d", __func__, chars ); 901 | 902 | return chars; 903 | } 904 | 905 | static int ch34x_attach( struct usb_serial *serial ) 906 | { 907 | struct ch34x_private *priv; 908 | int i; 909 | char buf[8]; 910 | 911 | dbg_ch34x("%s", __func__); 912 | 913 | for( i = 0; i < serial->num_ports; ++i ) { 914 | priv = kzalloc( sizeof(struct ch34x_private), GFP_KERNEL ); 915 | if( !priv ) 916 | goto cleanup; 917 | spin_lock_init( &priv->lock ); 918 | priv->buf = ch34x_buf_alloc( CH34x_BUF_SIZE ); 919 | if( priv->buf == NULL ) { 920 | kfree( priv ); 921 | goto cleanup; 922 | } 923 | init_waitqueue_head( &priv->delta_msr_wait ); 924 | usb_set_serial_port_data( serial->port[i], priv ); 925 | } 926 | 927 | ch34x_vendor_read( VENDOR_VERSION, 0x0000, 0x0000, 928 | serial, buf, 0x02 ); 929 | ch34x_vendor_write( VENDOR_SERIAL_INIT, 0x0000, 0x0000, 930 | serial, NULL, 0x00 ); 931 | ch34x_vendor_write( VENDOR_WRITE, 0x1312, 0xD982, 932 | serial, NULL, 0x00 ); 933 | ch34x_vendor_write( VENDOR_WRITE, 0x0F2C, 0x0004, 934 | serial, NULL, 0x00 ); 935 | ch34x_vendor_read( VENDOR_READ, 0x2518, 0x0000, 936 | serial, buf, 0x02 ); 937 | ch34x_vendor_write( VENDOR_WRITE, 0x2727, 0x0000, 938 | serial, NULL, 0x00 ); 939 | ch34x_vendor_write( VENDOR_MODEM_OUT, 0x009F, 0x0000, 940 | serial, NULL, 0x00 ); 941 | 942 | return 0; 943 | 944 | cleanup: 945 | for( --i; i >= 0; --i ) { 946 | priv = usb_get_serial_port_data( serial->port[i] ); 947 | ch34x_buf_free( priv->buf ); 948 | kfree( priv ); 949 | usb_set_serial_port_data( serial->port[i], NULL ); 950 | } 951 | 952 | return -ENOMEM; 953 | } 954 | 955 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)) 956 | static void ch34x_shutdown( struct usb_serial *serial ) 957 | { 958 | struct ch34x_private *priv; 959 | int i; 960 | 961 | dbg_ch34x("%s", __func__); 962 | 963 | for( i = 0; i < serial->num_ports; ++i ) { 964 | priv = usb_get_serial_port_data( serial->port[i] ); 965 | if( priv ) { 966 | ch34x_buf_free( priv->buf ); 967 | kfree( priv ); 968 | usb_set_serial_port_data( serial->port[i], NULL ); 969 | } 970 | } 971 | } 972 | #endif 973 | 974 | static void ch34x_update_line_status( struct usb_serial_port *port, 975 | unsigned char *data, unsigned int actual_length ) 976 | { 977 | struct ch34x_private *priv = usb_get_serial_port_data( port ); 978 | unsigned long flags; 979 | u8 length = UART_STATE + 0x04; 980 | 981 | if( actual_length < length ) 982 | return; 983 | 984 | // Save off the uart status for others to look at 985 | spin_lock_irqsave( &priv->lock, flags ); 986 | priv->line_status = data[UART_STATE]; 987 | priv->line_control = data[PORTB_STATE]; 988 | spin_unlock_irqrestore( &priv->lock, flags ); 989 | wake_up_interruptible( &priv->delta_msr_wait ); 990 | } 991 | 992 | static void ch34x_read_int_callback( struct urb *urb ) 993 | { 994 | struct usb_serial_port *port = (struct usb_serial_port *)urb->context; 995 | unsigned char *data = urb->transfer_buffer; 996 | unsigned int actual_length = urb->actual_length; 997 | int status = urb->status; 998 | int retval; 999 | 1000 | dbg_ch34x("%s port:%d", __func__, port->number ); 1001 | 1002 | switch( status ) { 1003 | case 0: //success 1004 | break; 1005 | case -ECONNRESET: 1006 | case -ENOENT: 1007 | case -ESHUTDOWN: //this urb is terminated, clean up 1008 | dbg_ch34x("%s - urb shutting down with status:%d", __func__, status ); 1009 | return; 1010 | default: 1011 | dbg_ch34x("%s - nonzero urb status received:%d", __func__, status ); 1012 | goto exit; 1013 | } 1014 | 1015 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,1)) 1016 | usb_serial_debug_data( &port->dev, __func__, 1017 | urb->actual_length, urb->transfer_buffer ); 1018 | #else 1019 | usb_serial_debug_data( debug, &port->dev, 1020 | __func__, urb->actual_length, urb->transfer_buffer ); 1021 | #endif 1022 | 1023 | ch34x_update_line_status( port, data, actual_length ); 1024 | 1025 | exit: 1026 | retval = usb_submit_urb( urb, GFP_ATOMIC ); 1027 | if( retval ) 1028 | dev_err( &urb->dev->dev, "%s - usb_submit_urb failed with result %d\n", 1029 | __func__, retval ); 1030 | } 1031 | 1032 | static void ch34x_read_bulk_callback( struct urb *urb ) 1033 | { 1034 | struct usb_serial_port *port = (struct usb_serial_port *)urb->context; 1035 | struct ch34x_private *priv = usb_get_serial_port_data( port ); 1036 | struct tty_struct *tty; 1037 | unsigned char *data = urb->transfer_buffer; 1038 | unsigned long flags; 1039 | int i; 1040 | int retval; 1041 | int status = urb->status; 1042 | u8 line_status; 1043 | char tty_flag; 1044 | 1045 | dbg_ch34x("%s - port:%d", __func__, port->number ); 1046 | if( status ) { 1047 | dbg_ch34x("%s - urb status=%d", __func__, status ); 1048 | if( status == -EPROTO ) { 1049 | // CH34x mysteriously fails with -EPROTO reschedule the read 1050 | dbg_ch34x("%s - caught -EPROTO, resubmitting the urb", __func__); 1051 | urb->dev = port->serial->dev; 1052 | retval = usb_submit_urb( urb, GFP_ATOMIC ); 1053 | if( retval ) { 1054 | dev_err( &urb->dev->dev, 1055 | "%s - failed resubmitting read urb, error %d\n", 1056 | __func__, retval ); 1057 | return; 1058 | } 1059 | } 1060 | 1061 | dbg_ch34x("%s - unable to handle the error, exiting.", __func__); 1062 | return; 1063 | } 1064 | 1065 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,1)) 1066 | usb_serial_debug_data( &port->dev, __func__, 1067 | urb->actual_length, data ); 1068 | #else 1069 | usb_serial_debug_data( debug, &port->dev, 1070 | __func__, urb->actual_length, data ); 1071 | #endif 1072 | 1073 | // get tty_flag from status 1074 | tty_flag = TTY_NORMAL; 1075 | 1076 | spin_lock_irqsave( &priv->lock, flags ); 1077 | line_status = priv->line_status; 1078 | priv->line_status &= ~UART_STATE_TRANSIENT_MASK; 1079 | spin_unlock_irqrestore( &priv->lock, flags ); 1080 | wake_up_interruptible( &priv->delta_msr_wait ); 1081 | 1082 | // break takes precedence over parity, 1083 | // which takes precedence over framing errors 1084 | if( line_status & UART_PARITY_ERROR ) 1085 | tty_flag = TTY_PARITY; 1086 | else if( line_status & UART_OVERRUN_ERROR ) 1087 | tty_flag = TTY_OVERRUN; 1088 | else if( line_status & UART_FRAME_ERROR ) 1089 | tty_flag = TTY_FRAME; 1090 | dbg_ch34x("%s - tty_flag=%d", __func__, tty_flag); 1091 | 1092 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) 1093 | tty = port->port.tty; 1094 | #else 1095 | tty = port->tty; 1096 | #endif 1097 | if( tty && urb->actual_length ) { 1098 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,1)) 1099 | tty_buffer_request_room( tty->port, urb->actual_length + 1); 1100 | #else 1101 | tty_buffer_request_room( tty, urb->actual_length + 1 ); 1102 | #endif 1103 | // overrun is special, not associated with a char 1104 | if( line_status & UART_OVERRUN_ERROR ) 1105 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,1)) 1106 | tty_insert_flip_char( tty->port, 0, TTY_OVERRUN ); 1107 | #else 1108 | tty_insert_flip_char( tty, 0, TTY_OVERRUN ); 1109 | #endif 1110 | for( i = 0; i < urb->actual_length; ++i ) 1111 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,1)) 1112 | tty_insert_flip_char( tty->port, data[i], tty_flag ); 1113 | #else 1114 | tty_insert_flip_char( tty, data[i], tty_flag ); 1115 | #endif 1116 | 1117 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,1)) 1118 | tty_flip_buffer_push( tty->port ); 1119 | #else 1120 | tty_flip_buffer_push( tty ); 1121 | #endif 1122 | } 1123 | 1124 | //Schedule the next read _if_ we are still open 1125 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)) 1126 | if( port->open_count ) 1127 | #endif 1128 | { 1129 | urb->dev = port->serial->dev; 1130 | retval = usb_submit_urb( urb, GFP_ATOMIC ); 1131 | if( retval ) 1132 | dev_err( &urb->dev->dev, 1133 | "%s - fialed resubmitting read urb, error %d\n", 1134 | __func__, retval ); 1135 | } 1136 | 1137 | return; 1138 | } 1139 | 1140 | static void ch34x_write_bulk_callback( struct urb *urb ) 1141 | { 1142 | struct usb_serial_port *port = (struct usb_serial_port *)urb->context; 1143 | struct ch34x_private *priv = usb_get_serial_port_data(port); 1144 | int retval; 1145 | int status = urb->status; 1146 | 1147 | dbg_ch34x("%s - port:%d", __func__, port->number ); 1148 | 1149 | switch( status ) { 1150 | case 0: //success 1151 | break; 1152 | case -ECONNRESET: 1153 | case -ENOENT: 1154 | case -ESHUTDOWN: 1155 | // this urb is terminated, clean up 1156 | dbg_ch34x("%s - urb shutting down with status:%d", __func__, status); 1157 | priv->write_urb_in_use = 0; 1158 | return; 1159 | default: 1160 | // error in the urb, so we have to resubmit it 1161 | dbg_ch34x("%s - Overflow in write", __func__); 1162 | dbg_ch34x("%s - nonzero write bulk status received:%d", __func__, status); 1163 | port->write_urb->transfer_buffer_length = 1; 1164 | port->write_urb->dev = port->serial->dev; 1165 | retval = usb_submit_urb(port->write_urb, GFP_ATOMIC); 1166 | if( retval ) 1167 | dev_err( &urb->dev->dev, 1168 | "%s - failed resubmitting write urv, error:%d\n", 1169 | __func__, retval ); 1170 | else 1171 | return; 1172 | } 1173 | 1174 | priv->write_urb_in_use = 0; 1175 | 1176 | // send any buffered data 1177 | ch34x_send(port); 1178 | } 1179 | 1180 | static struct usb_serial_driver ch34x_device = { 1181 | .driver = { 1182 | .owner = THIS_MODULE, 1183 | .name = "ch34x", 1184 | }, 1185 | .id_table = id_table, 1186 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,1)) 1187 | .usb_driver = &ch34x_driver, 1188 | #endif 1189 | .num_ports = 1, 1190 | .open = ch34x_open, 1191 | .close = ch34x_close, 1192 | .write = ch34x_write, 1193 | .ioctl = ch34x_ioctl, 1194 | .set_termios = ch34x_set_termios, 1195 | .tiocmget = ch34x_tiocmget, 1196 | .tiocmset = ch34x_tiocmset, 1197 | .read_bulk_callback = ch34x_read_bulk_callback, 1198 | .read_int_callback = ch34x_read_int_callback, 1199 | .write_bulk_callback = ch34x_write_bulk_callback, 1200 | .write_room = ch34x_write_room, 1201 | .chars_in_buffer = ch34x_chars_in_buffer, 1202 | .attach = ch34x_attach, 1203 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32) ) 1204 | .shutdown = ch34x_shutdown, 1205 | #endif 1206 | }; 1207 | 1208 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,5)) 1209 | static struct usb_serial_driver *const serial_driver [] = { 1210 | &ch34x_device, NULL 1211 | }; 1212 | #endif 1213 | 1214 | 1215 | static int __init ch34x_init(void) 1216 | { 1217 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,5)) 1218 | int retval = 0; 1219 | 1220 | retval = usb_serial_register( &ch34x_device ); 1221 | if( retval ) { 1222 | goto err_usb_serial_register; 1223 | } 1224 | retval = usb_register( &ch34x_driver ); 1225 | if( retval ) { 1226 | goto err_usb_register; 1227 | } 1228 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)) 1229 | info( DRIVER_DESC ); 1230 | #endif 1231 | return 0; 1232 | 1233 | err_usb_register: 1234 | usb_deregister( &ch34x_driver ); 1235 | err_usb_serial_register: 1236 | usb_serial_deregister( &ch34x_device ); 1237 | return retval; 1238 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,1)) 1239 | return usb_serial_register_drivers( serial_driver, 1240 | KBUILD_MODNAME, id_table ); 1241 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,5) && \ 1242 | LINUX_VERSION_CODE < KERNEL_VERSION(3,5,1)) 1243 | return usb_serial_register_drivers(&ch34x_driver, serial_driver); 1244 | #endif 1245 | } 1246 | 1247 | static void __exit ch34x_exit(void) 1248 | { 1249 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,5)) 1250 | usb_deregister( &ch34x_driver ); 1251 | usb_serial_deregister( &ch34x_device ); 1252 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,1)) 1253 | usb_serial_deregister_drivers( serial_driver ); 1254 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,5) && \ 1255 | LINUX_VERSION_CODE < KERNEL_VERSION(3,5,1)) 1256 | usb_serial_deregister_drivers(&ch34x_driver, serial_driver); 1257 | #endif 1258 | } 1259 | 1260 | module_init( ch34x_init ); 1261 | module_exit( ch34x_exit ); 1262 | 1263 | 1264 | MODULE_DESCRIPTION(DRIVER_DESC); 1265 | MODULE_AUTHOR(DRIVER_AUTHOR); 1266 | MODULE_LICENSE("GPL"); 1267 | -------------------------------------------------------------------------------- /ch340g/ch34x.c: -------------------------------------------------------------------------------- 1 | // 2013.7 2 | //******************************************** 3 | //** Copyright (C) WCH 2002-2013 ****** 4 | //** Web: http://www.winchiphead.com ****** 5 | //******************************************** 6 | //** Driver for USB to serial adaptor CH34X** 7 | //** GCC ** 8 | //******************************************** 9 | 10 | // Support linux kernel version 2.6.25 and later 11 | // 12 | 13 | #include 14 | #ifndef KERNEL_VERSION 15 | #define KERNEL_VERSION(ver, rel, seq) ((ver << 16) | (rel << 8) | (seq)) 16 | #endif 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | //#include 31 | #include 32 | #include 33 | 34 | #define DRIVER_DESC "WCH CH34x USB to serial adaptor driver" 35 | #define DRIVER_AUTHOR "" 36 | 37 | #define CH34x_VENDOR_ID 0x1A86 38 | #define CH340_PRODUCT_ID 0x7523 39 | #define CH341_PRODUCT_ID 0x5523 40 | 41 | #define CH34x_CLOSING_WAIT (30 * HZ) 42 | 43 | #define CH34x_BUF_SIZE 1024 44 | #define CH34x_TMP_BUF_SIZE 1024 45 | 46 | //Vendor define 47 | #define VENDOR_WRITE_TYPE 0x40 48 | #define VENDOR_READ_TYPE 0xC0 49 | 50 | #define VENDOR_READ 0x95 51 | #define VENDOR_WRITE 0x9A 52 | #define VENDOR_SERIAL_INIT 0xA1 53 | #define VENDOR_MODEM_OUT 0xA4 54 | #define VENDOR_VERSION 0x5F 55 | 56 | //For CMD 0xA4 57 | #define UART_CTS 0x01 58 | #define UART_DSR 0x02 59 | #define UART_RING 0x04 60 | #define UART_DCD 0x08 61 | #define CONTROL_OUT 0x10 62 | #define CONTROL_DTR 0x20 63 | #define CONTROL_RTS 0x40 64 | 65 | //Uart state 66 | #define UART_STATE 0x00 67 | #define UART_OVERRUN_ERROR 0x01 68 | #define UART_BREAK_ERROR //no define 69 | #define UART_PARITY_ERROR 0x02 70 | #define UART_FRAME_ERROR 0x06 71 | #define UART_RECV_ERROR 0x02 72 | #define UART_STATE_TRANSIENT_MASK 0x07 73 | 74 | //Port state 75 | #define PORTA_STATE 0x01 76 | #define PORTB_STATE 0x02 77 | #define PORTC_STATE 0x03 78 | 79 | //CH34x Baud Rate 80 | #define CH34x_BAUDRATE_FACTOR 1532620800 81 | #define CH34x_BAUDRATE_DIVMAX 3 82 | 83 | #define DEBUG_CH34x 84 | #undef DEBUG_CH34x 85 | 86 | #ifdef DEBUG_CH34x 87 | #define dbg_ch34x( format, arg... ) \ 88 | printk( KERN_DEBUG "%d: " format "\n", __LINE__, ##arg ) 89 | #else 90 | #define dbg_ch34x( format, arg... ) \ 91 | do{ \ 92 | if(0) \ 93 | printk(KERN_DEBUG "%d: " format "\n", __LINE__, ##arg); \ 94 | } while (0) 95 | #endif 96 | 97 | #ifdef DEBUG_CH34x 98 | #define err_ch34x( format, arg... ) \ 99 | printk(KERN_ERR KBUILD_MODNAME ": " format "\n", ##arg) 100 | #else 101 | #define err_ch34x( format, arg... ) \ 102 | do{ \ 103 | if(0) \ 104 | printk( KERN_ERR KBUILD_MODNAME ": " format "\n", ##arg)\ 105 | }while(0) 106 | #endif 107 | 108 | // For debug 109 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,1)) 110 | static int debug = 1; 111 | #endif 112 | 113 | struct ch34x_buf { 114 | unsigned int buf_size; 115 | char *buf_buf; 116 | char *buf_get; 117 | char *buf_put; 118 | }; 119 | 120 | struct ch34x_private { 121 | spinlock_t lock; //access lock 122 | struct ch34x_buf *buf; 123 | int write_urb_in_use; 124 | unsigned baud_rate; 125 | wait_queue_head_t delta_msr_wait; 126 | u8 line_control; 127 | u8 line_status; 128 | u8 termios_initialized; 129 | }; 130 | 131 | static struct usb_device_id id_table [] = { 132 | { USB_DEVICE(CH34x_VENDOR_ID, CH340_PRODUCT_ID) }, 133 | { USB_DEVICE(CH34x_VENDOR_ID, CH341_PRODUCT_ID) }, 134 | { } //End 135 | }; 136 | MODULE_DEVICE_TABLE( usb, id_table ); 137 | 138 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,2)) 139 | static struct usb_driver ch34x_driver = { 140 | .name = "ch34x", 141 | .probe = usb_serial_probe, 142 | .disconnect = usb_serial_disconnect, 143 | .id_table = id_table, 144 | .suspend = usb_serial_suspend, 145 | .resume = usb_serial_resume, 146 | .no_dynamic_id = 1, 147 | .supports_autosuspend = 1, 148 | }; 149 | #endif 150 | 151 | // ch34x_buf_alloc 152 | // Allocate a circular buffer and all associated memory 153 | static struct ch34x_buf *ch34x_buf_alloc( unsigned int size ) 154 | { 155 | struct ch34x_buf *pb; 156 | 157 | if( size == 0 ) 158 | return NULL; 159 | 160 | pb = kmalloc( sizeof(struct ch34x_buf), GFP_KERNEL ); 161 | if( pb == NULL ) 162 | return NULL; 163 | 164 | pb->buf_buf = kmalloc( size, GFP_KERNEL ); 165 | if( pb->buf_buf == NULL ) { 166 | kfree(pb); 167 | return NULL; 168 | } 169 | 170 | pb->buf_size = size; 171 | pb->buf_get = pb->buf_put = pb->buf_buf; 172 | 173 | return pb; 174 | } 175 | 176 | // ch34x_buf_free 177 | // Free the buffer and all associated memory 178 | static void ch34x_buf_free( struct ch34x_buf *pb ) 179 | { 180 | if( pb ) { 181 | kfree( pb->buf_buf ); 182 | kfree( pb ); 183 | } 184 | } 185 | 186 | // ch34x_buf_clear 187 | // Clear out all data in the circular buffer 188 | static void ch34x_buf_clear( struct ch34x_buf *pb ) 189 | { 190 | if( pb != NULL ) 191 | pb->buf_get = pb->buf_put; 192 | // equivalent to a get of all data available 193 | } 194 | 195 | // ch34x_buf_data_avail 196 | // Return the number of bytes of data available in he circular buffer 197 | static unsigned int ch34x_buf_data_avail( struct ch34x_buf *pb ) 198 | { 199 | if( pb == NULL ) 200 | return 0; 201 | 202 | return ((pb->buf_size + pb->buf_put - pb->buf_get) % pb->buf_size ); 203 | } 204 | 205 | // ch34x_buf_space_avail 206 | // Return the number of bytes of space available in the circular 207 | static unsigned int ch34x_buf_space_avail( struct ch34x_buf *pb ) 208 | { 209 | if( pb == NULL ) 210 | return 0; 211 | 212 | return ((pb->buf_size + pb->buf_get - pb->buf_put - 1) % pb->buf_size ); 213 | } 214 | 215 | // ch34x_buf_put 216 | // Copy data from a user buffer and put it into the circular buffer. 217 | // Restrict to the amount of space available 218 | // Return the number of bytes copied 219 | static unsigned int ch34x_buf_put( struct ch34x_buf *pb, 220 | const char *buf, unsigned int count ) 221 | { 222 | unsigned int len; 223 | 224 | if( pb == NULL ) 225 | return 0; 226 | 227 | len = ch34x_buf_space_avail(pb); 228 | if( count > len ) 229 | count = len; 230 | else if( count == 0 ) 231 | return 0; 232 | 233 | len = pb->buf_buf + pb->buf_size - pb->buf_put; 234 | if( count > len ) { 235 | memcpy( pb->buf_put, buf, len ); 236 | memcpy( pb->buf_buf, buf+len, count - len ); 237 | pb->buf_put = pb->buf_buf + count - len; 238 | } 239 | else { 240 | memcpy( pb->buf_put, buf, count ); 241 | if( count < len ) 242 | pb->buf_put += count; 243 | else if( count == len ) 244 | pb->buf_put = pb->buf_buf; 245 | } 246 | 247 | return count; 248 | } 249 | 250 | static unsigned int ch34x_buf_get( struct ch34x_buf *pb, 251 | char *buf, unsigned int count ) 252 | { 253 | unsigned int len; 254 | 255 | if( pb == NULL ) 256 | return 0; 257 | 258 | len = ch34x_buf_data_avail(pb); 259 | if( count > len ) 260 | count = len; 261 | else if( count == 0 ) 262 | return 0; 263 | 264 | len = pb->buf_buf + pb->buf_size - pb->buf_get; 265 | if( count > len ) { 266 | memcpy( buf, pb->buf_get, len ); 267 | memcpy( buf+len, pb->buf_buf, count - len ); 268 | pb->buf_get = pb->buf_buf + count - len; 269 | } 270 | else { 271 | memcpy( buf, pb->buf_get, count ); 272 | if( count < len ) 273 | pb->buf_get += count; 274 | else if( count == len ) 275 | pb->buf_get = pb->buf_buf; 276 | } 277 | 278 | return count; 279 | } 280 | 281 | static int ch34x_vendor_read( __u8 request, 282 | __u16 value, 283 | __u16 index, 284 | struct usb_serial *serial, 285 | unsigned char *buf, 286 | __u16 len ) 287 | { 288 | int retval; 289 | 290 | retval = usb_control_msg( serial->dev, usb_rcvctrlpipe(serial->dev, 0), 291 | request, VENDOR_READ_TYPE, value, index, buf, len, 1000 ); 292 | dbg_ch34x("0x%x:0x%x:0x%x:0x%x %d - %d", 293 | VENDOR_READ_TYPE, request, value, index, retval, len ); 294 | 295 | return retval; 296 | } 297 | 298 | static int ch34x_vendor_write( __u8 request, 299 | __u16 value, 300 | __u16 index, 301 | struct usb_serial *serial, 302 | unsigned char *buf, 303 | __u16 len ) 304 | { 305 | int retval; 306 | 307 | retval = usb_control_msg( serial->dev, 308 | usb_sndctrlpipe(serial->dev, 0), 309 | request, 310 | VENDOR_WRITE_TYPE, 311 | value, index, buf, len, 1000 ); 312 | 313 | return retval; 314 | } 315 | 316 | static int set_control_lines( struct usb_serial *serial, 317 | u8 value ) 318 | { 319 | int retval; 320 | 321 | retval = ch34x_vendor_write( VENDOR_MODEM_OUT, (unsigned short)value, 322 | 0x0000, serial, NULL, 0x00 ); 323 | dbg_ch34x("%s - value=%d, retval=%d", __func__, value, retval ); 324 | 325 | return retval; 326 | } 327 | 328 | static int ch34x_get_baud_rate( unsigned int baud_rate, 329 | unsigned char *a, unsigned char *b ) 330 | { 331 | unsigned long factor = 0; 332 | short divisor = 0; 333 | 334 | if( !baud_rate ) 335 | return -EINVAL; 336 | 337 | factor = (CH34x_BAUDRATE_FACTOR / baud_rate); 338 | divisor = CH34x_BAUDRATE_DIVMAX; 339 | 340 | while( (factor > 0xfff0) && divisor ) { 341 | factor >>= 3; 342 | divisor --; 343 | } 344 | 345 | if( factor > 0xfff0 ) 346 | return -EINVAL; 347 | 348 | factor = 0x10000 - factor; 349 | *a = (factor & 0xff00) >> 8; 350 | *b = divisor; 351 | 352 | return 0; 353 | } 354 | 355 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) 356 | static void ch34x_set_termios( struct tty_struct *tty, 357 | struct usb_serial_port *port, struct ktermios *old_termios ) 358 | { 359 | #else 360 | static void ch34x_set_termios( struct usb_serial_port *port, 361 | struct ktermios *old_termios ) 362 | { 363 | struct tty_struct *tty = port->tty; 364 | #endif 365 | struct usb_serial *serial = port->serial; 366 | struct ch34x_private *priv = usb_get_serial_port_data(port); 367 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,1)) //sure 368 | struct ktermios *termios = &tty->termios; 369 | #else 370 | struct ktermios *termios = tty->termios; 371 | #endif 372 | unsigned int baud_rate; 373 | unsigned int cflag; 374 | unsigned long flags; 375 | u8 control; 376 | 377 | unsigned char divisor = 0; 378 | unsigned char reg_count = 0; 379 | unsigned char factor = 0; 380 | unsigned char reg_value = 0; 381 | unsigned short value = 0; 382 | unsigned short index = 0; 383 | 384 | dbg_ch34x("%s - port:%d", __func__, port->port_number); 385 | 386 | spin_lock_irqsave( &priv->lock, flags ); 387 | if( !priv->termios_initialized ) { 388 | *(termios) = tty_std_termios; 389 | termios->c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL; 390 | termios->c_ispeed = 9600; 391 | termios->c_ospeed = 9600; 392 | priv->termios_initialized = 1; 393 | } 394 | spin_unlock_irqrestore( &priv->lock, flags ); 395 | 396 | /* 397 | * The ch34x is reported to lose bytes if you change serial setting 398 | * even to the same vaules as before. Thus we actually need to filter 399 | * in this specific case. 400 | */ 401 | if( !tty_termios_hw_change(termios, old_termios) ) 402 | return; 403 | 404 | cflag = termios->c_cflag; 405 | dbg_ch34x("%s (%d) cflag=0x%x\n", __func__, port->port_number, cflag ); 406 | 407 | // Get the byte size 408 | switch( cflag & CSIZE ) 409 | { 410 | case CS5: 411 | reg_value |= 0x00; 412 | break; 413 | case CS6: 414 | reg_value |= 0x01; 415 | break; 416 | case CS7: 417 | reg_value |= 0x02; 418 | break; 419 | case CS8: 420 | reg_value |= 0x03; 421 | break; 422 | default: 423 | reg_value |= 0x03; 424 | break; 425 | } 426 | dbg_ch34x("%s - data bits = %d", __func__, reg_value + 0x05 ); 427 | 428 | // Figure out the stop bits 429 | if( cflag & CSTOPB ) { 430 | reg_value |= 0x04; 431 | dbg_ch34x("%s - stop bits = 2", __func__); 432 | } 433 | else 434 | dbg_ch34x("%s - stop bits = 1", __func__); 435 | 436 | // Determine the parity 437 | if( cflag & PARENB ) 438 | if( cflag & PARODD ) { 439 | reg_value |= (0x08 | 0x00); 440 | dbg_ch34x("%s - parity = odd", __func__); 441 | } 442 | else { 443 | reg_value |= (0x08 | 0x10); 444 | dbg_ch34x("%s - parity = even", __func__); 445 | } 446 | else 447 | dbg_ch34x("%s - parity = none", __func__); 448 | 449 | // Determine the baud rate 450 | baud_rate = tty_get_baud_rate( tty ); 451 | dbg_ch34x("%s = baud_rate = %d", __func__, baud_rate); 452 | ch34x_get_baud_rate( baud_rate, &factor, &divisor ); 453 | dbg_ch34x("----->>>> baud_rate = %d, factor:0x%x, divisor:0x%x", 454 | baud_rate, factor, divisor ); 455 | 456 | //enable SFR_UART RX and TX 457 | reg_value |= 0xc0; 458 | //enable SFR_UART Control register and timer 459 | reg_count |= 0x9c; 460 | 461 | value |= reg_count; 462 | value |= (unsigned short)reg_value << 8; 463 | index |= 0x80 | divisor; 464 | index |= (unsigned short)factor << 8; 465 | ch34x_vendor_write( VENDOR_SERIAL_INIT, value, index, serial, NULL, 0 ); 466 | 467 | // change control lines if we are switching to or from B0 468 | spin_lock_irqsave( &priv->lock, flags ); 469 | control = priv->line_control; 470 | if( (cflag & CBAUD) == B0 ) 471 | priv->line_control &= ~(CONTROL_DTR | CONTROL_RTS); 472 | else 473 | priv->line_control |= (CONTROL_DTR | CONTROL_RTS); 474 | 475 | if( control != priv->line_control ) { 476 | control = priv->line_control; 477 | spin_unlock_irqrestore( &priv->lock, flags ); 478 | set_control_lines( serial, control ); 479 | } 480 | else 481 | spin_unlock_irqrestore( &priv->lock, flags ); 482 | 483 | if( cflag & CRTSCTS ) 484 | ch34x_vendor_write( VENDOR_WRITE, 0x2727, 0x0101, serial, NULL, 0); 485 | 486 | // FIXME: Need to read back resulting baud rate 487 | if( baud_rate ) 488 | tty_encode_baud_rate(tty, baud_rate, baud_rate); 489 | 490 | } 491 | 492 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,3)) 493 | static int ch34x_tiocmget( struct tty_struct *tty ) 494 | { 495 | struct usb_serial_port *port = tty->driver_data; 496 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) 497 | static int ch34x_tiocmget( struct tty_struct *tty, 498 | struct file *filp ) 499 | { 500 | struct usb_serial_port *port = tty->driver_data; 501 | #else 502 | static int ch34x_tiocmget( struct usb_serial_port *port, 503 | struct file *filp ) 504 | { 505 | #endif 506 | struct ch34x_private *priv = usb_get_serial_port_data(port); 507 | unsigned long flags; 508 | unsigned int mcr; 509 | /*unsigned int msr;*/ 510 | unsigned int retval; 511 | 512 | dbg_ch34x("%s - port:%d", __func__, port->port_number); 513 | 514 | if( !usb_get_intfdata( port->serial->interface) ) 515 | return -ENODEV; 516 | 517 | spin_lock_irqsave( &priv->lock, flags ); 518 | mcr = priv->line_control; 519 | spin_unlock_irqrestore( &priv->lock, flags ); 520 | 521 | retval = ((mcr & CONTROL_DTR) ? TIOCM_DTR : 0) | 522 | ((mcr & CONTROL_RTS) ? TIOCM_RTS : 0) | 523 | ((mcr & UART_CTS) ? TIOCM_CTS : 0) | 524 | ((mcr & UART_DSR) ? TIOCM_DSR : 0) | 525 | ((mcr & UART_RING) ? TIOCM_RI : 0) | 526 | ((mcr & UART_DCD) ? TIOCM_CD : 0); 527 | 528 | dbg_ch34x("%s - retval=0x%x", __func__, retval); 529 | 530 | return retval; 531 | } 532 | 533 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32) && \ 534 | LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) ) 535 | static void ch34x_close( struct tty_struct *tty, 536 | struct usb_serial_port *port, struct file *filp ) 537 | { 538 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32) ) 539 | static void ch34x_close( struct usb_serial_port *port ) 540 | { 541 | struct tty_struct *tty = port->port.tty; 542 | #elif (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)) 543 | static void ch34x_close( struct usb_serial_port *port, 544 | struct file *filp ) 545 | { 546 | struct tty_struct *tty = port->tty; 547 | #endif 548 | struct ch34x_private *priv = usb_get_serial_port_data(port); 549 | unsigned long flags; 550 | unsigned int c_cflag; 551 | int bps; 552 | long timeout; 553 | wait_queue_t wait; 554 | 555 | dbg_ch34x("%s - port:%d", __func__, port->port_number); 556 | 557 | // wait for data do drain from the buffer 558 | spin_lock_irqsave( &priv->lock, flags ); 559 | timeout = CH34x_CLOSING_WAIT; 560 | init_waitqueue_entry( &wait, current ); 561 | add_wait_queue( &tty->write_wait, &wait ); 562 | for(;;) { 563 | set_current_state( TASK_INTERRUPTIBLE ); 564 | if( ch34x_buf_data_avail(priv->buf) == 0 || timeout == 0 || 565 | signal_pending(current) || port->serial->disconnected ) 566 | break; 567 | spin_unlock_irqrestore( &priv->lock, flags ); 568 | timeout = schedule_timeout( timeout ); 569 | spin_lock_irqsave( &priv->lock, flags ); 570 | } 571 | set_current_state( TASK_RUNNING ); 572 | remove_wait_queue( &tty->write_wait, &wait ); 573 | // clear out any remaining data in the buffer 574 | ch34x_buf_clear( priv->buf ); 575 | spin_unlock_irqrestore( &priv->lock, flags ); 576 | 577 | bps = tty_get_baud_rate( tty ); 578 | if( bps > 1200 ) 579 | timeout = max( (HZ * 2560) / bps, HZ / 10 ); 580 | else 581 | timeout = 2 * HZ; 582 | schedule_timeout_interruptible(timeout); 583 | 584 | // shutdown our urbs 585 | usb_kill_urb(port->interrupt_in_urb); 586 | usb_kill_urb(port->read_urb); 587 | usb_kill_urb(port->write_urb); 588 | /*usb_serial_generic_close(port, filp);*/ 589 | 590 | if( tty ) { 591 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,1)) //sure 592 | c_cflag = tty->termios.c_cflag; 593 | #else 594 | c_cflag = tty->termios->c_cflag; 595 | #endif 596 | if( c_cflag & HUPCL ) { 597 | // drop DTR and RTS 598 | spin_lock_irqsave( &priv->lock, flags ); 599 | priv->line_control = 0; 600 | spin_unlock_irqrestore( &priv->lock, flags ); 601 | set_control_lines( port->serial, 0 ); 602 | } 603 | } 604 | } 605 | 606 | // kernel version 607 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32) \ 608 | && LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) 609 | static int ch34x_open( struct tty_struct *tty, 610 | struct usb_serial_port *port, struct file *filp ) 611 | { 612 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)) 613 | static int ch34x_open( struct tty_struct *tty, 614 | struct usb_serial_port *port ) 615 | { 616 | #elif (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)) 617 | static int ch34x_open( struct usb_serial_port *port, 618 | struct file *filp ) 619 | { 620 | struct tty_struct *tty = port->tty; 621 | #endif 622 | struct ktermios tmp_termios; 623 | struct usb_serial *serial = port->serial; 624 | int retval; 625 | 626 | dbg_ch34x("%s - port:%d", __func__, port->port_number ); 627 | 628 | usb_clear_halt( serial->dev, port->write_urb->pipe ); 629 | usb_clear_halt( serial->dev, port->read_urb->pipe ); 630 | 631 | if( tty ) { 632 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) 633 | ch34x_set_termios( tty, port, &tmp_termios ); 634 | #else 635 | ch34x_set_termios( port, &tmp_termios ); 636 | #endif 637 | } 638 | 639 | dbg_ch34x("%s - submit read urb", __func__); 640 | port->read_urb->dev = serial->dev; 641 | retval = usb_submit_urb( port->read_urb, GFP_KERNEL ); 642 | if(retval) { 643 | dev_err( &port->dev, "%s - failed submit read urb,error %d\n", 644 | __func__, retval ); 645 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32) && \ 646 | LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) ) 647 | ch34x_close(tty, port, NULL); 648 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)) 649 | ch34x_close(port); 650 | #elif (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)) 651 | ch34x_close(port, filp); 652 | #endif 653 | goto err_out; 654 | } 655 | 656 | dbg_ch34x("%s - submit interrupt urb", __func__ ); 657 | port->interrupt_in_urb->dev = serial->dev; 658 | retval = usb_submit_urb( port->interrupt_in_urb, GFP_KERNEL ); 659 | if(retval) { 660 | dev_err( &port->dev, "%s - failed submit interrupt urb,error %d\n", 661 | __func__, retval ); 662 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32) && \ 663 | LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) ) 664 | ch34x_close(tty, port, NULL); 665 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)) 666 | ch34x_close(port); 667 | #elif (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)) 668 | ch34x_close(port, filp); 669 | #endif 670 | goto err_out; 671 | } 672 | 673 | err_out: 674 | return retval; 675 | } 676 | 677 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,3)) 678 | static int ch34x_tiocmset( struct tty_struct *tty, 679 | unsigned int set, unsigned int clear ) 680 | { 681 | struct usb_serial_port *port = tty->driver_data; 682 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) 683 | static int ch34x_tiocmset( struct tty_struct *tty, 684 | struct file *filp, unsigned int set, unsigned int clear ) 685 | { 686 | struct usb_serial_port *port = tty->driver_data; 687 | #else 688 | static int ch34x_tiocmset( struct usb_serial_port *port, 689 | struct file *filp, unsigned int set, unsigned int clear ) 690 | { 691 | #endif 692 | struct ch34x_private *priv = usb_get_serial_port_data(port); 693 | unsigned long flags; 694 | /*unsigned int mcr = priv->line_control;*/ 695 | u8 control; 696 | 697 | dbg_ch34x("%s - port:%d", __func__, port->port_number); 698 | 699 | if( !usb_get_intfdata(port->serial->interface) ) 700 | return -ENODEV; 701 | 702 | spin_lock_irqsave( &priv->lock, flags ); 703 | if( set & TIOCM_RTS ) 704 | priv->line_control |= CONTROL_RTS; 705 | if( set & TIOCM_DTR ) 706 | priv->line_control |= CONTROL_DTR; 707 | if( clear & TIOCM_RTS ) 708 | priv->line_control &= ~CONTROL_RTS; 709 | if( clear & TIOCM_DTR ) 710 | priv->line_control &= ~CONTROL_DTR; 711 | control = priv->line_control; 712 | spin_unlock_irqrestore( &priv->lock, flags ); 713 | 714 | return set_control_lines( port->serial, control ); 715 | } 716 | 717 | static int wait_modem_info( struct usb_serial_port *port, 718 | unsigned int arg ) 719 | { 720 | struct ch34x_private *priv = usb_get_serial_port_data(port); 721 | unsigned long flags; 722 | unsigned int prevstatus; 723 | unsigned int status; 724 | unsigned int changed; 725 | 726 | dbg_ch34x("%s -port:%d", __func__, port->port_number); 727 | 728 | spin_lock_irqsave( &priv->lock, flags ); 729 | prevstatus = priv->line_status; 730 | spin_unlock_irqrestore( &priv->lock, flags ); 731 | 732 | while(1) { 733 | interruptible_sleep_on( &priv->delta_msr_wait ); 734 | // see if a signal did it 735 | if( signal_pending(current) ) 736 | return -ERESTARTSYS; 737 | 738 | spin_lock_irqsave( &priv->lock, flags ); 739 | status = priv->line_status; 740 | spin_unlock_irqrestore( &priv->lock, flags ); 741 | 742 | changed = prevstatus ^ status; 743 | 744 | if( ((arg & TIOCM_RNG) && (changed & UART_RING)) || 745 | ((arg & TIOCM_DSR) && (changed & UART_DSR)) || 746 | ((arg & TIOCM_CD) && (changed & UART_DCD)) || 747 | ((arg & TIOCM_CTS) && (changed & UART_CTS)) ) 748 | return 0; 749 | 750 | prevstatus = status; 751 | } 752 | 753 | // Not reatched 754 | return 0; 755 | } 756 | 757 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,3)) 758 | static int ch34x_ioctl( struct tty_struct *tty, 759 | unsigned int cmd, unsigned long arg ) 760 | { 761 | struct usb_serial_port *port = tty->driver_data; 762 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) 763 | static int ch34x_ioctl( struct tty_struct *tty, 764 | struct file *filp, unsigned int cmd, unsigned long arg ) 765 | { 766 | struct usb_serial_port *port = tty->driver_data; 767 | #else 768 | static int ch34x_ioctl( struct usb_serial_port *port, 769 | struct file *filp, unsigned int cmd, unsigned long arg ) 770 | { 771 | //struct usb_serial_port *port = tty->driver_data; 772 | #endif 773 | dbg_ch34x("%s - port:%d, cmd=0x%04x", __func__, port->port_number, cmd); 774 | 775 | switch(cmd) 776 | { 777 | // Note here 778 | case TIOCMIWAIT: 779 | dbg_ch34x("%s - port:%d TIOCMIWAIT", __func__, port->port_number); 780 | return wait_modem_info(port, arg); 781 | default: 782 | dbg_ch34x("%s not supported=0x%04x", __func__, cmd); 783 | break; 784 | } 785 | 786 | return -ENOIOCTLCMD; 787 | } 788 | 789 | static void ch34x_send( struct usb_serial_port *port ) 790 | { 791 | int count; 792 | int retval; 793 | struct ch34x_private *priv = usb_get_serial_port_data( port ); 794 | unsigned long flags; 795 | 796 | dbg_ch34x("%s - port:%d", __func__, port->port_number ); 797 | 798 | spin_lock_irqsave( &priv->lock, flags ); 799 | if( priv->write_urb_in_use ) { 800 | spin_unlock_irqrestore( &priv->lock, flags ); 801 | return; 802 | } 803 | 804 | count = ch34x_buf_get( priv->buf, port->write_urb->transfer_buffer, 805 | port->bulk_out_size ); 806 | if( count == 0 ) { 807 | spin_unlock_irqrestore( &priv->lock, flags ); 808 | return; 809 | } 810 | 811 | priv->write_urb_in_use = 1; 812 | spin_unlock_irqrestore( &priv->lock, flags ); 813 | 814 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,1)) 815 | usb_serial_debug_data( &port->dev, __func__, count, 816 | port->write_urb->transfer_buffer ); 817 | #else 818 | usb_serial_debug_data( debug, &port->dev, __func__, count, 819 | port->write_urb->transfer_buffer ); 820 | #endif 821 | 822 | port->write_urb->transfer_buffer_length = count; 823 | port->write_urb->dev = port->serial->dev; 824 | retval = usb_submit_urb( port->write_urb, GFP_ATOMIC ); 825 | if( retval ) { 826 | dev_err( &port->dev, "%s - failed submitting write urb,error %d\n" 827 | , __func__, retval ); 828 | priv->write_urb_in_use = 0; 829 | // reschedule ch34x_send 830 | } 831 | 832 | usb_serial_port_softint( port ); 833 | } 834 | 835 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) 836 | static int ch34x_write( struct tty_struct *tty, 837 | struct usb_serial_port *port, const unsigned char *buf, int count ) 838 | #else 839 | static int ch34x_write( struct usb_serial_port *port, 840 | const unsigned char *buf, int count ) 841 | #endif 842 | { 843 | struct ch34x_private *priv = usb_get_serial_port_data(port); 844 | unsigned long flags; 845 | 846 | dbg_ch34x("%s - port:%d, %d bytes", __func__, port->port_number, count); 847 | 848 | if( !count ) 849 | return count; 850 | 851 | spin_lock_irqsave( &priv->lock, flags ); 852 | count = ch34x_buf_put( priv->buf, buf, count ); 853 | spin_unlock_irqrestore( &priv->lock, flags ); 854 | 855 | ch34x_send(port); 856 | 857 | return count; 858 | } 859 | 860 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) 861 | static int ch34x_write_room( struct tty_struct *tty ) 862 | { 863 | struct usb_serial_port *port = tty->driver_data; 864 | #else 865 | static int ch34x_write_room( struct usb_serial_port *port ) 866 | { 867 | #endif 868 | struct ch34x_private *priv = usb_get_serial_port_data( port ); 869 | int room = 0; 870 | unsigned long flags; 871 | 872 | dbg_ch34x("%s - port:%d", __func__, port->port_number ); 873 | 874 | spin_lock_irqsave( &priv->lock, flags ); 875 | room = ch34x_buf_space_avail( priv->buf ); 876 | spin_unlock_irqrestore( &priv->lock, flags ); 877 | 878 | dbg_ch34x("%s - room:%d", __func__, room ); 879 | return room; 880 | } 881 | 882 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) 883 | static int ch34x_chars_in_buffer( struct tty_struct *tty ) 884 | { 885 | struct usb_serial_port *port = tty->driver_data; 886 | #else 887 | static int ch34x_chars_in_buffer( struct usb_serial_port *port ) 888 | { 889 | #endif 890 | struct ch34x_private *priv = usb_get_serial_port_data(port); 891 | int chars = 0; 892 | unsigned long flags; 893 | 894 | dbg_ch34x("%s - port:%d", __func__, port->port_number ); 895 | 896 | spin_lock_irqsave( &priv->lock, flags ); 897 | chars = ch34x_buf_data_avail( priv->buf ); 898 | spin_unlock_irqrestore( &priv->lock, flags ); 899 | 900 | dbg_ch34x("%s - chars:%d", __func__, chars ); 901 | 902 | return chars; 903 | } 904 | 905 | static int ch34x_attach( struct usb_serial *serial ) 906 | { 907 | struct ch34x_private *priv; 908 | int i; 909 | char buf[8]; 910 | 911 | dbg_ch34x("%s", __func__); 912 | 913 | for( i = 0; i < serial->num_ports; ++i ) { 914 | priv = kzalloc( sizeof(struct ch34x_private), GFP_KERNEL ); 915 | if( !priv ) 916 | goto cleanup; 917 | spin_lock_init( &priv->lock ); 918 | priv->buf = ch34x_buf_alloc( CH34x_BUF_SIZE ); 919 | if( priv->buf == NULL ) { 920 | kfree( priv ); 921 | goto cleanup; 922 | } 923 | init_waitqueue_head( &priv->delta_msr_wait ); 924 | usb_set_serial_port_data( serial->port[i], priv ); 925 | } 926 | 927 | ch34x_vendor_read( VENDOR_VERSION, 0x0000, 0x0000, 928 | serial, buf, 0x02 ); 929 | ch34x_vendor_write( VENDOR_SERIAL_INIT, 0x0000, 0x0000, 930 | serial, NULL, 0x00 ); 931 | ch34x_vendor_write( VENDOR_WRITE, 0x1312, 0xD982, 932 | serial, NULL, 0x00 ); 933 | ch34x_vendor_write( VENDOR_WRITE, 0x0F2C, 0x0004, 934 | serial, NULL, 0x00 ); 935 | ch34x_vendor_read( VENDOR_READ, 0x2518, 0x0000, 936 | serial, buf, 0x02 ); 937 | ch34x_vendor_write( VENDOR_WRITE, 0x2727, 0x0000, 938 | serial, NULL, 0x00 ); 939 | ch34x_vendor_write( VENDOR_MODEM_OUT, 0x009F, 0x0000, 940 | serial, NULL, 0x00 ); 941 | 942 | return 0; 943 | 944 | cleanup: 945 | for( --i; i >= 0; --i ) { 946 | priv = usb_get_serial_port_data( serial->port[i] ); 947 | ch34x_buf_free( priv->buf ); 948 | kfree( priv ); 949 | usb_set_serial_port_data( serial->port[i], NULL ); 950 | } 951 | 952 | return -ENOMEM; 953 | } 954 | 955 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)) 956 | static void ch34x_shutdown( struct usb_serial *serial ) 957 | { 958 | struct ch34x_private *priv; 959 | int i; 960 | 961 | dbg_ch34x("%s", __func__); 962 | 963 | for( i = 0; i < serial->num_ports; ++i ) { 964 | priv = usb_get_serial_port_data( serial->port[i] ); 965 | if( priv ) { 966 | ch34x_buf_free( priv->buf ); 967 | kfree( priv ); 968 | usb_set_serial_port_data( serial->port[i], NULL ); 969 | } 970 | } 971 | } 972 | #endif 973 | 974 | static void ch34x_update_line_status( struct usb_serial_port *port, 975 | unsigned char *data, unsigned int actual_length ) 976 | { 977 | struct ch34x_private *priv = usb_get_serial_port_data( port ); 978 | unsigned long flags; 979 | u8 length = UART_STATE + 0x04; 980 | 981 | if( actual_length < length ) 982 | return; 983 | 984 | // Save off the uart status for others to look at 985 | spin_lock_irqsave( &priv->lock, flags ); 986 | priv->line_status = data[UART_STATE]; 987 | priv->line_control = data[PORTB_STATE]; 988 | spin_unlock_irqrestore( &priv->lock, flags ); 989 | wake_up_interruptible( &priv->delta_msr_wait ); 990 | } 991 | 992 | static void ch34x_read_int_callback( struct urb *urb ) 993 | { 994 | struct usb_serial_port *port = (struct usb_serial_port *)urb->context; 995 | unsigned char *data = urb->transfer_buffer; 996 | unsigned int actual_length = urb->actual_length; 997 | int status = urb->status; 998 | int retval; 999 | 1000 | dbg_ch34x("%s port:%d", __func__, port->port_number ); 1001 | 1002 | switch( status ) { 1003 | case 0: //success 1004 | break; 1005 | case -ECONNRESET: 1006 | case -ENOENT: 1007 | case -ESHUTDOWN: //this urb is terminated, clean up 1008 | dbg_ch34x("%s - urb shutting down with status:%d", __func__, status ); 1009 | return; 1010 | default: 1011 | dbg_ch34x("%s - nonzero urb status received:%d", __func__, status ); 1012 | goto exit; 1013 | } 1014 | 1015 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,1)) 1016 | usb_serial_debug_data( &port->dev, __func__, 1017 | urb->actual_length, urb->transfer_buffer ); 1018 | #else 1019 | usb_serial_debug_data( debug, &port->dev, 1020 | __func__, urb->actual_length, urb->transfer_buffer ); 1021 | #endif 1022 | 1023 | ch34x_update_line_status( port, data, actual_length ); 1024 | 1025 | exit: 1026 | retval = usb_submit_urb( urb, GFP_ATOMIC ); 1027 | if( retval ) 1028 | dev_err( &urb->dev->dev, "%s - usb_submit_urb failed with result %d\n", 1029 | __func__, retval ); 1030 | } 1031 | 1032 | static void ch34x_read_bulk_callback( struct urb *urb ) 1033 | { 1034 | struct usb_serial_port *port = (struct usb_serial_port *)urb->context; 1035 | struct ch34x_private *priv = usb_get_serial_port_data( port ); 1036 | struct tty_struct *tty; 1037 | unsigned char *data = urb->transfer_buffer; 1038 | unsigned long flags; 1039 | int i; 1040 | int retval; 1041 | int status = urb->status; 1042 | u8 line_status; 1043 | char tty_flag; 1044 | 1045 | dbg_ch34x("%s - port:%d", __func__, port->port_number ); 1046 | if( status ) { 1047 | dbg_ch34x("%s - urb status=%d", __func__, status ); 1048 | if( status == -EPROTO ) { 1049 | // CH34x mysteriously fails with -EPROTO reschedule the read 1050 | dbg_ch34x("%s - caught -EPROTO, resubmitting the urb", __func__); 1051 | urb->dev = port->serial->dev; 1052 | retval = usb_submit_urb( urb, GFP_ATOMIC ); 1053 | if( retval ) { 1054 | dev_err( &urb->dev->dev, 1055 | "%s - failed resubmitting read urb, error %d\n", 1056 | __func__, retval ); 1057 | return; 1058 | } 1059 | } 1060 | 1061 | dbg_ch34x("%s - unable to handle the error, exiting.", __func__); 1062 | return; 1063 | } 1064 | 1065 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,1)) 1066 | usb_serial_debug_data( &port->dev, __func__, 1067 | urb->actual_length, data ); 1068 | #else 1069 | usb_serial_debug_data( debug, &port->dev, 1070 | __func__, urb->actual_length, data ); 1071 | #endif 1072 | 1073 | // get tty_flag from status 1074 | tty_flag = TTY_NORMAL; 1075 | 1076 | spin_lock_irqsave( &priv->lock, flags ); 1077 | line_status = priv->line_status; 1078 | priv->line_status &= ~UART_STATE_TRANSIENT_MASK; 1079 | spin_unlock_irqrestore( &priv->lock, flags ); 1080 | wake_up_interruptible( &priv->delta_msr_wait ); 1081 | 1082 | // break takes precedence over parity, 1083 | // which takes precedence over framing errors 1084 | if( line_status & UART_PARITY_ERROR ) 1085 | tty_flag = TTY_PARITY; 1086 | else if( line_status & UART_OVERRUN_ERROR ) 1087 | tty_flag = TTY_OVERRUN; 1088 | else if( line_status & UART_FRAME_ERROR ) 1089 | tty_flag = TTY_FRAME; 1090 | dbg_ch34x("%s - tty_flag=%d", __func__, tty_flag); 1091 | 1092 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) 1093 | tty = port->port.tty; 1094 | #else 1095 | tty = port->tty; 1096 | #endif 1097 | if( tty && urb->actual_length ) { 1098 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,1)) 1099 | tty_buffer_request_room( tty->port, urb->actual_length + 1); 1100 | #else 1101 | tty_buffer_request_room( tty, urb->actual_length + 1 ); 1102 | #endif 1103 | // overrun is special, not associated with a char 1104 | if( line_status & UART_OVERRUN_ERROR ) 1105 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,1)) 1106 | tty_insert_flip_char( tty->port, 0, TTY_OVERRUN ); 1107 | #else 1108 | tty_insert_flip_char( tty, 0, TTY_OVERRUN ); 1109 | #endif 1110 | for( i = 0; i < urb->actual_length; ++i ) 1111 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,1)) 1112 | tty_insert_flip_char( tty->port, data[i], tty_flag ); 1113 | #else 1114 | tty_insert_flip_char( tty, data[i], tty_flag ); 1115 | #endif 1116 | 1117 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,1)) 1118 | tty_flip_buffer_push( tty->port ); 1119 | #else 1120 | tty_flip_buffer_push( tty ); 1121 | #endif 1122 | } 1123 | 1124 | //Schedule the next read _if_ we are still open 1125 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)) 1126 | if( port->open_count ) 1127 | #endif 1128 | { 1129 | urb->dev = port->serial->dev; 1130 | retval = usb_submit_urb( urb, GFP_ATOMIC ); 1131 | if( retval ) 1132 | dev_err( &urb->dev->dev, 1133 | "%s - fialed resubmitting read urb, error %d\n", 1134 | __func__, retval ); 1135 | } 1136 | 1137 | return; 1138 | } 1139 | 1140 | static void ch34x_write_bulk_callback( struct urb *urb ) 1141 | { 1142 | struct usb_serial_port *port = (struct usb_serial_port *)urb->context; 1143 | struct ch34x_private *priv = usb_get_serial_port_data(port); 1144 | int retval; 1145 | int status = urb->status; 1146 | 1147 | dbg_ch34x("%s - port:%d", __func__, port->port_number ); 1148 | 1149 | switch( status ) { 1150 | case 0: //success 1151 | break; 1152 | case -ECONNRESET: 1153 | case -ENOENT: 1154 | case -ESHUTDOWN: 1155 | // this urb is terminated, clean up 1156 | dbg_ch34x("%s - urb shutting down with status:%d", __func__, status); 1157 | priv->write_urb_in_use = 0; 1158 | return; 1159 | default: 1160 | // error in the urb, so we have to resubmit it 1161 | dbg_ch34x("%s - Overflow in write", __func__); 1162 | dbg_ch34x("%s - nonzero write bulk status received:%d", __func__, status); 1163 | port->write_urb->transfer_buffer_length = 1; 1164 | port->write_urb->dev = port->serial->dev; 1165 | retval = usb_submit_urb(port->write_urb, GFP_ATOMIC); 1166 | if( retval ) 1167 | dev_err( &urb->dev->dev, 1168 | "%s - failed resubmitting write urv, error:%d\n", 1169 | __func__, retval ); 1170 | else 1171 | return; 1172 | } 1173 | 1174 | priv->write_urb_in_use = 0; 1175 | 1176 | // send any buffered data 1177 | ch34x_send(port); 1178 | } 1179 | 1180 | static struct usb_serial_driver ch34x_device = { 1181 | .driver = { 1182 | .owner = THIS_MODULE, 1183 | .name = "ch34x", 1184 | }, 1185 | .id_table = id_table, 1186 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,1)) 1187 | .usb_driver = &ch34x_driver, 1188 | #endif 1189 | .num_ports = 1, 1190 | .open = ch34x_open, 1191 | .close = ch34x_close, 1192 | .write = ch34x_write, 1193 | .ioctl = ch34x_ioctl, 1194 | .set_termios = ch34x_set_termios, 1195 | .tiocmget = ch34x_tiocmget, 1196 | .tiocmset = ch34x_tiocmset, 1197 | .read_bulk_callback = ch34x_read_bulk_callback, 1198 | .read_int_callback = ch34x_read_int_callback, 1199 | .write_bulk_callback = ch34x_write_bulk_callback, 1200 | .write_room = ch34x_write_room, 1201 | .chars_in_buffer = ch34x_chars_in_buffer, 1202 | .attach = ch34x_attach, 1203 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32) ) 1204 | .shutdown = ch34x_shutdown, 1205 | #endif 1206 | }; 1207 | 1208 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,5)) 1209 | static struct usb_serial_driver *const serial_driver [] = { 1210 | &ch34x_device, NULL 1211 | }; 1212 | #endif 1213 | 1214 | 1215 | static int __init ch34x_init(void) 1216 | { 1217 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,5)) 1218 | int retval = 0; 1219 | 1220 | retval = usb_serial_register( &ch34x_device ); 1221 | if( retval ) { 1222 | goto err_usb_serial_register; 1223 | } 1224 | retval = usb_register( &ch34x_driver ); 1225 | if( retval ) { 1226 | goto err_usb_register; 1227 | } 1228 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)) 1229 | info( DRIVER_DESC ); 1230 | #endif 1231 | return 0; 1232 | 1233 | err_usb_register: 1234 | usb_deregister( &ch34x_driver ); 1235 | err_usb_serial_register: 1236 | usb_serial_deregister( &ch34x_device ); 1237 | return retval; 1238 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,1)) 1239 | return usb_serial_register_drivers( serial_driver, 1240 | KBUILD_MODNAME, id_table ); 1241 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,5) && \ 1242 | LINUX_VERSION_CODE < KERNEL_VERSION(3,5,1)) 1243 | return usb_serial_register_drivers(&ch34x_driver, serial_driver); 1244 | #endif 1245 | } 1246 | 1247 | static void __exit ch34x_exit(void) 1248 | { 1249 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,5)) 1250 | usb_deregister( &ch34x_driver ); 1251 | usb_serial_deregister( &ch34x_device ); 1252 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,1)) 1253 | usb_serial_deregister_drivers( serial_driver ); 1254 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,5) && \ 1255 | LINUX_VERSION_CODE < KERNEL_VERSION(3,5,1)) 1256 | usb_serial_deregister_drivers(&ch34x_driver, serial_driver); 1257 | #endif 1258 | } 1259 | 1260 | module_init( ch34x_init ); 1261 | module_exit( ch34x_exit ); 1262 | 1263 | 1264 | MODULE_DESCRIPTION(DRIVER_DESC); 1265 | MODULE_AUTHOR(DRIVER_AUTHOR); 1266 | MODULE_LICENSE("GPL"); 1267 | -------------------------------------------------------------------------------- /ch340g/.ch34x.o.cmd: -------------------------------------------------------------------------------- 1 | cmd_/media/d/A8C0-05DE/arduino/ch340g/ch34x.o := gcc -Wp,-MD,/media/d/A8C0-05DE/arduino/ch340g/.ch34x.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-linux-gnu/4.8/include -I/usr/src/linux-headers-3.11.0-12-generic/arch/x86/include -Iarch/x86/include/generated -Iinclude -I/usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi -Iarch/x86/include/generated/uapi -I/usr/src/linux-headers-3.11.0-12-generic/include/uapi -Iinclude/generated/uapi -include /usr/src/linux-headers-3.11.0-12-generic/include/linux/kconfig.h -Iubuntu/include -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -O2 -m64 -mno-sse -mpreferred-stack-boundary=3 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -fstack-protector -DCONFIG_X86_X32_ABI -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -Wframe-larger-than=1024 -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -pg -mfentry -DCC_USING_FENTRY -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -DCC_HAVE_ASM_GOTO -DMODULE -D"KBUILD_STR(s)=\#s" -D"KBUILD_BASENAME=KBUILD_STR(ch34x)" -D"KBUILD_MODNAME=KBUILD_STR(ch34x)" -c -o /media/d/A8C0-05DE/arduino/ch340g/.tmp_ch34x.o /media/d/A8C0-05DE/arduino/ch340g/ch34x.c 2 | 3 | source_/media/d/A8C0-05DE/arduino/ch340g/ch34x.o := /media/d/A8C0-05DE/arduino/ch340g/ch34x.c 4 | 5 | deps_/media/d/A8C0-05DE/arduino/ch340g/ch34x.o := \ 6 | include/generated/uapi/linux/version.h \ 7 | include/linux/kernel.h \ 8 | $(wildcard include/config/lbdaf.h) \ 9 | $(wildcard include/config/preempt/voluntary.h) \ 10 | $(wildcard include/config/debug/atomic/sleep.h) \ 11 | $(wildcard include/config/prove/locking.h) \ 12 | $(wildcard include/config/ring/buffer.h) \ 13 | $(wildcard include/config/tracing.h) \ 14 | $(wildcard include/config/ftrace/mcount/record.h) \ 15 | /usr/lib/gcc/x86_64-linux-gnu/4.8/include/stdarg.h \ 16 | include/linux/linkage.h \ 17 | include/linux/compiler.h \ 18 | $(wildcard include/config/sparse/rcu/pointer.h) \ 19 | $(wildcard include/config/trace/branch/profiling.h) \ 20 | $(wildcard include/config/profile/all/branches.h) \ 21 | $(wildcard include/config/enable/must/check.h) \ 22 | $(wildcard include/config/enable/warn/deprecated.h) \ 23 | $(wildcard include/config/kprobes.h) \ 24 | include/linux/compiler-gcc.h \ 25 | $(wildcard include/config/arch/supports/optimized/inlining.h) \ 26 | $(wildcard include/config/optimize/inlining.h) \ 27 | include/linux/compiler-gcc4.h \ 28 | $(wildcard include/config/arch/use/builtin/bswap.h) \ 29 | include/linux/stringify.h \ 30 | include/linux/export.h \ 31 | $(wildcard include/config/have/underscore/symbol/prefix.h) \ 32 | $(wildcard include/config/modules.h) \ 33 | $(wildcard include/config/modversions.h) \ 34 | $(wildcard include/config/unused/symbols.h) \ 35 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/linkage.h \ 36 | $(wildcard include/config/x86/32.h) \ 37 | $(wildcard include/config/x86/64.h) \ 38 | $(wildcard include/config/x86/alignment/16.h) \ 39 | include/linux/stddef.h \ 40 | include/uapi/linux/stddef.h \ 41 | include/linux/types.h \ 42 | $(wildcard include/config/uid16.h) \ 43 | $(wildcard include/config/arch/dma/addr/t/64bit.h) \ 44 | $(wildcard include/config/phys/addr/t/64bit.h) \ 45 | $(wildcard include/config/64bit.h) \ 46 | include/uapi/linux/types.h \ 47 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/types.h \ 48 | /usr/src/linux-headers-3.11.0-12-generic/include/uapi/asm-generic/types.h \ 49 | include/asm-generic/int-ll64.h \ 50 | include/uapi/asm-generic/int-ll64.h \ 51 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/bitsperlong.h \ 52 | include/asm-generic/bitsperlong.h \ 53 | include/uapi/asm-generic/bitsperlong.h \ 54 | /usr/src/linux-headers-3.11.0-12-generic/include/uapi/linux/posix_types.h \ 55 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/posix_types.h \ 56 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/posix_types_64.h \ 57 | /usr/src/linux-headers-3.11.0-12-generic/include/uapi/asm-generic/posix_types.h \ 58 | include/linux/bitops.h \ 59 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/bitops.h \ 60 | $(wildcard include/config/x86/cmov.h) \ 61 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/alternative.h \ 62 | $(wildcard include/config/smp.h) \ 63 | $(wildcard include/config/paravirt.h) \ 64 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/asm.h \ 65 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/cpufeature.h \ 66 | $(wildcard include/config/x86/debug/static/cpu/has.h) \ 67 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/required-features.h \ 68 | $(wildcard include/config/x86/minimum/cpu/family.h) \ 69 | $(wildcard include/config/math/emulation.h) \ 70 | $(wildcard include/config/x86/pae.h) \ 71 | $(wildcard include/config/x86/cmpxchg64.h) \ 72 | $(wildcard include/config/x86/use/3dnow.h) \ 73 | $(wildcard include/config/x86/p6/nop.h) \ 74 | $(wildcard include/config/matom.h) \ 75 | include/asm-generic/bitops/find.h \ 76 | $(wildcard include/config/generic/find/first/bit.h) \ 77 | include/asm-generic/bitops/sched.h \ 78 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/arch_hweight.h \ 79 | include/asm-generic/bitops/const_hweight.h \ 80 | include/asm-generic/bitops/le.h \ 81 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/byteorder.h \ 82 | include/linux/byteorder/little_endian.h \ 83 | include/uapi/linux/byteorder/little_endian.h \ 84 | include/linux/swab.h \ 85 | include/uapi/linux/swab.h \ 86 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/swab.h \ 87 | include/linux/byteorder/generic.h \ 88 | include/asm-generic/bitops/ext2-atomic-setbit.h \ 89 | include/linux/log2.h \ 90 | $(wildcard include/config/arch/has/ilog2/u32.h) \ 91 | $(wildcard include/config/arch/has/ilog2/u64.h) \ 92 | include/linux/typecheck.h \ 93 | include/linux/printk.h \ 94 | $(wildcard include/config/early/printk.h) \ 95 | $(wildcard include/config/printk.h) \ 96 | $(wildcard include/config/dynamic/debug.h) \ 97 | include/linux/init.h \ 98 | $(wildcard include/config/broken/rodata.h) \ 99 | include/linux/kern_levels.h \ 100 | include/linux/dynamic_debug.h \ 101 | include/uapi/linux/kernel.h \ 102 | /usr/src/linux-headers-3.11.0-12-generic/include/uapi/linux/sysinfo.h \ 103 | include/linux/errno.h \ 104 | include/uapi/linux/errno.h \ 105 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/errno.h \ 106 | /usr/src/linux-headers-3.11.0-12-generic/include/uapi/asm-generic/errno.h \ 107 | /usr/src/linux-headers-3.11.0-12-generic/include/uapi/asm-generic/errno-base.h \ 108 | include/linux/slab.h \ 109 | $(wildcard include/config/slab/debug.h) \ 110 | $(wildcard include/config/debug/objects.h) \ 111 | $(wildcard include/config/kmemcheck.h) \ 112 | $(wildcard include/config/failslab.h) \ 113 | $(wildcard include/config/slob.h) \ 114 | $(wildcard include/config/slab.h) \ 115 | $(wildcard include/config/slub.h) \ 116 | $(wildcard include/config/zone/dma.h) \ 117 | $(wildcard include/config/numa.h) \ 118 | $(wildcard include/config/debug/slab.h) \ 119 | include/linux/gfp.h \ 120 | $(wildcard include/config/highmem.h) \ 121 | $(wildcard include/config/zone/dma32.h) \ 122 | $(wildcard include/config/pm/sleep.h) \ 123 | $(wildcard include/config/cma.h) \ 124 | include/linux/mmzone.h \ 125 | $(wildcard include/config/force/max/zoneorder.h) \ 126 | $(wildcard include/config/memory/isolation.h) \ 127 | $(wildcard include/config/memcg.h) \ 128 | $(wildcard include/config/compaction.h) \ 129 | $(wildcard include/config/memory/hotplug.h) \ 130 | $(wildcard include/config/sparsemem.h) \ 131 | $(wildcard include/config/have/memblock/node/map.h) \ 132 | $(wildcard include/config/discontigmem.h) \ 133 | $(wildcard include/config/flat/node/mem/map.h) \ 134 | $(wildcard include/config/no/bootmem.h) \ 135 | $(wildcard include/config/numa/balancing.h) \ 136 | $(wildcard include/config/have/memory/present.h) \ 137 | $(wildcard include/config/have/memoryless/nodes.h) \ 138 | $(wildcard include/config/need/node/memmap/size.h) \ 139 | $(wildcard include/config/need/multiple/nodes.h) \ 140 | $(wildcard include/config/have/arch/early/pfn/to/nid.h) \ 141 | $(wildcard include/config/flatmem.h) \ 142 | $(wildcard include/config/sparsemem/extreme.h) \ 143 | $(wildcard include/config/have/arch/pfn/valid.h) \ 144 | $(wildcard include/config/nodes/span/other/nodes.h) \ 145 | $(wildcard include/config/holes/in/zone.h) \ 146 | $(wildcard include/config/arch/has/holes/memorymodel.h) \ 147 | include/linux/spinlock.h \ 148 | $(wildcard include/config/debug/spinlock.h) \ 149 | $(wildcard include/config/generic/lockbreak.h) \ 150 | $(wildcard include/config/preempt.h) \ 151 | $(wildcard include/config/debug/lock/alloc.h) \ 152 | include/linux/preempt.h \ 153 | $(wildcard include/config/debug/preempt.h) \ 154 | $(wildcard include/config/preempt/tracer.h) \ 155 | $(wildcard include/config/context/tracking.h) \ 156 | $(wildcard include/config/preempt/count.h) \ 157 | $(wildcard include/config/preempt/notifiers.h) \ 158 | include/linux/thread_info.h \ 159 | $(wildcard include/config/compat.h) \ 160 | $(wildcard include/config/debug/stack/usage.h) \ 161 | include/linux/bug.h \ 162 | $(wildcard include/config/generic/bug.h) \ 163 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/bug.h \ 164 | $(wildcard include/config/bug.h) \ 165 | $(wildcard include/config/debug/bugverbose.h) \ 166 | include/asm-generic/bug.h \ 167 | $(wildcard include/config/generic/bug/relative/pointers.h) \ 168 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/thread_info.h \ 169 | $(wildcard include/config/ia32/emulation.h) \ 170 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/page.h \ 171 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/page_types.h \ 172 | /usr/src/linux-headers-3.11.0-12-generic/include/uapi/linux/const.h \ 173 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/page_64_types.h \ 174 | $(wildcard include/config/physical/start.h) \ 175 | $(wildcard include/config/physical/align.h) \ 176 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/page_64.h \ 177 | $(wildcard include/config/debug/virtual.h) \ 178 | include/linux/range.h \ 179 | include/asm-generic/memory_model.h \ 180 | $(wildcard include/config/sparsemem/vmemmap.h) \ 181 | include/asm-generic/getorder.h \ 182 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/processor.h \ 183 | $(wildcard include/config/x86/vsmp.h) \ 184 | $(wildcard include/config/cc/stackprotector.h) \ 185 | $(wildcard include/config/m486.h) \ 186 | $(wildcard include/config/x86/debugctlmsr.h) \ 187 | $(wildcard include/config/xen.h) \ 188 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/processor-flags.h \ 189 | $(wildcard include/config/vm86.h) \ 190 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/processor-flags.h \ 191 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/vm86.h \ 192 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/ptrace.h \ 193 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/segment.h \ 194 | $(wildcard include/config/x86/32/lazy/gs.h) \ 195 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/cache.h \ 196 | $(wildcard include/config/x86/l1/cache/shift.h) \ 197 | $(wildcard include/config/x86/internode/cache/shift.h) \ 198 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/ptrace.h \ 199 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/ptrace-abi.h \ 200 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/paravirt_types.h \ 201 | $(wildcard include/config/x86/local/apic.h) \ 202 | $(wildcard include/config/paravirt/debug.h) \ 203 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/desc_defs.h \ 204 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/kmap_types.h \ 205 | $(wildcard include/config/debug/highmem.h) \ 206 | include/asm-generic/kmap_types.h \ 207 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/pgtable_types.h \ 208 | $(wildcard include/config/mem/soft/dirty.h) \ 209 | $(wildcard include/config/compat/vdso.h) \ 210 | $(wildcard include/config/proc/fs.h) \ 211 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/pgtable_64_types.h \ 212 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/sparsemem.h \ 213 | include/asm-generic/ptrace.h \ 214 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/vm86.h \ 215 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/math_emu.h \ 216 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/sigcontext.h \ 217 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/sigcontext.h \ 218 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/current.h \ 219 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/percpu.h \ 220 | $(wildcard include/config/x86/64/smp.h) \ 221 | include/asm-generic/percpu.h \ 222 | $(wildcard include/config/have/setup/per/cpu/area.h) \ 223 | include/linux/threads.h \ 224 | $(wildcard include/config/nr/cpus.h) \ 225 | $(wildcard include/config/base/small.h) \ 226 | include/linux/percpu-defs.h \ 227 | $(wildcard include/config/debug/force/weak/per/cpu.h) \ 228 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/msr.h \ 229 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/msr.h \ 230 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/msr-index.h \ 231 | /usr/src/linux-headers-3.11.0-12-generic/include/uapi/linux/ioctl.h \ 232 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/ioctl.h \ 233 | include/asm-generic/ioctl.h \ 234 | include/uapi/asm-generic/ioctl.h \ 235 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/cpumask.h \ 236 | include/linux/cpumask.h \ 237 | $(wildcard include/config/cpumask/offstack.h) \ 238 | $(wildcard include/config/hotplug/cpu.h) \ 239 | $(wildcard include/config/debug/per/cpu/maps.h) \ 240 | $(wildcard include/config/disable/obsolete/cpumask/functions.h) \ 241 | include/linux/bitmap.h \ 242 | include/linux/string.h \ 243 | $(wildcard include/config/binary/printf.h) \ 244 | include/uapi/linux/string.h \ 245 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/string.h \ 246 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/string_64.h \ 247 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/paravirt.h \ 248 | $(wildcard include/config/paravirt/spinlocks.h) \ 249 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/nops.h \ 250 | $(wildcard include/config/mk7.h) \ 251 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/special_insns.h \ 252 | include/linux/personality.h \ 253 | include/uapi/linux/personality.h \ 254 | include/linux/cache.h \ 255 | $(wildcard include/config/arch/has/cache/line/size.h) \ 256 | include/linux/math64.h \ 257 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/div64.h \ 258 | include/asm-generic/div64.h \ 259 | include/linux/err.h \ 260 | include/linux/irqflags.h \ 261 | $(wildcard include/config/trace/irqflags.h) \ 262 | $(wildcard include/config/irqsoff/tracer.h) \ 263 | $(wildcard include/config/trace/irqflags/support.h) \ 264 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/irqflags.h \ 265 | include/linux/atomic.h \ 266 | $(wildcard include/config/arch/has/atomic/or.h) \ 267 | $(wildcard include/config/generic/atomic64.h) \ 268 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/atomic.h \ 269 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/cmpxchg.h \ 270 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/cmpxchg_64.h \ 271 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/atomic64_64.h \ 272 | include/asm-generic/atomic-long.h \ 273 | include/linux/list.h \ 274 | $(wildcard include/config/debug/list.h) \ 275 | include/linux/poison.h \ 276 | $(wildcard include/config/illegal/pointer/value.h) \ 277 | include/linux/bottom_half.h \ 278 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/barrier.h \ 279 | $(wildcard include/config/x86/ppro/fence.h) \ 280 | $(wildcard include/config/x86/oostore.h) \ 281 | include/linux/spinlock_types.h \ 282 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/spinlock_types.h \ 283 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/rwlock.h \ 284 | include/linux/lockdep.h \ 285 | $(wildcard include/config/lockdep.h) \ 286 | $(wildcard include/config/lock/stat.h) \ 287 | $(wildcard include/config/prove/rcu.h) \ 288 | include/linux/rwlock_types.h \ 289 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/spinlock.h \ 290 | include/linux/rwlock.h \ 291 | include/linux/spinlock_api_smp.h \ 292 | $(wildcard include/config/inline/spin/lock.h) \ 293 | $(wildcard include/config/inline/spin/lock/bh.h) \ 294 | $(wildcard include/config/inline/spin/lock/irq.h) \ 295 | $(wildcard include/config/inline/spin/lock/irqsave.h) \ 296 | $(wildcard include/config/inline/spin/trylock.h) \ 297 | $(wildcard include/config/inline/spin/trylock/bh.h) \ 298 | $(wildcard include/config/uninline/spin/unlock.h) \ 299 | $(wildcard include/config/inline/spin/unlock/bh.h) \ 300 | $(wildcard include/config/inline/spin/unlock/irq.h) \ 301 | $(wildcard include/config/inline/spin/unlock/irqrestore.h) \ 302 | include/linux/rwlock_api_smp.h \ 303 | $(wildcard include/config/inline/read/lock.h) \ 304 | $(wildcard include/config/inline/write/lock.h) \ 305 | $(wildcard include/config/inline/read/lock/bh.h) \ 306 | $(wildcard include/config/inline/write/lock/bh.h) \ 307 | $(wildcard include/config/inline/read/lock/irq.h) \ 308 | $(wildcard include/config/inline/write/lock/irq.h) \ 309 | $(wildcard include/config/inline/read/lock/irqsave.h) \ 310 | $(wildcard include/config/inline/write/lock/irqsave.h) \ 311 | $(wildcard include/config/inline/read/trylock.h) \ 312 | $(wildcard include/config/inline/write/trylock.h) \ 313 | $(wildcard include/config/inline/read/unlock.h) \ 314 | $(wildcard include/config/inline/write/unlock.h) \ 315 | $(wildcard include/config/inline/read/unlock/bh.h) \ 316 | $(wildcard include/config/inline/write/unlock/bh.h) \ 317 | $(wildcard include/config/inline/read/unlock/irq.h) \ 318 | $(wildcard include/config/inline/write/unlock/irq.h) \ 319 | $(wildcard include/config/inline/read/unlock/irqrestore.h) \ 320 | $(wildcard include/config/inline/write/unlock/irqrestore.h) \ 321 | include/linux/wait.h \ 322 | include/uapi/linux/wait.h \ 323 | include/linux/numa.h \ 324 | $(wildcard include/config/nodes/shift.h) \ 325 | include/linux/seqlock.h \ 326 | include/linux/nodemask.h \ 327 | $(wildcard include/config/movable/node.h) \ 328 | include/linux/pageblock-flags.h \ 329 | $(wildcard include/config/hugetlb/page.h) \ 330 | $(wildcard include/config/hugetlb/page/size/variable.h) \ 331 | include/linux/page-flags-layout.h \ 332 | include/generated/bounds.h \ 333 | include/linux/memory_hotplug.h \ 334 | $(wildcard include/config/memory/hotremove.h) \ 335 | $(wildcard include/config/have/arch/nodedata/extension.h) \ 336 | $(wildcard include/config/have/bootmem/info/node.h) \ 337 | include/linux/notifier.h \ 338 | include/linux/mutex.h \ 339 | $(wildcard include/config/debug/mutexes.h) \ 340 | $(wildcard include/config/mutex/spin/on/owner.h) \ 341 | $(wildcard include/config/have/arch/mutex/cpu/relax.h) \ 342 | include/linux/rwsem.h \ 343 | $(wildcard include/config/rwsem/generic/spinlock.h) \ 344 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/rwsem.h \ 345 | include/linux/srcu.h \ 346 | include/linux/rcupdate.h \ 347 | $(wildcard include/config/rcu/torture/test.h) \ 348 | $(wildcard include/config/tree/rcu.h) \ 349 | $(wildcard include/config/tree/preempt/rcu.h) \ 350 | $(wildcard include/config/rcu/trace.h) \ 351 | $(wildcard include/config/preempt/rcu.h) \ 352 | $(wildcard include/config/rcu/user/qs.h) \ 353 | $(wildcard include/config/tiny/rcu.h) \ 354 | $(wildcard include/config/debug/objects/rcu/head.h) \ 355 | $(wildcard include/config/rcu/nocb/cpu.h) \ 356 | include/linux/completion.h \ 357 | include/linux/debugobjects.h \ 358 | $(wildcard include/config/debug/objects/free.h) \ 359 | include/linux/rcutree.h \ 360 | include/linux/workqueue.h \ 361 | $(wildcard include/config/debug/objects/work.h) \ 362 | $(wildcard include/config/freezer.h) \ 363 | $(wildcard include/config/sysfs.h) \ 364 | include/linux/timer.h \ 365 | $(wildcard include/config/timer/stats.h) \ 366 | $(wildcard include/config/debug/objects/timers.h) \ 367 | include/linux/ktime.h \ 368 | $(wildcard include/config/ktime/scalar.h) \ 369 | include/linux/time.h \ 370 | $(wildcard include/config/arch/uses/gettimeoffset.h) \ 371 | include/uapi/linux/time.h \ 372 | include/linux/jiffies.h \ 373 | include/linux/timex.h \ 374 | include/uapi/linux/timex.h \ 375 | /usr/src/linux-headers-3.11.0-12-generic/include/uapi/linux/param.h \ 376 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/param.h \ 377 | include/asm-generic/param.h \ 378 | $(wildcard include/config/hz.h) \ 379 | include/uapi/asm-generic/param.h \ 380 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/timex.h \ 381 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/tsc.h \ 382 | $(wildcard include/config/x86/tsc.h) \ 383 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/mmzone.h \ 384 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/mmzone_64.h \ 385 | include/linux/mmdebug.h \ 386 | $(wildcard include/config/debug/vm.h) \ 387 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/smp.h \ 388 | $(wildcard include/config/x86/io/apic.h) \ 389 | $(wildcard include/config/x86/32/smp.h) \ 390 | $(wildcard include/config/debug/nmi/selftest.h) \ 391 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/mpspec.h \ 392 | $(wildcard include/config/x86/numaq.h) \ 393 | $(wildcard include/config/eisa.h) \ 394 | $(wildcard include/config/x86/mpparse.h) \ 395 | $(wildcard include/config/acpi.h) \ 396 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/mpspec_def.h \ 397 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/x86_init.h \ 398 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/bootparam.h \ 399 | include/linux/screen_info.h \ 400 | include/uapi/linux/screen_info.h \ 401 | include/linux/apm_bios.h \ 402 | include/uapi/linux/apm_bios.h \ 403 | include/linux/edd.h \ 404 | include/uapi/linux/edd.h \ 405 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/e820.h \ 406 | $(wildcard include/config/efi.h) \ 407 | $(wildcard include/config/hibernation.h) \ 408 | $(wildcard include/config/memtest.h) \ 409 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/e820.h \ 410 | $(wildcard include/config/intel/txt.h) \ 411 | include/linux/ioport.h \ 412 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/ist.h \ 413 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/ist.h \ 414 | include/video/edid.h \ 415 | $(wildcard include/config/x86.h) \ 416 | include/uapi/video/edid.h \ 417 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/apicdef.h \ 418 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/apic.h \ 419 | $(wildcard include/config/x86/x2apic.h) \ 420 | include/linux/pm.h \ 421 | $(wildcard include/config/vt/console/sleep.h) \ 422 | $(wildcard include/config/pm.h) \ 423 | $(wildcard include/config/pm/runtime.h) \ 424 | $(wildcard include/config/pm/clk.h) \ 425 | $(wildcard include/config/pm/generic/domains.h) \ 426 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/fixmap.h \ 427 | $(wildcard include/config/paravirt/clock.h) \ 428 | $(wildcard include/config/provide/ohci1394/dma/init.h) \ 429 | $(wildcard include/config/x86/visws/apic.h) \ 430 | $(wildcard include/config/pci/mmconfig.h) \ 431 | $(wildcard include/config/x86/intel/mid.h) \ 432 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/acpi.h \ 433 | $(wildcard include/config/acpi/numa.h) \ 434 | include/acpi/pdc_intel.h \ 435 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/numa.h \ 436 | $(wildcard include/config/numa/emu.h) \ 437 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/topology.h \ 438 | $(wildcard include/config/x86/ht.h) \ 439 | include/asm-generic/topology.h \ 440 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/mmu.h \ 441 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/realmode.h \ 442 | $(wildcard include/config/acpi/sleep.h) \ 443 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/io.h \ 444 | $(wildcard include/config/mtrr.h) \ 445 | include/asm-generic/iomap.h \ 446 | $(wildcard include/config/has/ioport.h) \ 447 | $(wildcard include/config/pci.h) \ 448 | $(wildcard include/config/generic/iomap.h) \ 449 | include/asm-generic/pci_iomap.h \ 450 | $(wildcard include/config/no/generic/pci/ioport/map.h) \ 451 | $(wildcard include/config/generic/pci/iomap.h) \ 452 | include/linux/vmalloc.h \ 453 | $(wildcard include/config/mmu.h) \ 454 | include/linux/rbtree.h \ 455 | include/xen/xen.h \ 456 | $(wildcard include/config/xen/dom0.h) \ 457 | include/xen/interface/xen.h \ 458 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/xen/interface.h \ 459 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/xen/interface_64.h \ 460 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/pvclock-abi.h \ 461 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/xen/hypervisor.h \ 462 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/pvclock.h \ 463 | include/linux/clocksource.h \ 464 | $(wildcard include/config/arch/clocksource/data.h) \ 465 | $(wildcard include/config/clocksource/watchdog.h) \ 466 | $(wildcard include/config/clksrc/of.h) \ 467 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/clocksource.h \ 468 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/vsyscall.h \ 469 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/vsyscall.h \ 470 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/vvar.h \ 471 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/idle.h \ 472 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/io_apic.h \ 473 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/irq_vectors.h \ 474 | $(wildcard include/config/have/kvm.h) \ 475 | include/linux/topology.h \ 476 | $(wildcard include/config/sched/smt.h) \ 477 | $(wildcard include/config/sched/mc.h) \ 478 | $(wildcard include/config/sched/book.h) \ 479 | $(wildcard include/config/use/percpu/numa/node/id.h) \ 480 | include/linux/smp.h \ 481 | $(wildcard include/config/use/generic/smp/helpers.h) \ 482 | include/linux/percpu.h \ 483 | $(wildcard include/config/need/per/cpu/embed/first/chunk.h) \ 484 | $(wildcard include/config/need/per/cpu/page/first/chunk.h) \ 485 | include/linux/pfn.h \ 486 | include/linux/slub_def.h \ 487 | $(wildcard include/config/slub/stats.h) \ 488 | $(wildcard include/config/memcg/kmem.h) \ 489 | $(wildcard include/config/slub/debug.h) \ 490 | include/linux/kobject.h \ 491 | include/linux/sysfs.h \ 492 | include/linux/kobject_ns.h \ 493 | include/linux/stat.h \ 494 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/stat.h \ 495 | include/uapi/linux/stat.h \ 496 | include/linux/uidgid.h \ 497 | $(wildcard include/config/uidgid/strict/type/checks.h) \ 498 | $(wildcard include/config/user/ns.h) \ 499 | include/linux/highuid.h \ 500 | include/linux/kref.h \ 501 | include/linux/kmemleak.h \ 502 | $(wildcard include/config/debug/kmemleak.h) \ 503 | include/linux/tty.h \ 504 | $(wildcard include/config/tty.h) \ 505 | $(wildcard include/config/audit.h) \ 506 | include/linux/fs.h \ 507 | $(wildcard include/config/fs/posix/acl.h) \ 508 | $(wildcard include/config/security.h) \ 509 | $(wildcard include/config/quota.h) \ 510 | $(wildcard include/config/fsnotify.h) \ 511 | $(wildcard include/config/ima.h) \ 512 | $(wildcard include/config/epoll.h) \ 513 | $(wildcard include/config/debug/writecount.h) \ 514 | $(wildcard include/config/file/locking.h) \ 515 | $(wildcard include/config/auditsyscall.h) \ 516 | $(wildcard include/config/block.h) \ 517 | $(wildcard include/config/fs/xip.h) \ 518 | $(wildcard include/config/migration.h) \ 519 | include/linux/kdev_t.h \ 520 | include/uapi/linux/kdev_t.h \ 521 | include/linux/dcache.h \ 522 | include/linux/rculist.h \ 523 | include/linux/rculist_bl.h \ 524 | include/linux/list_bl.h \ 525 | include/linux/bit_spinlock.h \ 526 | include/linux/lockref.h \ 527 | include/linux/path.h \ 528 | include/linux/llist.h \ 529 | $(wildcard include/config/arch/have/nmi/safe/cmpxchg.h) \ 530 | include/linux/radix-tree.h \ 531 | include/linux/pid.h \ 532 | include/linux/capability.h \ 533 | include/uapi/linux/capability.h \ 534 | include/linux/semaphore.h \ 535 | /usr/src/linux-headers-3.11.0-12-generic/include/uapi/linux/fiemap.h \ 536 | include/linux/shrinker.h \ 537 | include/linux/migrate_mode.h \ 538 | include/linux/percpu-rwsem.h \ 539 | include/linux/blk_types.h \ 540 | $(wildcard include/config/blk/cgroup.h) \ 541 | $(wildcard include/config/blk/dev/integrity.h) \ 542 | include/uapi/linux/fs.h \ 543 | /usr/src/linux-headers-3.11.0-12-generic/include/uapi/linux/limits.h \ 544 | include/linux/quota.h \ 545 | $(wildcard include/config/quota/netlink/interface.h) \ 546 | include/linux/percpu_counter.h \ 547 | /usr/src/linux-headers-3.11.0-12-generic/include/uapi/linux/dqblk_xfs.h \ 548 | include/linux/dqblk_v1.h \ 549 | include/linux/dqblk_v2.h \ 550 | include/linux/dqblk_qtree.h \ 551 | include/linux/projid.h \ 552 | include/uapi/linux/quota.h \ 553 | include/linux/nfs_fs_i.h \ 554 | include/linux/fcntl.h \ 555 | include/uapi/linux/fcntl.h \ 556 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/fcntl.h \ 557 | /usr/src/linux-headers-3.11.0-12-generic/include/uapi/asm-generic/fcntl.h \ 558 | /usr/src/linux-headers-3.11.0-12-generic/include/uapi/linux/major.h \ 559 | /usr/src/linux-headers-3.11.0-12-generic/include/uapi/linux/termios.h \ 560 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/termios.h \ 561 | include/asm-generic/termios.h \ 562 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/uaccess.h \ 563 | $(wildcard include/config/x86/intel/usercopy.h) \ 564 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/smap.h \ 565 | $(wildcard include/config/x86/smap.h) \ 566 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/uaccess_64.h \ 567 | include/uapi/asm-generic/termios.h \ 568 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/termbits.h \ 569 | /usr/src/linux-headers-3.11.0-12-generic/include/uapi/asm-generic/termbits.h \ 570 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/ioctls.h \ 571 | /usr/src/linux-headers-3.11.0-12-generic/include/uapi/asm-generic/ioctls.h \ 572 | include/linux/tty_driver.h \ 573 | $(wildcard include/config/console/poll.h) \ 574 | include/linux/cdev.h \ 575 | include/linux/tty_ldisc.h \ 576 | /usr/src/linux-headers-3.11.0-12-generic/include/uapi/linux/tty_flags.h \ 577 | include/uapi/linux/tty.h \ 578 | include/linux/tty_flip.h \ 579 | include/linux/serial.h \ 580 | include/uapi/linux/serial.h \ 581 | include/linux/module.h \ 582 | $(wildcard include/config/module/sig.h) \ 583 | $(wildcard include/config/kallsyms.h) \ 584 | $(wildcard include/config/tracepoints.h) \ 585 | $(wildcard include/config/event/tracing.h) \ 586 | $(wildcard include/config/module/unload.h) \ 587 | $(wildcard include/config/constructors.h) \ 588 | $(wildcard include/config/debug/set/module/ronx.h) \ 589 | include/linux/kmod.h \ 590 | include/linux/sysctl.h \ 591 | $(wildcard include/config/sysctl.h) \ 592 | include/uapi/linux/sysctl.h \ 593 | include/linux/elf.h \ 594 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/elf.h \ 595 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/user.h \ 596 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/user_64.h \ 597 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/auxvec.h \ 598 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/vdso.h \ 599 | include/uapi/linux/elf.h \ 600 | /usr/src/linux-headers-3.11.0-12-generic/include/uapi/linux/elf-em.h \ 601 | include/linux/moduleparam.h \ 602 | $(wildcard include/config/alpha.h) \ 603 | $(wildcard include/config/ia64.h) \ 604 | $(wildcard include/config/ppc64.h) \ 605 | include/linux/tracepoint.h \ 606 | include/linux/static_key.h \ 607 | include/linux/jump_label.h \ 608 | $(wildcard include/config/jump/label.h) \ 609 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/jump_label.h \ 610 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/module.h \ 611 | $(wildcard include/config/m586.h) \ 612 | $(wildcard include/config/m586tsc.h) \ 613 | $(wildcard include/config/m586mmx.h) \ 614 | $(wildcard include/config/mcore2.h) \ 615 | $(wildcard include/config/m686.h) \ 616 | $(wildcard include/config/mpentiumii.h) \ 617 | $(wildcard include/config/mpentiumiii.h) \ 618 | $(wildcard include/config/mpentiumm.h) \ 619 | $(wildcard include/config/mpentium4.h) \ 620 | $(wildcard include/config/mk6.h) \ 621 | $(wildcard include/config/mk8.h) \ 622 | $(wildcard include/config/melan.h) \ 623 | $(wildcard include/config/mcrusoe.h) \ 624 | $(wildcard include/config/mefficeon.h) \ 625 | $(wildcard include/config/mwinchipc6.h) \ 626 | $(wildcard include/config/mwinchip3d.h) \ 627 | $(wildcard include/config/mcyrixiii.h) \ 628 | $(wildcard include/config/mviac3/2.h) \ 629 | $(wildcard include/config/mviac7.h) \ 630 | $(wildcard include/config/mgeodegx1.h) \ 631 | $(wildcard include/config/mgeode/lx.h) \ 632 | include/asm-generic/module.h \ 633 | $(wildcard include/config/have/mod/arch/specific.h) \ 634 | $(wildcard include/config/modules/use/elf/rel.h) \ 635 | $(wildcard include/config/modules/use/elf/rela.h) \ 636 | include/linux/usb.h \ 637 | $(wildcard include/config/usb/mon.h) \ 638 | include/linux/mod_devicetable.h \ 639 | include/linux/uuid.h \ 640 | include/uapi/linux/uuid.h \ 641 | include/linux/usb/ch9.h \ 642 | include/uapi/linux/usb/ch9.h \ 643 | $(wildcard include/config/size.h) \ 644 | $(wildcard include/config/att/one.h) \ 645 | $(wildcard include/config/att/selfpower.h) \ 646 | $(wildcard include/config/att/wakeup.h) \ 647 | $(wildcard include/config/att/battery.h) \ 648 | include/linux/delay.h \ 649 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/delay.h \ 650 | include/asm-generic/delay.h \ 651 | include/linux/interrupt.h \ 652 | $(wildcard include/config/generic/hardirqs.h) \ 653 | $(wildcard include/config/irq/forced/threading.h) \ 654 | $(wildcard include/config/generic/irq/probe.h) \ 655 | include/linux/irqreturn.h \ 656 | include/linux/irqnr.h \ 657 | include/uapi/linux/irqnr.h \ 658 | include/linux/hardirq.h \ 659 | include/linux/ftrace_irq.h \ 660 | $(wildcard include/config/ftrace/nmi/enter.h) \ 661 | include/linux/vtime.h \ 662 | $(wildcard include/config/virt/cpu/accounting.h) \ 663 | $(wildcard include/config/virt/cpu/accounting/native.h) \ 664 | $(wildcard include/config/virt/cpu/accounting/gen.h) \ 665 | $(wildcard include/config/irq/time/accounting.h) \ 666 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/hardirq.h \ 667 | $(wildcard include/config/x86/thermal/vector.h) \ 668 | $(wildcard include/config/x86/mce/threshold.h) \ 669 | include/linux/irq.h \ 670 | $(wildcard include/config/generic/pending/irq.h) \ 671 | $(wildcard include/config/hardirqs/sw/resend.h) \ 672 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/irq.h \ 673 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/irq_regs.h \ 674 | include/linux/irqdesc.h \ 675 | $(wildcard include/config/irq/preflow/fasteoi.h) \ 676 | $(wildcard include/config/sparse/irq.h) \ 677 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/hw_irq.h \ 678 | $(wildcard include/config/irq/remap.h) \ 679 | include/linux/profile.h \ 680 | $(wildcard include/config/profiling.h) \ 681 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/sections.h \ 682 | $(wildcard include/config/debug/rodata.h) \ 683 | include/asm-generic/sections.h \ 684 | include/linux/hrtimer.h \ 685 | $(wildcard include/config/high/res/timers.h) \ 686 | $(wildcard include/config/timerfd.h) \ 687 | include/linux/timerqueue.h \ 688 | include/linux/device.h \ 689 | $(wildcard include/config/debug/devres.h) \ 690 | $(wildcard include/config/pinctrl.h) \ 691 | $(wildcard include/config/devtmpfs.h) \ 692 | $(wildcard include/config/sysfs/deprecated.h) \ 693 | include/linux/klist.h \ 694 | include/linux/pinctrl/devinfo.h \ 695 | include/linux/ratelimit.h \ 696 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/device.h \ 697 | $(wildcard include/config/x86/dev/dma/ops.h) \ 698 | $(wildcard include/config/intel/iommu.h) \ 699 | $(wildcard include/config/amd/iommu.h) \ 700 | include/linux/pm_wakeup.h \ 701 | include/linux/sched.h \ 702 | $(wildcard include/config/sched/debug.h) \ 703 | $(wildcard include/config/no/hz/common.h) \ 704 | $(wildcard include/config/lockup/detector.h) \ 705 | $(wildcard include/config/core/dump/default/elf/headers.h) \ 706 | $(wildcard include/config/sched/autogroup.h) \ 707 | $(wildcard include/config/bsd/process/acct.h) \ 708 | $(wildcard include/config/taskstats.h) \ 709 | $(wildcard include/config/cgroups.h) \ 710 | $(wildcard include/config/inotify/user.h) \ 711 | $(wildcard include/config/fanotify.h) \ 712 | $(wildcard include/config/posix/mqueue.h) \ 713 | $(wildcard include/config/keys.h) \ 714 | $(wildcard include/config/perf/events.h) \ 715 | $(wildcard include/config/schedstats.h) \ 716 | $(wildcard include/config/task/delay/acct.h) \ 717 | $(wildcard include/config/fair/group/sched.h) \ 718 | $(wildcard include/config/rt/group/sched.h) \ 719 | $(wildcard include/config/cgroup/sched.h) \ 720 | $(wildcard include/config/blk/dev/io/trace.h) \ 721 | $(wildcard include/config/rcu/boost.h) \ 722 | $(wildcard include/config/compat/brk.h) \ 723 | $(wildcard include/config/sysvipc.h) \ 724 | $(wildcard include/config/detect/hung/task.h) \ 725 | $(wildcard include/config/rt/mutexes.h) \ 726 | $(wildcard include/config/task/xacct.h) \ 727 | $(wildcard include/config/cpusets.h) \ 728 | $(wildcard include/config/futex.h) \ 729 | $(wildcard include/config/fault/injection.h) \ 730 | $(wildcard include/config/latencytop.h) \ 731 | $(wildcard include/config/function/graph/tracer.h) \ 732 | $(wildcard include/config/uprobes.h) \ 733 | $(wildcard include/config/bcache.h) \ 734 | $(wildcard include/config/have/unstable/sched/clock.h) \ 735 | $(wildcard include/config/no/hz/full.h) \ 736 | $(wildcard include/config/stack/growsup.h) \ 737 | $(wildcard include/config/mm/owner.h) \ 738 | include/uapi/linux/sched.h \ 739 | include/linux/mm_types.h \ 740 | $(wildcard include/config/split/ptlock/cpus.h) \ 741 | $(wildcard include/config/have/cmpxchg/double.h) \ 742 | $(wildcard include/config/have/aligned/struct/page.h) \ 743 | $(wildcard include/config/want/page/debug/flags.h) \ 744 | $(wildcard include/config/aio.h) \ 745 | $(wildcard include/config/mmu/notifier.h) \ 746 | $(wildcard include/config/transparent/hugepage.h) \ 747 | include/linux/auxvec.h \ 748 | include/uapi/linux/auxvec.h \ 749 | include/linux/page-debug-flags.h \ 750 | $(wildcard include/config/page/poisoning.h) \ 751 | $(wildcard include/config/page/guard.h) \ 752 | $(wildcard include/config/page/debug/something/else.h) \ 753 | include/linux/uprobes.h \ 754 | $(wildcard include/config/arch/supports/uprobes.h) \ 755 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/uprobes.h \ 756 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/cputime.h \ 757 | include/asm-generic/cputime.h \ 758 | include/asm-generic/cputime_nsecs.h \ 759 | include/linux/sem.h \ 760 | include/uapi/linux/sem.h \ 761 | include/linux/ipc.h \ 762 | include/uapi/linux/ipc.h \ 763 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/ipcbuf.h \ 764 | /usr/src/linux-headers-3.11.0-12-generic/include/uapi/asm-generic/ipcbuf.h \ 765 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/sembuf.h \ 766 | include/linux/signal.h \ 767 | $(wildcard include/config/old/sigaction.h) \ 768 | include/uapi/linux/signal.h \ 769 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/signal.h \ 770 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/signal.h \ 771 | /usr/src/linux-headers-3.11.0-12-generic/include/uapi/asm-generic/signal-defs.h \ 772 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/siginfo.h \ 773 | include/asm-generic/siginfo.h \ 774 | include/uapi/asm-generic/siginfo.h \ 775 | include/linux/proportions.h \ 776 | include/linux/seccomp.h \ 777 | $(wildcard include/config/seccomp.h) \ 778 | $(wildcard include/config/seccomp/filter.h) \ 779 | include/uapi/linux/seccomp.h \ 780 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/seccomp.h \ 781 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/seccomp_64.h \ 782 | /usr/src/linux-headers-3.11.0-12-generic/include/uapi/linux/unistd.h \ 783 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/unistd.h \ 784 | $(wildcard include/config/x86/x32/abi.h) \ 785 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/unistd.h \ 786 | arch/x86/include/generated/uapi/asm/unistd_64.h \ 787 | arch/x86/include/generated/asm/unistd_64_x32.h \ 788 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/ia32_unistd.h \ 789 | arch/x86/include/generated/asm/unistd_32_ia32.h \ 790 | include/linux/rtmutex.h \ 791 | $(wildcard include/config/debug/rt/mutexes.h) \ 792 | include/linux/plist.h \ 793 | $(wildcard include/config/debug/pi/list.h) \ 794 | include/linux/resource.h \ 795 | include/uapi/linux/resource.h \ 796 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/uapi/asm/resource.h \ 797 | include/asm-generic/resource.h \ 798 | include/uapi/asm-generic/resource.h \ 799 | include/linux/task_io_accounting.h \ 800 | $(wildcard include/config/task/io/accounting.h) \ 801 | include/linux/latencytop.h \ 802 | include/linux/cred.h \ 803 | $(wildcard include/config/debug/credentials.h) \ 804 | include/linux/key.h \ 805 | include/linux/selinux.h \ 806 | $(wildcard include/config/security/selinux.h) \ 807 | include/linux/pm_runtime.h \ 808 | include/linux/usb/serial.h \ 809 | $(wildcard include/config/usb/serial/console.h) \ 810 | include/linux/sysrq.h \ 811 | $(wildcard include/config/magic/sysrq.h) \ 812 | include/linux/kfifo.h \ 813 | include/linux/scatterlist.h \ 814 | $(wildcard include/config/debug/sg.h) \ 815 | include/linux/mm.h \ 816 | $(wildcard include/config/ppc.h) \ 817 | $(wildcard include/config/parisc.h) \ 818 | $(wildcard include/config/metag.h) \ 819 | $(wildcard include/config/ksm.h) \ 820 | $(wildcard include/config/debug/vm/rb.h) \ 821 | $(wildcard include/config/arch/uses/numa/prot/none.h) \ 822 | $(wildcard include/config/debug/pagealloc.h) \ 823 | $(wildcard include/config/hugetlbfs.h) \ 824 | include/linux/debug_locks.h \ 825 | $(wildcard include/config/debug/locking/api/selftests.h) \ 826 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/pgtable.h \ 827 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/pgtable_64.h \ 828 | include/asm-generic/pgtable.h \ 829 | $(wildcard include/config/have/arch/soft/dirty.h) \ 830 | include/linux/page-flags.h \ 831 | $(wildcard include/config/pageflags/extended.h) \ 832 | $(wildcard include/config/arch/uses/pg/uncached.h) \ 833 | $(wildcard include/config/memory/failure.h) \ 834 | $(wildcard include/config/swap.h) \ 835 | include/linux/huge_mm.h \ 836 | include/linux/vmstat.h \ 837 | $(wildcard include/config/vm/event/counters.h) \ 838 | include/linux/vm_event_item.h \ 839 | /usr/src/linux-headers-3.11.0-12-generic/arch/x86/include/asm/scatterlist.h \ 840 | include/asm-generic/scatterlist.h \ 841 | $(wildcard include/config/need/sg/dma/length.h) \ 842 | 843 | /media/d/A8C0-05DE/arduino/ch340g/ch34x.o: $(deps_/media/d/A8C0-05DE/arduino/ch340g/ch34x.o) 844 | 845 | $(deps_/media/d/A8C0-05DE/arduino/ch340g/ch34x.o): 846 | --------------------------------------------------------------------------------