Compare commits
	
		
			443 Commits
		
	
	
		
			kernel5.10
			...
			v17.01.2
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 2da512ecf4 | ||
|   | 65eec8bd5f | ||
|   | 4053c4f0fe | ||
|   | e5db08edf7 | ||
|   | 8a42d4d851 | ||
|   | f709597e81 | ||
|   | df4363b607 | ||
|   | 4fbd072624 | ||
|   | 443d705e38 | ||
|   | 524ed5088e | ||
|   | bf6216e5e3 | ||
|   | 36ccbbdab1 | ||
|   | 4186d737f6 | ||
|   | 254bf7961e | ||
|   | b78bcdf619 | ||
|   | e78a641f52 | ||
|   | cdfc6788a9 | ||
|   | 9e20cc56b9 | ||
|   | ebf46d2c5b | ||
|   | 78edfff530 | ||
|   | b1257d8d73 | ||
|   | 21a7e40941 | ||
|   | a412350684 | ||
|   | dfecce60e6 | ||
|   | fe5e343933 | ||
|   | 4baf0ea229 | ||
|   | 7c1e58863c | ||
|   | 22478bf473 | ||
|   | 757353c3a0 | ||
|   | 4bd3b8f8b0 | ||
|   | e194e1b3c8 | ||
|   | 20198f7330 | ||
|   | 784ceba269 | ||
|   | 0e31ce730f | ||
|   | a44d7bfb63 | ||
|   | e02b12c4cf | ||
|   | 2f92622ce8 | ||
|   | 9c2bd3d631 | ||
|   | 215c1d05b8 | ||
|   | d1a0fc3ec8 | ||
|   | d179aa8769 | ||
|   | dd19a41520 | ||
|   | 51db1f5a9a | ||
|   | 1165c0ae0d | ||
|   | 74100f3788 | ||
|   | dfe2cea9cd | ||
|   | 0bef8f8011 | ||
|   | 379155dc0f | ||
|   | dbaaeae428 | ||
|   | 4bd98e9224 | ||
|   | 9423cf3e98 | ||
|   | 38367c5699 | ||
|   | da4992f822 | ||
|   | 8011215ad2 | ||
|   | aba1b3cbd1 | ||
|   | 53e751e303 | ||
|   | d40e2efa94 | ||
|   | 98491a9ae9 | ||
|   | bc58099802 | ||
|   | 7f3ec01069 | ||
|   | d8cfebaa50 | ||
|   | d1e0cc8cd5 | ||
|   | 8619683037 | ||
|   | d90ff22c8c | ||
|   | d49920e450 | ||
|   | 79cd14152c | ||
|   | bc0de2751c | ||
|   | 0c8f72639f | ||
|   | eb11207397 | ||
|   | 64fa4ead32 | ||
|   | 820a39687d | ||
|   | 5b91d2b52e | ||
|   | ab7087e24f | ||
|   | 4314646ac6 | ||
|   | ceefe616c8 | ||
|   | 5ac51ada60 | ||
|   | a9728799bc | ||
|   | 503e496366 | ||
|   | c266641acf | ||
|   | 37cf921352 | ||
|   | 8b9f7bd7bd | ||
|   | bf534e45ea | ||
|   | 105d5b6f03 | ||
|   | 49ce6d04b0 | ||
|   | 58ec566331 | ||
|   | 7e2ad9cbb8 | ||
|   | 88cc06abb7 | ||
|   | f1f0b92a79 | ||
|   | 6aa0a85fc6 | ||
|   | e200c66a1a | ||
|   | 28d626556d | ||
|   | fd693bc0e8 | ||
|   | 5b2624d618 | ||
|   | a66623639a | ||
|   | 0405851eb2 | ||
|   | a12655a840 | ||
|   | 94948252e2 | ||
|   | 85bca2d0fb | ||
|   | 1aee42c6a9 | ||
|   | 846457fdbf | ||
|   | 7ee09377e7 | ||
|   | 0f3c2d031a | ||
|   | 26f07f668a | ||
|   | dbd2212205 | ||
|   | ae0e167f2b | ||
|   | fe0b171372 | ||
|   | a2ee9b7068 | ||
|   | af1d1ebdda | ||
|   | 3bfe7ee632 | ||
|   | 2bc8d5eaf1 | ||
|   | 1ab41265c3 | ||
|   | 1d1935b242 | ||
|   | 9117ef8d6a | ||
|   | 72fcdb6286 | ||
|   | 5feb4f0e6d | ||
|   | 449880e0ff | ||
|   | 9437fbb7ab | ||
|   | 3ff31f8a78 | ||
|   | ad145e03cc | ||
|   | 3dbc4175a8 | ||
|   | 7eb58cf109 | ||
|   | 1d76542cca | ||
|   | 6ca5ccc620 | ||
|   | c2999ef592 | ||
|   | a532aaa2aa | ||
|   | 425c6d0462 | ||
|   | f2f672c32c | ||
|   | f3dc2ffdd4 | ||
|   | caaa214eae | ||
|   | 0faf921a01 | ||
|   | f2a3653882 | ||
|   | c6e79980b8 | ||
|   | 5866ff8be8 | ||
|   | 293c54c567 | ||
|   | 5aa97e35de | ||
|   | 7099bb19b5 | ||
|   | 53fcaed1f7 | ||
|   | 638ca50f3b | ||
|   | 47bf110cbb | ||
|   | a49503bbc7 | ||
|   | 1bdd23231b | ||
|   | 0cb669b469 | ||
|   | 0dcc4d239d | ||
|   | 1adc6db036 | ||
|   | 298c40fd34 | ||
|   | 910a9430a0 | ||
|   | 1b94737824 | ||
|   | 0d304d4228 | ||
|   | 474c31a20d | ||
|   | ba076ebbc5 | ||
|   | 0f23e80c27 | ||
|   | 111cf1b9f3 | ||
|   | c4ed92ae7d | ||
|   | 7d70ad66ac | ||
|   | 7ae68124a4 | ||
|   | fc90e87b65 | ||
|   | c03083339a | ||
|   | 9d84accea1 | ||
|   | 1bba5789af | ||
|   | 0eed4a61b9 | ||
|   | 4a405ac8f9 | ||
|   | e091e8951d | ||
|   | 8b52a8906b | ||
|   | b3ba3764d0 | ||
|   | f8e08ffd94 | ||
|   | 20a2db83de | ||
|   | 09a8183ce8 | ||
|   | 514854d636 | ||
|   | 0c05cadeb7 | ||
|   | f4fc12f023 | ||
|   | 21903d056e | ||
|   | f0e8470aa9 | ||
|   | 1b2a54b5cd | ||
|   | 3d52251df4 | ||
|   | df041b6520 | ||
|   | 87e021e6e3 | ||
|   | 2e67e8c90f | ||
|   | 657e3ce8a2 | ||
|   | 0f2757dce4 | ||
|   | 2e8545333a | ||
|   | e3021e0308 | ||
|   | b036a22fcc | ||
|   | fffabd3c44 | ||
|   | 2d5f8eb067 | ||
|   | db7f80c587 | ||
|   | 00e4f6fd36 | ||
|   | 8aa92deaf6 | ||
|   | 2856c7e320 | ||
|   | 3983b4ad0f | ||
|   | 352f92fe08 | ||
|   | 31c2461e3f | ||
|   | 8bb839e85a | ||
|   | cff47cacd1 | ||
|   | e1e9d27655 | ||
|   | e19fbd3297 | ||
|   | 23fd4e65ba | ||
|   | 37b0d547db | ||
|   | e591831430 | ||
|   | 8a3ac15a47 | ||
|   | 4bd0edc8fd | ||
|   | 9451cd7c5b | ||
|   | 65b05463d7 | ||
|   | 2b122a6750 | ||
|   | bc443b1052 | ||
|   | c5d8d8fd64 | ||
|   | 83d3e393bf | ||
|   | ee1cd31d2b | ||
|   | bc61c1328d | ||
|   | 709c326461 | ||
|   | ef5cb964b1 | ||
|   | 77fb98ee41 | ||
|   | b24273fe71 | ||
|   | 5f5fae27b5 | ||
|   | 2b22e1d5c3 | ||
|   | 6cb46adbc9 | ||
|   | fdc22b616c | ||
|   | 4c9b45966e | ||
|   | 67c2a176ce | ||
|   | bf53a8327f | ||
|   | f1336d2a70 | ||
|   | 703515f889 | ||
|   | d27dd6298b | ||
|   | 0ce2d5b6bf | ||
|   | 09620c0825 | ||
|   | 0a3088cb4b | ||
|   | 39d03d9959 | ||
|   | 5fed9ef842 | ||
|   | 5c1758d468 | ||
|   | 349577adbf | ||
|   | 7fd494d4b2 | ||
|   | f6d94b0dd6 | ||
|   | 59508e309e | ||
|   | 06f3b91902 | ||
|   | 5612114090 | ||
|   | 4d1ab84f1e | ||
|   | cdeb2322ea | ||
|   | f79926cb94 | ||
|   | 0a26490fe4 | ||
|   | 6a6e3a4928 | ||
|   | c5879b0676 | ||
|   | c835c9ebe5 | ||
|   | 6ebb8723a6 | ||
|   | f527436364 | ||
|   | f88bd7cd0f | ||
|   | 828a024c81 | ||
|   | 63a8424702 | ||
|   | 808f6a500c | ||
|   | 6d6db65d82 | ||
|   | bd5b5c749a | ||
|   | 06e0c30336 | ||
|   | 982dd01ac3 | ||
|   | 25b7295617 | ||
|   | 71ea3b4814 | ||
|   | 44aec27112 | ||
|   | 7efe538ac1 | ||
|   | be007c580e | ||
|   | dbb8e04472 | ||
|   | 853bad5af2 | ||
|   | df49e49bc7 | ||
|   | 72d045b2a6 | ||
|   | b8c9ded999 | ||
|   | eea6df8255 | ||
|   | 30a4966053 | ||
|   | 152f57f509 | ||
|   | fcba5ee47a | ||
|   | f30f25c33e | ||
|   | d6d9f256ff | ||
|   | e6057ed207 | ||
|   | 4a36180970 | ||
|   | 552bc355d1 | ||
|   | 14add3f724 | ||
|   | b194b3d97f | ||
|   | facbdec0b5 | ||
|   | 8785ebc471 | ||
|   | eb383710e2 | ||
|   | b7361c5b35 | ||
|   | 72c65c6213 | ||
|   | 5ad9164b9c | ||
|   | 72d8d8c6f3 | ||
|   | a3061e57e8 | ||
|   | 8a35c489ad | ||
|   | d536c1d04f | ||
|   | b2f3d9b05c | ||
|   | 9f0f4c1494 | ||
|   | 68ba0525a0 | ||
|   | cbd69f7e4e | ||
|   | 367a3bb36f | ||
|   | 4817e61f45 | ||
|   | 034a80009c | ||
|   | e5060b32e5 | ||
|   | b72dcd5457 | ||
|   | 57dfbac6ff | ||
|   | 32c9d467e3 | ||
|   | e967f4dd27 | ||
|   | eac4851bfd | ||
|   | 02515f0187 | ||
|   | f49efcd325 | ||
|   | 921cecbdf8 | ||
|   | b8567cb44e | ||
|   | 03ff2d7359 | ||
|   | f25d9cbe48 | ||
|   | bd64568d27 | ||
|   | 4e2c2b51f5 | ||
|   | 86bd886697 | ||
|   | 083854f06f | ||
|   | 42f3c1fe1c | ||
|   | 2ad4383b74 | ||
|   | f2b885d82e | ||
|   | 054ce1624c | ||
|   | b786a5ffc3 | ||
|   | c656cbc56b | ||
|   | ee3067c588 | ||
|   | 518bb7ae5a | ||
|   | 8ff8e51cda | ||
|   | 81f9cd56a2 | ||
|   | 29c0b575ee | ||
|   | 5c4b2eb3dd | ||
|   | 52add1988c | ||
|   | c578da6198 | ||
|   | 4b9bdb48d9 | ||
|   | 85d128f145 | ||
|   | e48b1c2c07 | ||
|   | e8f42223be | ||
|   | 41dc50fc27 | ||
|   | aec04e1deb | ||
|   | f61044a9b0 | ||
|   | 36288db2fd | ||
|   | bc49d7902c | ||
|   | a0bc62fe08 | ||
|   | 3f9a194e04 | ||
|   | c53bb974b2 | ||
|   | 5ed23223fd | ||
|   | 41de9a2e12 | ||
|   | 1b51a49a9d | ||
|   | 0224e32cd0 | ||
|   | bce140ebb9 | ||
|   | b313f0d189 | ||
|   | 581285c6dc | ||
|   | 0880105144 | ||
|   | 2a14335d95 | ||
|   | faea9bea44 | ||
|   | e9b60b587b | ||
|   | af3ae4b37c | ||
|   | d6a830ac7e | ||
|   | 9c915d1e7b | ||
|   | 4d561b3a30 | ||
|   | f8d8b60f1b | ||
|   | 4cd9625dd4 | ||
|   | 4f5ff0041a | ||
|   | d1d970e235 | ||
|   | e5bc7bff85 | ||
|   | 83c9bfad1e | ||
|   | 82009d4e30 | ||
|   | 786160cd76 | ||
|   | 4d9106afa6 | ||
|   | 02d511818f | ||
|   | 036cf93edf | ||
|   | cd99f3c744 | ||
|   | ef170bff32 | ||
|   | fe253bcb99 | ||
|   | 718c201b82 | ||
|   | 754f474568 | ||
|   | be7480cb5a | ||
|   | 7c5bc827b7 | ||
|   | acebb4a990 | ||
|   | 06fca0c48b | ||
|   | ff813588fd | ||
|   | 2f9568ac2a | ||
|   | f9519636f5 | ||
|   | d7cae5f0b4 | ||
|   | b2cd9b80ef | ||
|   | 977eb2c019 | ||
|   | ea43d60c18 | ||
|   | d5b5339540 | ||
|   | 01888f90a0 | ||
|   | 198d73b26f | ||
|   | 0780fd5ee6 | ||
|   | 2cf64afd4e | ||
|   | 51b6dd1aed | ||
|   | 3e4b00e6fa | ||
|   | ca2a03d1f6 | ||
|   | 0656bee36b | ||
|   | e53e44a0ad | ||
|   | 47fa00a3d4 | ||
|   | b2437a02a4 | ||
|   | f4162bf3ca | ||
|   | e3849823e0 | ||
|   | 5f2a1ac59a | ||
|   | 406f85a328 | ||
|   | 76f1b9457d | ||
|   | bda982b97f | ||
|   | e038c60049 | ||
|   | 4fa8f2a7a1 | ||
|   | 31b0640906 | ||
|   | ec095b5bf3 | ||
|   | b8fcbbf31d | ||
|   | 70a6bbd53d | ||
|   | f5e8c908bd | ||
|   | 69f773daa3 | ||
|   | d46ce9498c | ||
|   | c170848254 | ||
|   | 2ee7bc0a5e | ||
|   | f5ab082243 | ||
|   | 66211d0781 | ||
|   | 36db143690 | ||
|   | ecc362ed04 | ||
|   | a1f918cd92 | ||
|   | 04a5085127 | ||
|   | dfe77be01f | ||
|   | f9022964cf | ||
|   | acd1795a60 | ||
|   | a6f3ea5e84 | ||
|   | 6b68635047 | ||
|   | e9ecb228c9 | ||
|   | e9d2173921 | ||
|   | 81f2196bb1 | ||
|   | 86b4b027cf | ||
|   | 806d3cc2c3 | ||
|   | f6de4a5025 | ||
|   | fc366fde07 | ||
|   | b630d525c8 | ||
|   | c2ecf9c37a | ||
|   | 4d73b6b8d0 | ||
|   | 0a4d20fa9c | ||
|   | 392cccb7f4 | ||
|   | e775adead8 | ||
|   | 6193e3cdee | ||
|   | b36e24f39e | ||
|   | 296772f939 | ||
|   | b850218584 | ||
|   | ef08595c3f | ||
|   | 3a9926e40f | ||
|   | 12392e5600 | ||
|   | cfb3ef3a97 | ||
|   | 2c4d158d80 | ||
|   | cf5f7aa0b6 | ||
|   | 4039b3eba1 | ||
|   | 6538961d6a | ||
|   | c76da77573 | ||
|   | 29a4a17f55 | ||
|   | c71e13a81a | ||
|   | 2ac776ac76 | ||
|   | 1e1e3ef2fb | 
| @@ -9,7 +9,7 @@ menu "Global build settings" | |||||||
|  |  | ||||||
| 	config ALL_NONSHARED | 	config ALL_NONSHARED | ||||||
| 		bool "Select all target specific packages by default" | 		bool "Select all target specific packages by default" | ||||||
| 		default ALL | 		default ALL || BUILDBOT | ||||||
|  |  | ||||||
| 	config ALL_KMODS | 	config ALL_KMODS | ||||||
| 		bool "Select all kernel module packages by default" | 		bool "Select all kernel module packages by default" | ||||||
| @@ -19,6 +19,16 @@ menu "Global build settings" | |||||||
| 		bool "Select all userspace packages by default" | 		bool "Select all userspace packages by default" | ||||||
| 		default n | 		default n | ||||||
|  |  | ||||||
|  | 	config BUILDBOT | ||||||
|  | 		bool "Set build defaults for automatic builds (e.g. via buildbot)" | ||||||
|  | 		default n | ||||||
|  | 		help | ||||||
|  | 		  This option changes several defaults to be more suitable for | ||||||
|  | 		  automatic builds. This includes the following changes: | ||||||
|  | 		  - Deleting build directories after compiling (to save space) | ||||||
|  | 		  - Enabling per-device rootfs support | ||||||
|  | 		  ... | ||||||
|  |  | ||||||
| 	config SIGNED_PACKAGES | 	config SIGNED_PACKAGES | ||||||
| 		bool "Cryptographically signed package lists" | 		bool "Cryptographically signed package lists" | ||||||
| 		default y | 		default y | ||||||
| @@ -61,7 +71,7 @@ menu "Global build settings" | |||||||
| 		bool | 		bool | ||||||
| 		prompt "Collect kernel debug information" | 		prompt "Collect kernel debug information" | ||||||
| 		select KERNEL_DEBUG_INFO | 		select KERNEL_DEBUG_INFO | ||||||
| 		default n | 		default BUILDBOT | ||||||
| 		help | 		help | ||||||
| 		  This collects debugging symbols from the kernel and all compiled modules. | 		  This collects debugging symbols from the kernel and all compiled modules. | ||||||
| 		  Useful for release builds, so that kernel issues can be debugged offline | 		  Useful for release builds, so that kernel issues can be debugged offline | ||||||
|   | |||||||
| @@ -59,7 +59,7 @@ menuconfig DEVEL | |||||||
| 		bool "Use ccache" if DEVEL | 		bool "Use ccache" if DEVEL | ||||||
| 		default n | 		default n | ||||||
| 		help | 		help | ||||||
| 		  Compiler cache; see http://ccache.samba.org/. | 		  Compiler cache; see https://ccache.samba.org/ | ||||||
|  |  | ||||||
| 	config EXTERNAL_KERNEL_TREE | 	config EXTERNAL_KERNEL_TREE | ||||||
| 		string "Use external kernel tree" if DEVEL | 		string "Use external kernel tree" if DEVEL | ||||||
|   | |||||||
| @@ -201,7 +201,6 @@ menu "Target Images" | |||||||
| 		int "Serial port baud rate" | 		int "Serial port baud rate" | ||||||
| 		depends on GRUB_IMAGES | 		depends on GRUB_IMAGES | ||||||
| 		default 38400 if TARGET_x86_generic | 		default 38400 if TARGET_x86_generic | ||||||
| 		default 38400 if TARGET_x86_geode |  | ||||||
| 		default 115200 | 		default 115200 | ||||||
|  |  | ||||||
| 	config GRUB_BOOTOPTS | 	config GRUB_BOOTOPTS | ||||||
|   | |||||||
| @@ -1,8 +1,4 @@ | |||||||
| src-git packages https://git.lede-project.org/feed/packages.git | src-git packages https://git.lede-project.org/feed/packages.git^dc558eaa296686603c1730c1aab01f3ea69d7831 | ||||||
| src-git luci https://git.lede-project.org/project/luci.git | src-git luci https://git.lede-project.org/project/luci.git^7f6fc1681f7becc514a58082e871f3855d3a123f | ||||||
| src-git routing https://git.lede-project.org/feed/routing.git | src-git routing https://git.lede-project.org/feed/routing.git^dbbad8472288498c17825303d834da3ee5030806 | ||||||
| src-git telephony https://git.lede-project.org/feed/telephony.git | src-git telephony https://git.lede-project.org/feed/telephony.git^1f0fb2538ba6fc306198fe2a9a4b976d63adb304 | ||||||
| #src-git targets https://github.com/openwrt/targets.git |  | ||||||
| #src-git management https://github.com/openwrt-management/packages.git |  | ||||||
| #src-git oldpackages http://git.openwrt.org/packages.git |  | ||||||
| #src-link custom /usr/src/openwrt/custom-feed |  | ||||||
|   | |||||||
| @@ -107,3 +107,7 @@ define Host/Configure/Default | |||||||
| 		$(HOST_CMAKE_SOURCE_DIR) \ | 		$(HOST_CMAKE_SOURCE_DIR) \ | ||||||
| 	) | 	) | ||||||
| endef | endef | ||||||
|  |  | ||||||
|  | MAKE_FLAGS += \ | ||||||
|  | 	CMAKE_COMMAND='$$(if $$(CMAKE_DISABLE_$$@),:,$(STAGING_DIR_HOST)/bin/cmake)' \ | ||||||
|  | 	CMAKE_DISABLE_cmake_check_build_system=1 | ||||||
|   | |||||||
| @@ -67,6 +67,12 @@ HOST_CONFIGURE_ARGS = \ | |||||||
| 	--localstatedir=$(HOST_BUILD_PREFIX)/var \ | 	--localstatedir=$(HOST_BUILD_PREFIX)/var \ | ||||||
| 	--sbindir=$(HOST_BUILD_PREFIX)/bin | 	--sbindir=$(HOST_BUILD_PREFIX)/bin | ||||||
|  |  | ||||||
|  | HOST_MAKE_VARS = \ | ||||||
|  | 	CFLAGS="$(HOST_CFLAGS)" \ | ||||||
|  | 	CPPFLAGS="$(HOST_CPPFLAGS)" \ | ||||||
|  | 	CXXFLAGS="$(HOST_CXXFLAGS)" \ | ||||||
|  | 	LDFLAGS="$(HOST_LDFLAGS)" | ||||||
|  |  | ||||||
| HOST_MAKE_FLAGS = | HOST_MAKE_FLAGS = | ||||||
|  |  | ||||||
| HOST_CONFIGURE_CMD = $(BASH) ./configure | HOST_CONFIGURE_CMD = $(BASH) ./configure | ||||||
| @@ -89,7 +95,8 @@ define Host/Configure | |||||||
| endef | endef | ||||||
|  |  | ||||||
| define Host/Compile/Default | define Host/Compile/Default | ||||||
| 	+$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \ | 	+$(HOST_MAKE_VARS) \ | ||||||
|  | 	$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \ | ||||||
| 		$(HOST_MAKE_FLAGS) \ | 		$(HOST_MAKE_FLAGS) \ | ||||||
| 		$(1) | 		$(1) | ||||||
| endef | endef | ||||||
|   | |||||||
| @@ -277,7 +277,7 @@ endif | |||||||
|  |  | ||||||
| ifdef CONFIG_TARGET_ROOTFS_CPIOGZ | ifdef CONFIG_TARGET_ROOTFS_CPIOGZ | ||||||
|   define Image/Build/cpiogz |   define Image/Build/cpiogz | ||||||
| 	( cd $(TARGET_DIR); find . | cpio -o -H newc | gzip -9n >$(BIN_DIR)/$(IMG_PREFIX)-rootfs.cpio.gz ) | 	( cd $(TARGET_DIR); find . | cpio -o -H newc -R root:root | gzip -9n >$(BIN_DIR)/$(IMG_PREFIX)-rootfs.cpio.gz ) | ||||||
|   endef |   endef | ||||||
| endif | endif | ||||||
|  |  | ||||||
| @@ -420,7 +420,7 @@ define Device/Build/initramfs | |||||||
|   $(BIN_DIR)/$$(KERNEL_INITRAMFS_IMAGE): $(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE) |   $(BIN_DIR)/$$(KERNEL_INITRAMFS_IMAGE): $(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE) | ||||||
| 	cp $$^ $$@ | 	cp $$^ $$@ | ||||||
|  |  | ||||||
|   $(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE): $(KDIR)/$$(KERNEL_INITRAMFS_NAME) $(CURDIR)/Makefile $$(KERNEL_DEPENDS) |   $(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE): $(KDIR)/$$(KERNEL_INITRAMFS_NAME) $(CURDIR)/Makefile $$(KERNEL_DEPENDS) image_prepare | ||||||
| 	@rm -f $$@ | 	@rm -f $$@ | ||||||
| 	$$(call concat_cmd,$$(KERNEL_INITRAMFS)) | 	$$(call concat_cmd,$$(KERNEL_INITRAMFS)) | ||||||
| endef | endef | ||||||
| @@ -444,7 +444,7 @@ define Device/Build/kernel | |||||||
|     ifdef CONFIG_IB |     ifdef CONFIG_IB | ||||||
|       install: $$(KDIR_KERNEL_IMAGE) |       install: $$(KDIR_KERNEL_IMAGE) | ||||||
|     endif |     endif | ||||||
|     $$(KDIR_KERNEL_IMAGE): $(KDIR)/$$(KERNEL_NAME) $(CURDIR)/Makefile $$(KERNEL_DEPENDS) |     $$(KDIR_KERNEL_IMAGE): $(KDIR)/$$(KERNEL_NAME) $(CURDIR)/Makefile $$(KERNEL_DEPENDS) image_prepare | ||||||
| 	@rm -f $$@ | 	@rm -f $$@ | ||||||
| 	$$(call concat_cmd,$$(KERNEL)) | 	$$(call concat_cmd,$$(KERNEL)) | ||||||
| 	$$(if $$(KERNEL_SIZE),$$(call Build/check-size,$$(KERNEL_SIZE))) | 	$$(if $$(KERNEL_SIZE),$$(call Build/check-size,$$(KERNEL_SIZE))) | ||||||
|   | |||||||
| @@ -60,7 +60,7 @@ define Download/git-kernel | |||||||
|   PROTO:=git |   PROTO:=git | ||||||
|   VERSION:=$(CONFIG_KERNEL_GIT_BRANCH) |   VERSION:=$(CONFIG_KERNEL_GIT_BRANCH) | ||||||
|   FILE:=$(LINUX_SOURCE) |   FILE:=$(LINUX_SOURCE) | ||||||
|   SUBDIR:=linux-$(KERNEL_PATCHVER) |   SUBDIR:=linux-$(LINUX_VERSION) | ||||||
|   OPTS:=$(KERNEL_GIT_OPTS) |   OPTS:=$(KERNEL_GIT_OPTS) | ||||||
| endef | endef | ||||||
|  |  | ||||||
|   | |||||||
| @@ -3,10 +3,10 @@ | |||||||
| LINUX_RELEASE?=1 | LINUX_RELEASE?=1 | ||||||
|  |  | ||||||
| LINUX_VERSION-3.18 = .43 | LINUX_VERSION-3.18 = .43 | ||||||
| LINUX_VERSION-4.4 = .42 | LINUX_VERSION-4.4 = .71 | ||||||
|  |  | ||||||
| LINUX_KERNEL_HASH-3.18.43 = 1236e8123a6ce537d5029232560966feed054ae31776fe8481dd7d18cdd5492c | LINUX_KERNEL_HASH-3.18.43 = 1236e8123a6ce537d5029232560966feed054ae31776fe8481dd7d18cdd5492c | ||||||
| LINUX_KERNEL_HASH-4.4.42 = 324747568e92f203e3ee5ec8b291a868f58b870f1ad214fa64aa3507ed42e878 | LINUX_KERNEL_HASH-4.4.71 = 44cd5532d6df32197fd0f89e6f8c542fcfb76b52155a4d3a609ef4898522e6ab | ||||||
|  |  | ||||||
| ifdef KERNEL_PATCHVER | ifdef KERNEL_PATCHVER | ||||||
|   LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER))) |   LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER))) | ||||||
|   | |||||||
| @@ -95,15 +95,16 @@ define ModuleAutoLoad | |||||||
| 	$(SH_FUNC) \ | 	$(SH_FUNC) \ | ||||||
| 	export modules=; \ | 	export modules=; \ | ||||||
| 	probe_module() { \ | 	probe_module() { \ | ||||||
| 		mods="$$$$$$$$1"; \ | 		local mods="$$$$$$$$1"; \ | ||||||
| 		boot="$$$$$$$$2"; \ | 		local boot="$$$$$$$$2"; \ | ||||||
|  | 		local mod; \ | ||||||
| 		shift 2; \ | 		shift 2; \ | ||||||
| 		for mod in $(sort $$$$$$$$mods); do \ | 		for mod in $$$$$$$$mods; do \ | ||||||
| 			mkdir -p $(2)/etc/modules.d; \ | 			mkdir -p $(2)/etc/modules.d; \ | ||||||
| 			echo "$$$$$$$$mod" >> $(2)/etc/modules.d/$(1); \ | 			echo "$$$$$$$$mod" >> $(2)/etc/modules.d/$(1); \ | ||||||
| 		done; \ | 		done; \ | ||||||
| 		if [ -e $(2)/etc/modules.d/$(1) ]; then \ | 		if [ -e $(2)/etc/modules.d/$(1) ]; then \ | ||||||
| 			if [ "$$$$$$$$boot" = "1" ]; then \ | 			if [ "$$$$$$$$boot" = "1" -a ! -e $(2)/etc/modules-boot.d/$(1) ]; then \ | ||||||
| 				mkdir -p $(2)/etc/modules-boot.d; \ | 				mkdir -p $(2)/etc/modules-boot.d; \ | ||||||
| 				ln -s ../modules.d/$(1) $(2)/etc/modules-boot.d/; \ | 				ln -s ../modules.d/$(1) $(2)/etc/modules-boot.d/; \ | ||||||
| 			fi; \ | 			fi; \ | ||||||
| @@ -111,16 +112,17 @@ define ModuleAutoLoad | |||||||
| 		fi; \ | 		fi; \ | ||||||
| 	}; \ | 	}; \ | ||||||
| 	add_module() { \ | 	add_module() { \ | ||||||
| 		priority="$$$$$$$$1"; \ | 		local priority="$$$$$$$$1"; \ | ||||||
| 		mods="$$$$$$$$2"; \ | 		local mods="$$$$$$$$2"; \ | ||||||
| 		boot="$$$$$$$$3"; \ | 		local boot="$$$$$$$$3"; \ | ||||||
|  | 		local mod; \ | ||||||
| 		shift 3; \ | 		shift 3; \ | ||||||
| 		for mod in $(sort $$$$$$$$mods); do \ | 		for mod in $$$$$$$$mods; do \ | ||||||
| 			mkdir -p $(2)/etc/modules.d; \ | 			mkdir -p $(2)/etc/modules.d; \ | ||||||
| 			echo "$$$$$$$$mod" >> $(2)/etc/modules.d/$$$$$$$$priority-$(1); \ | 			echo "$$$$$$$$mod" >> $(2)/etc/modules.d/$$$$$$$$priority-$(1); \ | ||||||
| 		done; \ | 		done; \ | ||||||
| 		if [ -e $(2)/etc/modules.d/$$$$$$$$priority-$(1) ]; then \ | 		if [ -e $(2)/etc/modules.d/$$$$$$$$priority-$(1) ]; then \ | ||||||
| 			if [ "$$$$$$$$boot" = "1" ]; then \ | 			if [ "$$$$$$$$boot" = "1" -a ! -e $(2)/etc/modules-boot.d/$$$$$$$$priority-$(1) ]; then \ | ||||||
| 				mkdir -p $(2)/etc/modules-boot.d; \ | 				mkdir -p $(2)/etc/modules-boot.d; \ | ||||||
| 				ln -s ../modules.d/$$$$$$$$priority-$(1) $(2)/etc/modules-boot.d/; \ | 				ln -s ../modules.d/$$$$$$$$priority-$(1) $(2)/etc/modules-boot.d/; \ | ||||||
| 			fi; \ | 			fi; \ | ||||||
| @@ -129,6 +131,7 @@ define ModuleAutoLoad | |||||||
| 	}; \ | 	}; \ | ||||||
| 	$(3) \ | 	$(3) \ | ||||||
| 	if [ -n "$$$$$$$$modules" ]; then \ | 	if [ -n "$$$$$$$$modules" ]; then \ | ||||||
|  | 		modules="$$$$$$$$(echo "$$$$$$$$modules" | tr ' ' '\n' | sort | uniq | paste -s -d' ')"; \ | ||||||
| 		mkdir -p $(2)/etc/modules.d; \ | 		mkdir -p $(2)/etc/modules.d; \ | ||||||
| 		mkdir -p $(2)/CONTROL; \ | 		mkdir -p $(2)/CONTROL; \ | ||||||
| 		echo "#!/bin/sh" > $(2)/CONTROL/postinst-pkg; \ | 		echo "#!/bin/sh" > $(2)/CONTROL/postinst-pkg; \ | ||||||
|   | |||||||
| @@ -209,11 +209,13 @@ $(_endef) | |||||||
| 		( \ | 		( \ | ||||||
| 			echo "#!/bin/sh"; \ | 			echo "#!/bin/sh"; \ | ||||||
| 			echo "[ \"\$$$${IPKG_NO_SCRIPT}\" = \"1\" ] && exit 0"; \ | 			echo "[ \"\$$$${IPKG_NO_SCRIPT}\" = \"1\" ] && exit 0"; \ | ||||||
|  | 			echo "[ -x "\$$$${IPKG_INSTROOT}/lib/functions.sh" ] || exit 0"; \ | ||||||
| 			echo ". \$$$${IPKG_INSTROOT}/lib/functions.sh"; \ | 			echo ". \$$$${IPKG_INSTROOT}/lib/functions.sh"; \ | ||||||
| 			echo "default_postinst \$$$$0 \$$$$@"; \ | 			echo "default_postinst \$$$$0 \$$$$@"; \ | ||||||
| 		) > postinst; \ | 		) > postinst; \ | ||||||
| 		( \ | 		( \ | ||||||
| 			echo "#!/bin/sh"; \ | 			echo "#!/bin/sh"; \ | ||||||
|  | 			echo "[ -x "\$$$${IPKG_INSTROOT}/lib/functions.sh" ] || exit 0"; \ | ||||||
| 			echo ". \$$$${IPKG_INSTROOT}/lib/functions.sh"; \ | 			echo ". \$$$${IPKG_INSTROOT}/lib/functions.sh"; \ | ||||||
| 			echo "default_prerm \$$$$0 \$$$$@"; \ | 			echo "default_prerm \$$$$0 \$$$$@"; \ | ||||||
| 		) > prerm; \ | 		) > prerm; \ | ||||||
|   | |||||||
| @@ -47,6 +47,14 @@ opkg = \ | |||||||
|  |  | ||||||
| TARGET_DIR_ORIG := $(TARGET_ROOTFS_DIR)/root.orig-$(BOARD) | TARGET_DIR_ORIG := $(TARGET_ROOTFS_DIR)/root.orig-$(BOARD) | ||||||
|  |  | ||||||
|  | ifdef CONFIG_CLEAN_IPKG | ||||||
|  |   define clean_ipkg | ||||||
|  | 	-find $(1)/usr/lib/opkg -type f -and -not -name '*.control' | $(XARGS) rm -rf | ||||||
|  | 	-sed -i -ne '/^Require-User: /p' $(1)/usr/lib/opkg/info/*.control | ||||||
|  | 	-find $(1)/usr/lib/opkg -empty | $(XARGS) rm -rf | ||||||
|  |   endef | ||||||
|  | endif | ||||||
|  |  | ||||||
| define prepare_rootfs | define prepare_rootfs | ||||||
| 	@if [ -d $(TOPDIR)/files ]; then \ | 	@if [ -d $(TOPDIR)/files ]; then \ | ||||||
| 		$(call file_copy,$(TOPDIR)/files/.,$(1)); \ | 		$(call file_copy,$(TOPDIR)/files/.,$(1)); \ | ||||||
| @@ -75,6 +83,6 @@ define prepare_rootfs | |||||||
| 	rm -f $(1)/usr/lib/opkg/lists/* | 	rm -f $(1)/usr/lib/opkg/lists/* | ||||||
| 	rm -f $(1)/usr/lib/opkg/info/*.postinst* | 	rm -f $(1)/usr/lib/opkg/info/*.postinst* | ||||||
| 	rm -f $(1)/usr/lib/opkg/info/*.prerm* | 	rm -f $(1)/usr/lib/opkg/info/*.prerm* | ||||||
| 	$(if $(CONFIG_CLEAN_IPKG),rm -rf $(1)/usr/lib/opkg) | 	$(call clean_ipkg,$(1)) | ||||||
| 	$(call mklibs,$(1)) | 	$(call mklibs,$(1)) | ||||||
| endef | endef | ||||||
|   | |||||||
| @@ -164,17 +164,15 @@ ifeq ($(DUMP),1) | |||||||
|     endif |     endif | ||||||
|     CPU_CFLAGS += -mno-branch-likely |     CPU_CFLAGS += -mno-branch-likely | ||||||
|     CPU_CFLAGS_mips32 = -mips32 -mtune=mips32 |     CPU_CFLAGS_mips32 = -mips32 -mtune=mips32 | ||||||
|     CPU_CFLAGS_mips32r2 = -mips32r2 -mtune=mips32r2 |  | ||||||
|     CPU_CFLAGS_mips64 = -mips64 -mtune=mips64 -mabi=64 |     CPU_CFLAGS_mips64 = -mips64 -mtune=mips64 -mabi=64 | ||||||
|     CPU_CFLAGS_24kc = -mips32r2 -mtune=24kc |     CPU_CFLAGS_24kc = -mips32r2 -mtune=24kc | ||||||
|     CPU_CFLAGS_74kc = -mips32r2 -mtune=74kc |     CPU_CFLAGS_74kc = -mips32r2 -mtune=74kc | ||||||
|     CPU_CFLAGS_octeon = -march=octeon -mabi=64 |     CPU_CFLAGS_octeon = -march=octeon -mabi=64 | ||||||
|   endif |   endif | ||||||
|   ifeq ($(ARCH),i386) |   ifeq ($(ARCH),i386) | ||||||
|     CPU_TYPE ?= i486 |     CPU_TYPE ?= pentium | ||||||
|     CPU_CFLAGS_i486 = -march=i486 |     CPU_CFLAGS_pentium = -march=pentium-mmx | ||||||
|     CPU_CFLAGS_pentium4 = -march=pentium4 |     CPU_CFLAGS_pentium4 = -march=pentium4 | ||||||
|     CPU_CFLAGS_geode = -march=geode -mmmx -m3dnow |  | ||||||
|   endif |   endif | ||||||
|   ifneq ($(findstring arm,$(ARCH)),) |   ifneq ($(findstring arm,$(ARCH)),) | ||||||
|     CPU_TYPE ?= xscale |     CPU_TYPE ?= xscale | ||||||
| @@ -259,6 +257,9 @@ ifeq ($(DUMP),1) | |||||||
|     ifneq ($(CONFIG_VIRTIO),) |     ifneq ($(CONFIG_VIRTIO),) | ||||||
|       FEATURES += virtio |       FEATURES += virtio | ||||||
|     endif |     endif | ||||||
|  |     ifneq ($(CONFIG_CPU_MIPS32_R2),) | ||||||
|  |       FEATURES += mips16 | ||||||
|  |     endif | ||||||
|     FEATURES += $(foreach v,6 7,$(if $(CONFIG_CPU_V$(v)),arm_v$(v))) |     FEATURES += $(foreach v,6 7,$(if $(CONFIG_CPU_V$(v)),arm_v$(v))) | ||||||
|  |  | ||||||
|     # remove duplicates |     # remove duplicates | ||||||
|   | |||||||
| @@ -23,6 +23,7 @@ HOSTCC ?= $(CC) | |||||||
| export REVISION | export REVISION | ||||||
| export SOURCE_DATE_EPOCH | export SOURCE_DATE_EPOCH | ||||||
| export GIT_CONFIG_PARAMETERS='core.autocrlf=false' | export GIT_CONFIG_PARAMETERS='core.autocrlf=false' | ||||||
|  | export GIT_ASKPASS:=/bin/true | ||||||
| export MAKE_JOBSERVER=$(filter --jobserver%,$(MAKEFLAGS)) | export MAKE_JOBSERVER=$(filter --jobserver%,$(MAKEFLAGS)) | ||||||
|  |  | ||||||
| # prevent perforce from messing with the patch utility | # prevent perforce from messing with the patch utility | ||||||
| @@ -126,7 +127,7 @@ menuconfig: scripts/config/mconf prepare-tmpinfo FORCE | |||||||
| 	if [ \! -e .config -a -e $(HOME)/.openwrt/defconfig ]; then \ | 	if [ \! -e .config -a -e $(HOME)/.openwrt/defconfig ]; then \ | ||||||
| 		cp $(HOME)/.openwrt/defconfig .config; \ | 		cp $(HOME)/.openwrt/defconfig .config; \ | ||||||
| 	fi | 	fi | ||||||
| 	$< Config.in | 	[ -L .config ] && export KCONFIG_OVERWRITECONFIG=1; $< Config.in | ||||||
|  |  | ||||||
| prepare_kernel_conf: .config FORCE | prepare_kernel_conf: .config FORCE | ||||||
|  |  | ||||||
| @@ -170,7 +171,7 @@ else | |||||||
|   DOWNLOAD_DIRS = package/download |   DOWNLOAD_DIRS = package/download | ||||||
| endif | endif | ||||||
|  |  | ||||||
| download: .config FORCE | download: .config FORCE $(if $(wildcard $(TOPDIR)/staging_dir/host/bin/flock),,tools/flock/compile) | ||||||
| 	@+$(foreach dir,$(DOWNLOAD_DIRS),$(SUBMAKE) $(dir);) | 	@+$(foreach dir,$(DOWNLOAD_DIRS),$(SUBMAKE) $(dir);) | ||||||
|  |  | ||||||
| clean dirclean: .config | clean dirclean: .config | ||||||
|   | |||||||
| @@ -31,16 +31,16 @@ qstrip_escape=$(subst ','\'',$(call qstrip,$(1))) | |||||||
| sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1)))) | sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1)))) | ||||||
|  |  | ||||||
| VERSION_NUMBER:=$(call qstrip_escape,$(CONFIG_VERSION_NUMBER)) | VERSION_NUMBER:=$(call qstrip_escape,$(CONFIG_VERSION_NUMBER)) | ||||||
| VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),SNAPSHOT) | VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),17.01.2) | ||||||
|  |  | ||||||
| VERSION_CODE:=$(call qstrip_escape,$(CONFIG_VERSION_CODE)) | VERSION_CODE:=$(call qstrip_escape,$(CONFIG_VERSION_CODE)) | ||||||
| VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),$(REVISION)) | VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r3435-65eec8bd5f) | ||||||
|  |  | ||||||
| VERSION_NICK:=$(call qstrip_escape,$(CONFIG_VERSION_NICK)) | VERSION_NICK:=$(call qstrip_escape,$(CONFIG_VERSION_NICK)) | ||||||
| VERSION_NICK:=$(if $(VERSION_NICK),$(VERSION_NICK),$(RELEASE)) | VERSION_NICK:=$(if $(VERSION_NICK),$(VERSION_NICK),$(RELEASE)) | ||||||
|  |  | ||||||
| VERSION_REPO:=$(call qstrip_escape,$(CONFIG_VERSION_REPO)) | VERSION_REPO:=$(call qstrip_escape,$(CONFIG_VERSION_REPO)) | ||||||
| VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),http://downloads.lede-project.org/snapshots) | VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),http://downloads.lede-project.org/releases/17.01.2) | ||||||
|  |  | ||||||
| VERSION_DIST:=$(call qstrip_escape,$(CONFIG_VERSION_DIST)) | VERSION_DIST:=$(call qstrip_escape,$(CONFIG_VERSION_DIST)) | ||||||
| VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),LEDE) | VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),LEDE) | ||||||
|   | |||||||
| @@ -56,7 +56,7 @@ $(curdir)/merge: | |||||||
| $(curdir)/merge-index: $(curdir)/merge | $(curdir)/merge-index: $(curdir)/merge | ||||||
| 	(cd $(PACKAGE_DIR_ALL) && $(SCRIPT_DIR)/ipkg-make-index.sh . 2>&1 > Packages; ) | 	(cd $(PACKAGE_DIR_ALL) && $(SCRIPT_DIR)/ipkg-make-index.sh . 2>&1 > Packages; ) | ||||||
|  |  | ||||||
| $(curdir)/install: $(TMP_DIR)/.build $(curdir)/system/opkg/host/install $(curdir)/merge $(if $(CONFIG_TARGET_PER_DEVICE_ROOTFS),$(curdir)/merge-index) | $(curdir)/install: $(TMP_DIR)/.build $(curdir)/system/opkg/host/compile $(curdir)/merge $(if $(CONFIG_TARGET_PER_DEVICE_ROOTFS),$(curdir)/merge-index) | ||||||
| 	- find $(STAGING_DIR_ROOT) -type d | $(XARGS) chmod 0755 | 	- find $(STAGING_DIR_ROOT) -type d | $(XARGS) chmod 0755 | ||||||
| 	rm -rf $(TARGET_DIR) $(TARGET_DIR_ORIG) | 	rm -rf $(TARGET_DIR) $(TARGET_DIR_ORIG) | ||||||
| 	[ -d $(TARGET_DIR)/tmp ] || mkdir -p $(TARGET_DIR)/tmp | 	[ -d $(TARGET_DIR)/tmp ] || mkdir -p $(TARGET_DIR)/tmp | ||||||
|   | |||||||
| @@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk | |||||||
| include $(INCLUDE_DIR)/version.mk | include $(INCLUDE_DIR)/version.mk | ||||||
|  |  | ||||||
| PKG_NAME:=base-files | PKG_NAME:=base-files | ||||||
| PKG_RELEASE:=171 | PKG_RELEASE:=173 | ||||||
| PKG_FLAGS:=nonshared | PKG_FLAGS:=nonshared | ||||||
|  |  | ||||||
| PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/ | PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/ | ||||||
| @@ -57,6 +57,7 @@ define Package/base-files/conffiles | |||||||
| /etc/sysctl.d/local.conf | /etc/sysctl.d/local.conf | ||||||
| /etc/sysctl.d/ | /etc/sysctl.d/ | ||||||
| /etc/iproute2/rt_tables | /etc/iproute2/rt_tables | ||||||
|  | /etc/iproute2/rt_protos | ||||||
| $(call $(TARGET)/conffiles) | $(call $(TARGET)/conffiles) | ||||||
| endef | endef | ||||||
|  |  | ||||||
|   | |||||||
| @@ -226,7 +226,7 @@ generate_static_system() { | |||||||
| 	uci -q batch <<-EOF | 	uci -q batch <<-EOF | ||||||
| 		delete system.@system[0] | 		delete system.@system[0] | ||||||
| 		add system system | 		add system system | ||||||
| 		set system.@system[-1].hostname='lede' | 		set system.@system[-1].hostname='LEDE' | ||||||
| 		set system.@system[-1].timezone='UTC' | 		set system.@system[-1].timezone='UTC' | ||||||
| 		set system.@system[-1].ttylogin='0' | 		set system.@system[-1].ttylogin='0' | ||||||
| 		set system.@system[-1].log_size='64' | 		set system.@system[-1].log_size='64' | ||||||
|   | |||||||
							
								
								
									
										18
									
								
								package/base-files/files/etc/iproute2/rt_protos
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								package/base-files/files/etc/iproute2/rt_protos
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,18 @@ | |||||||
|  | # | ||||||
|  | # Reserved protocols. | ||||||
|  | # | ||||||
|  | 0	unspec | ||||||
|  | 1	redirect | ||||||
|  | 2	kernel | ||||||
|  | 3	boot | ||||||
|  | 4	static | ||||||
|  | 8	gated | ||||||
|  | 9	ra | ||||||
|  | 10	mrt | ||||||
|  | 11	zebra | ||||||
|  | 12	bird | ||||||
|  | 13	dnrouted | ||||||
|  | 14	xorp | ||||||
|  | 15	ntk | ||||||
|  | 16	dhcp | ||||||
|  | 42	babel | ||||||
| @@ -2,7 +2,7 @@ | |||||||
|  |  | ||||||
| . /lib/functions.sh | . /lib/functions.sh | ||||||
|  |  | ||||||
| for file in `grep Require-User /usr/lib/opkg/info/*.control | cut -d: -f1`; do | for file in `grep -sl Require-User /usr/lib/opkg/info/*.control`; do | ||||||
| 	file="${file##*/}" | 	file="${file##*/}" | ||||||
| 	file="${file%.control}" | 	file="${file%.control}" | ||||||
| 	add_group_and_user "${file}" | 	add_group_and_user "${file}" | ||||||
|   | |||||||
| @@ -29,17 +29,8 @@ network_get_ipaddr() { | |||||||
| # 1: destination variable | # 1: destination variable | ||||||
| # 2: interface | # 2: interface | ||||||
| network_get_ipaddr6() { | network_get_ipaddr6() { | ||||||
| 	local __addr | 	__network_ifstatus "$1" "$2" "['ipv6-address'][0].address" || \ | ||||||
|  | 		__network_ifstatus "$1" "$2" "['ipv6-prefix-assignment'][0]['local-address'].address" || \ | ||||||
| 	if __network_ifstatus "__addr" "$2" "['ipv6-address','ipv6-prefix-assignment'][0].address"; then |  | ||||||
| 		case "$__addr" in |  | ||||||
| 			*:)	export "$1=${__addr}1" ;; |  | ||||||
| 			*)	export "$1=${__addr}" ;; |  | ||||||
| 		esac |  | ||||||
| 		return 0 |  | ||||||
| 	fi |  | ||||||
|  |  | ||||||
| 	unset $1 |  | ||||||
| 		return 1 | 		return 1 | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -54,7 +45,36 @@ network_get_subnet() { | |||||||
| # 1: destination variable | # 1: destination variable | ||||||
| # 2: interface | # 2: interface | ||||||
| network_get_subnet6() { | network_get_subnet6() { | ||||||
| 	__network_ifstatus "$1" "$2" "['ipv6-address'][0]['address','mask']" "/" | 	local __nets __addr | ||||||
|  |  | ||||||
|  | 	if network_get_subnets6 __nets "$2"; then | ||||||
|  | 		# Attempt to return first non-fe80::/10, non-fc::/7 range | ||||||
|  | 		for __addr in $__nets; do | ||||||
|  | 			case "$__addr" in fe[8ab]?:*|f[cd]??:*) | ||||||
|  | 				continue | ||||||
|  | 			esac | ||||||
|  | 			export "$1=$__addr" | ||||||
|  | 			return 0 | ||||||
|  | 		done | ||||||
|  |  | ||||||
|  | 		# Attempt to return first non-fe80::/10 range | ||||||
|  | 		for __addr in $__nets; do | ||||||
|  | 			case "$__addr" in fe[8ab]?:*) | ||||||
|  | 				continue | ||||||
|  | 			esac | ||||||
|  | 			export "$1=$__addr" | ||||||
|  | 			return 0 | ||||||
|  | 		done | ||||||
|  |  | ||||||
|  | 		# Return first item | ||||||
|  | 		for __addr in $__nets; do | ||||||
|  | 			export "$1=$__addr" | ||||||
|  | 			return 0 | ||||||
|  | 		done | ||||||
|  | 	fi | ||||||
|  |  | ||||||
|  | 	unset "$1" | ||||||
|  | 	return 1 | ||||||
| } | } | ||||||
|  |  | ||||||
| # determine first IPv6 prefix of given logical interface | # determine first IPv6 prefix of given logical interface | ||||||
| @@ -78,14 +98,19 @@ network_get_ipaddrs6() { | |||||||
| 	local __addr | 	local __addr | ||||||
| 	local __list="" | 	local __list="" | ||||||
|  |  | ||||||
| 	if __network_ifstatus "__addr" "$2" "['ipv6-address','ipv6-prefix-assignment'][*].address"; then | 	if __network_ifstatus "__addr" "$2" "['ipv6-address'][*].address"; then | ||||||
| 		for __addr in $__addr; do | 		for __addr in $__addr; do | ||||||
| 			case "$__addr" in | 			__list="${__list:+$__list }${__addr}" | ||||||
| 				*:) __list="${__list:+$__list }${__addr}1" ;; |  | ||||||
| 				*)  __list="${__list:+$__list }${__addr}"  ;; |  | ||||||
| 			esac |  | ||||||
| 		done | 		done | ||||||
|  | 	fi | ||||||
|  |  | ||||||
|  | 	if __network_ifstatus "__addr" "$2" "['ipv6-prefix-assignment'][*]['local-address'].address"; then | ||||||
|  | 		for __addr in $__addr; do | ||||||
|  | 			__list="${__list:+$__list }${__addr}" | ||||||
|  | 		done | ||||||
|  | 	fi | ||||||
|  |  | ||||||
|  | 	if [ -n "$__list" ]; then | ||||||
| 		export "$1=$__list" | 		export "$1=$__list" | ||||||
| 		return 0 | 		return 0 | ||||||
| 	fi | 	fi | ||||||
| @@ -98,18 +123,13 @@ network_get_ipaddrs6() { | |||||||
| # 1: destination variable | # 1: destination variable | ||||||
| # 2: interface | # 2: interface | ||||||
| network_get_ipaddrs_all() { | network_get_ipaddrs_all() { | ||||||
| 	local __addr | 	local __addr __addr6 | ||||||
| 	local __list="" |  | ||||||
|  |  | ||||||
| 	if __network_ifstatus "__addr" "$2" "['ipv4-address','ipv6-address','ipv6-prefix-assignment'][*].address"; then | 	network_get_ipaddrs __addr "$2" | ||||||
| 		for __addr in $__addr; do | 	network_get_ipaddrs6 __addr6 "$2" | ||||||
| 			case "$__addr" in |  | ||||||
| 				*:) __list="${__list:+$__list }${__addr}1" ;; |  | ||||||
| 				*)  __list="${__list:+$__list }${__addr}"  ;; |  | ||||||
| 			esac |  | ||||||
| 		done |  | ||||||
|  |  | ||||||
| 		export "$1=$__list" | 	if [ -n "$__addr" -o -n "$__addr6" ]; then | ||||||
|  | 		export "$1=${__addr:+$__addr }$__addr6" | ||||||
| 		return 0 | 		return 0 | ||||||
| 	fi | 	fi | ||||||
|  |  | ||||||
| @@ -128,17 +148,24 @@ network_get_subnets() { | |||||||
| # 1: destination variable | # 1: destination variable | ||||||
| # 2: interface | # 2: interface | ||||||
| network_get_subnets6() { | network_get_subnets6() { | ||||||
| 	local __addr | 	local __addr __mask | ||||||
| 	local __list="" | 	local __list="" | ||||||
|  |  | ||||||
| 	if __network_ifstatus "__addr" "$2" "['ipv6-address','ipv6-prefix-assignment'][*]['address','mask']" "/ "; then | 	if __network_ifstatus "__addr" "$2" "['ipv6-address'][*]['address','mask']" "/ "; then | ||||||
| 		for __addr in $__addr; do | 		for __addr in $__addr; do | ||||||
| 			case "$__addr" in | 			__list="${__list:+$__list }${__addr}" | ||||||
| 				*:/*) __list="${__list:+$__list }${__addr%/*}1/${__addr##*/}" ;; |  | ||||||
| 				*)    __list="${__list:+$__list }${__addr}"                   ;; |  | ||||||
| 			esac |  | ||||||
| 		done | 		done | ||||||
|  | 	fi | ||||||
|  |  | ||||||
|  | 	if __network_ifstatus "__addr" "$2" "['ipv6-prefix-assignment'][*]['local-address'].address" && \ | ||||||
|  | 	   __network_ifstatus "__mask" "$2" "['ipv6-prefix-assignment'][*].mask"; then | ||||||
|  | 		for __addr in $__addr; do | ||||||
|  | 			__list="${__list:+$__list }${__addr}/${__mask%% *}" | ||||||
|  | 			__mask="${__mask#* }" | ||||||
|  | 		done | ||||||
|  | 	fi | ||||||
|  |  | ||||||
|  | 	if [ -n "$__list" ]; then | ||||||
| 		export "$1=$__list" | 		export "$1=$__list" | ||||||
| 		return 0 | 		return 0 | ||||||
| 	fi | 	fi | ||||||
|   | |||||||
| @@ -35,7 +35,7 @@ _ucidef_set_interface() { | |||||||
| 	json_select_object "$name" | 	json_select_object "$name" | ||||||
| 	json_add_string ifname "$iface" | 	json_add_string ifname "$iface" | ||||||
|  |  | ||||||
| 	if ! json_is_a protocol string; then | 	if ! json_is_a protocol string || [ -n "$proto" ]; then | ||||||
| 		case "$proto" in | 		case "$proto" in | ||||||
| 			static|dhcp|none|pppoe) : ;; | 			static|dhcp|none|pppoe) : ;; | ||||||
| 			*) | 			*) | ||||||
| @@ -619,6 +619,26 @@ ucidef_add_gpio_switch() { | |||||||
| 	json_select .. | 	json_select .. | ||||||
| } | } | ||||||
|  |  | ||||||
|  | ucidef_set_hostname() { | ||||||
|  | 	local hostname="$1" | ||||||
|  |  | ||||||
|  | 	json_select_object system | ||||||
|  | 		json_add_string hostname "$hostname" | ||||||
|  | 	json_select .. | ||||||
|  | } | ||||||
|  |  | ||||||
|  | ucidef_set_ntpserver() { | ||||||
|  | 	local server | ||||||
|  |  | ||||||
|  | 	json_select_object system | ||||||
|  | 		json_select_array ntpserver | ||||||
|  | 			for server in "$@"; do | ||||||
|  | 				json_add_string "" "$server" | ||||||
|  | 			done | ||||||
|  | 		json_select .. | ||||||
|  | 	json_select .. | ||||||
|  | } | ||||||
|  |  | ||||||
| board_config_update() { | board_config_update() { | ||||||
| 	json_init | 	json_init | ||||||
| 	[ -f ${CFG} ] && json_load "$(cat ${CFG})" | 	[ -f ${CFG} ] && json_load "$(cat ${CFG})" | ||||||
|   | |||||||
| @@ -3,7 +3,7 @@ do_sysinfo_generic() { | |||||||
| 	mkdir -p /tmp/sysinfo | 	mkdir -p /tmp/sysinfo | ||||||
| 	[ -e /tmp/sysinfo/board_name ] || \ | 	[ -e /tmp/sysinfo/board_name ] || \ | ||||||
| 		echo "$(strings /proc/device-tree/compatible | head -1)" > /tmp/sysinfo/board_name | 		echo "$(strings /proc/device-tree/compatible | head -1)" > /tmp/sysinfo/board_name | ||||||
| 	[ -n /tmp/sysinfo/model -a -e /proc/device-tree/model ] && \ | 	[ ! -e /tmp/sysinfo/model -a -e /proc/device-tree/model ] && \ | ||||||
| 		echo "$(cat /proc/device-tree/model)" > /tmp/sysinfo/model | 		echo "$(cat /proc/device-tree/model)" > /tmp/sysinfo/model | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -6,8 +6,8 @@ | |||||||
|  |  | ||||||
| usage() { | usage() { | ||||||
| 	cat <<EOF | 	cat <<EOF | ||||||
| Usage: $0 [down|detect|reload|status] | Usage: $0 [config|down|reload|status] | ||||||
| enables (default), disables or detects a wifi configuration. | enables (default), disables or configures devices not yet configured. | ||||||
| EOF | EOF | ||||||
| 	exit 1 | 	exit 1 | ||||||
| } | } | ||||||
| @@ -145,6 +145,12 @@ wifi_reload() { | |||||||
| 	wifi_reload_legacy | 	wifi_reload_legacy | ||||||
| } | } | ||||||
|  |  | ||||||
|  | wifi_detect_notice() { | ||||||
|  | 	>&2 echo "WARNING: Wifi detect is deprecated. Use wifi config instead" | ||||||
|  | 	>&2 echo "For more information, see commit 5f8f8a366136a07df661e31decce2458357c167a" | ||||||
|  | 	exit 1 | ||||||
|  | } | ||||||
|  |  | ||||||
| wifi_config() { | wifi_config() { | ||||||
| 	[ ! -f /etc/config/wireless ] && touch /etc/config/wireless | 	[ ! -f /etc/config/wireless ] && touch /etc/config/wireless | ||||||
|  |  | ||||||
| @@ -229,7 +235,7 @@ scan_wifi | |||||||
|  |  | ||||||
| case "$1" in | case "$1" in | ||||||
| 	down) wifi_updown "disable" "$2";; | 	down) wifi_updown "disable" "$2";; | ||||||
| 	detect) ;; | 	detect) wifi_detect_notice ;; | ||||||
| 	config) wifi_config ;; | 	config) wifi_config ;; | ||||||
| 	status) ubus_wifi_cmd "status" "$2";; | 	status) ubus_wifi_cmd "status" "$2";; | ||||||
| 	reload) wifi_reload "$2";; | 	reload) wifi_reload "$2";; | ||||||
|   | |||||||
| @@ -190,7 +190,7 @@ if VERSIONOPT | |||||||
| 	config VERSION_REPO | 	config VERSION_REPO | ||||||
| 		string | 		string | ||||||
| 		prompt "Release repository" | 		prompt "Release repository" | ||||||
| 		default "http://downloads.lede-project.org/snapshots" | 		default "http://downloads.lede-project.org/releases/17.01.2" | ||||||
| 		help | 		help | ||||||
| 			This is the repository address embedded in the image, it defaults | 			This is the repository address embedded in the image, it defaults | ||||||
| 			to the trunk snapshot repo; the url may contain the following placeholders: | 			to the trunk snapshot repo; the url may contain the following placeholders: | ||||||
| @@ -262,7 +262,7 @@ if VERSIONOPT | |||||||
| 	config VERSION_CODE_FILENAMES | 	config VERSION_CODE_FILENAMES | ||||||
| 		bool | 		bool | ||||||
| 		prompt "Revision code in filenames" | 		prompt "Revision code in filenames" | ||||||
| 		default y | 		default n | ||||||
| 		help | 		help | ||||||
| 			Enable this to include the revision identifier or the configured | 			Enable this to include the revision identifier or the configured | ||||||
| 			version code into the firmware image, SDK- and Image Builder archive | 			version code into the firmware image, SDK- and Image Builder archive | ||||||
| @@ -286,7 +286,7 @@ menuconfig PER_FEED_REPO | |||||||
|  |  | ||||||
| 	config PER_FEED_REPO_ADD_COMMENTED | 	config PER_FEED_REPO_ADD_COMMENTED | ||||||
| 		bool "Comment out not enabled feeds" | 		bool "Comment out not enabled feeds" | ||||||
| 		default y | 		default !BUILDBOT | ||||||
| 		depends on PER_FEED_REPO && PER_FEED_REPO_ADD_DISABLED | 		depends on PER_FEED_REPO && PER_FEED_REPO_ADD_DISABLED | ||||||
| 		help | 		help | ||||||
| 		  Add not enabled feeds as commented out source lines to opkg.conf. | 		  Add not enabled feeds as commented out source lines to opkg.conf. | ||||||
|   | |||||||
| @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk | |||||||
| include $(INCLUDE_DIR)/kernel.mk | include $(INCLUDE_DIR)/kernel.mk | ||||||
|  |  | ||||||
| PKG_NAME:=grub | PKG_NAME:=grub | ||||||
| PKG_VERSION:=2.02~beta3 | PKG_VERSION:=2.02~rc1 | ||||||
| PKG_RELEASE:=1 | PKG_RELEASE:=1 | ||||||
|  |  | ||||||
| PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz | ||||||
| @@ -17,7 +17,7 @@ PKG_SOURCE_URL:=http://alpha.gnu.org/gnu/grub \ | |||||||
| 	http://gnualpha.uib.no/grub/ \ | 	http://gnualpha.uib.no/grub/ \ | ||||||
| 	http://mirrors.fe.up.pt/pub/gnu-alpha/grub/ \ | 	http://mirrors.fe.up.pt/pub/gnu-alpha/grub/ \ | ||||||
| 	http://www.nic.funet.fi/pub/gnu/alpha/gnu/grub/ | 	http://www.nic.funet.fi/pub/gnu/alpha/gnu/grub/ | ||||||
| PKG_HASH:=30ec3d555e52a702c3eef449872ef874eff28b320f40b55ffc47f70db8e5ada1 | PKG_HASH:=445239e9b96d1143c194c1d37851cf4196b83701c60172e49665e9d453d80278 | ||||||
|  |  | ||||||
| PKG_FIXUP:=autoreconf | PKG_FIXUP:=autoreconf | ||||||
| HOST_BUILD_PARALLEL:=1 | HOST_BUILD_PARALLEL:=1 | ||||||
| @@ -25,6 +25,8 @@ PKG_BUILD_DEPENDS:=grub2/host | |||||||
|  |  | ||||||
| PKG_SSP:=0 | PKG_SSP:=0 | ||||||
|  |  | ||||||
|  | PKG_FLAGS:=nonshared | ||||||
|  |  | ||||||
| include $(INCLUDE_DIR)/host-build.mk | include $(INCLUDE_DIR)/host-build.mk | ||||||
| include $(INCLUDE_DIR)/package.mk | include $(INCLUDE_DIR)/package.mk | ||||||
|  |  | ||||||
|   | |||||||
| @@ -12,6 +12,8 @@ PKG_RELEASE:=1 | |||||||
|  |  | ||||||
| PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) | PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) | ||||||
|  |  | ||||||
|  | PKG_FLAGS:=nonshared | ||||||
|  |  | ||||||
| include $(INCLUDE_DIR)/package.mk | include $(INCLUDE_DIR)/package.mk | ||||||
|  |  | ||||||
| define Package/rbcfg | define Package/rbcfg | ||||||
|   | |||||||
| @@ -14,6 +14,8 @@ touch /etc/config/ubootenv | |||||||
| board=$(ar71xx_board_name) | board=$(ar71xx_board_name) | ||||||
|  |  | ||||||
| case "$board" in | case "$board" in | ||||||
|  | a40|\ | ||||||
|  | a60|\ | ||||||
| alfa-ap120c|\ | alfa-ap120c|\ | ||||||
| all0258n|\ | all0258n|\ | ||||||
| ap90q|\ | ap90q|\ | ||||||
| @@ -52,8 +54,10 @@ om2p|\ | |||||||
| om2p-hs|\ | om2p-hs|\ | ||||||
| om2p-hsv2|\ | om2p-hsv2|\ | ||||||
| om2p-hsv3|\ | om2p-hsv3|\ | ||||||
|  | om2p-hsv4|\ | ||||||
| om2p-lc|\ | om2p-lc|\ | ||||||
| om2pv2) | om2pv2|\ | ||||||
|  | om2pv4) | ||||||
| 	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x40000" | 	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x40000" | ||||||
| 	;; | 	;; | ||||||
| dap-2695-a1|\ | dap-2695-a1|\ | ||||||
|   | |||||||
| @@ -10,7 +10,7 @@ | |||||||
| -	"bootm 0x800000" | -	"bootm 0x800000" | ||||||
| +	"ubi part ubi; " \ | +	"ubi part ubi; " \ | ||||||
| +	"ubi read 0x800000 kernel; " \ | +	"ubi read 0x800000 kernel; " \ | ||||||
| +	"bootz 0x800000" | +	"bootm 0x800000" | ||||||
|   |   | ||||||
|  #define CONFIG_MTDPARTS \ |  #define CONFIG_MTDPARTS \ | ||||||
| -	"mtdparts=orion_nand:1m(uboot),6M(uImage),-(root)\0" | -	"mtdparts=orion_nand:1m(uboot),6M(uImage),-(root)\0" | ||||||
|   | |||||||
| @@ -17,6 +17,8 @@ PKG_HASH:=466eca9cdad2c15e957fb9ce7d0b6927ecd17d85c4cc2dff37e97a3e6b209c67 | |||||||
|  |  | ||||||
| PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) | PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) | ||||||
|  |  | ||||||
|  | PKG_FLAGS:=nonshared | ||||||
|  |  | ||||||
| include $(INCLUDE_DIR)/package.mk | include $(INCLUDE_DIR)/package.mk | ||||||
|  |  | ||||||
| define Package/yamonenv | define Package/yamonenv | ||||||
|   | |||||||
| @@ -0,0 +1,65 @@ | |||||||
|  | From 183eb37e25d903ccd68cc2d8f8a37e75872c03d2 Mon Sep 17 00:00:00 2001 | ||||||
|  | From: Nick Clifton <nickc@redhat.com> | ||||||
|  | Date: Tue, 6 Sep 2016 17:35:35 +0100 | ||||||
|  | Subject: [PATCH 1/2] Do not pass host compiler sanitization flags on to linker | ||||||
|  |  testsuite. | ||||||
|  |  | ||||||
|  | 	* Makefile.am (CFLAGS_FOR_TARGET): Define as a copy of CFLAGS but | ||||||
|  | 	without any sanitization options. | ||||||
|  | 	(CXXFLAGS_FOR_TARGET): Define as a copy of CXXFLAGS but	without | ||||||
|  | 	any sanitization options. | ||||||
|  | 	(check-DEJAGNU): Pass CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET | ||||||
|  | 	as CFLAGS and CXXFLAGS respectively. | ||||||
|  | --- | ||||||
|  |  ld/Makefile.am | 8 ++++++-- | ||||||
|  |  ld/Makefile.in | 8 ++++++-- | ||||||
|  |  2 files changed, 12 insertions(+), 4 deletions(-) | ||||||
|  |  | ||||||
|  | --- a/ld/Makefile.am | ||||||
|  | +++ b/ld/Makefile.am | ||||||
|  | @@ -136,6 +136,10 @@ CXX_FOR_TARGET = ` \ | ||||||
|  |      fi; \ | ||||||
|  |    fi` | ||||||
|  |   | ||||||
|  | +# Strip out sanitization options as we want to test building binaries without any extra paraphernalia | ||||||
|  | +CFLAGS_FOR_TARGET = `echo $(CFLAGS) | sed -e 's/-fsanitize=address//g' -e 's/-fsanitize=undefined//g'` | ||||||
|  | +CXXFLAGS_FOR_TARGET = `echo $(CXXFLAGS) | sed -e 's/-fsanitize=address//g' -e 's/-fsanitize=undefined//g'` | ||||||
|  | + | ||||||
|  |  transform = s/^ld-new$$/$(installed_linker)/;@program_transform_name@ | ||||||
|  |  bin_PROGRAMS = ld-new | ||||||
|  |  info_TEXINFOS = ld.texinfo | ||||||
|  | @@ -2075,8 +2079,8 @@ check-DEJAGNU: site.exp | ||||||
|  |  	runtest=$(RUNTEST); \ | ||||||
|  |  	if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \ | ||||||
|  |  	  $$runtest --tool $(DEJATOOL) --srcdir $${srcroot}/testsuite \ | ||||||
|  | -		CC="$(CC_FOR_TARGET)" CFLAGS="$(CFLAGS)" \ | ||||||
|  | -		CXX="$(CXX_FOR_TARGET)" CXXFLAGS="$(CXXFLAGS)" \ | ||||||
|  | +		CC="$(CC_FOR_TARGET)" CFLAGS="$(CFLAGS_FOR_TARGET)" \ | ||||||
|  | +		CXX="$(CXX_FOR_TARGET)" CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \ | ||||||
|  |  		CC_FOR_HOST="$(CC)" CFLAGS_FOR_HOST="$(CFLAGS)" \ | ||||||
|  |  		OFILES="$(OFILES)" BFDLIB="$(TESTBFDLIB)" \ | ||||||
|  |  		LIBIBERTY="$(LIBIBERTY) $(LIBINTL)" LIBS="$(LIBS)" \ | ||||||
|  | --- a/ld/Makefile.in | ||||||
|  | +++ b/ld/Makefile.in | ||||||
|  | @@ -507,6 +507,10 @@ CXX_FOR_TARGET = ` \ | ||||||
|  |      fi; \ | ||||||
|  |    fi` | ||||||
|  |   | ||||||
|  | + | ||||||
|  | +# Strip out sanitization options as they require special host libraries. | ||||||
|  | +CFLAGS_FOR_TARGET = `echo $(CFLAGS) | sed -e 's/-fsanitize=address//g' -e 's/-fsanitize=undefined//g'` | ||||||
|  | +CXXFLAGS_FOR_TARGET = `echo $(CXXFLAGS) | sed -e 's/-fsanitize=address//g' -e 's/-fsanitize=undefined//g'` | ||||||
|  |  info_TEXINFOS = ld.texinfo | ||||||
|  |  ld_TEXINFOS = configdoc.texi | ||||||
|  |  noinst_TEXINFOS = ldint.texinfo | ||||||
|  | @@ -3644,8 +3648,8 @@ check-DEJAGNU: site.exp | ||||||
|  |  	runtest=$(RUNTEST); \ | ||||||
|  |  	if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \ | ||||||
|  |  	  $$runtest --tool $(DEJATOOL) --srcdir $${srcroot}/testsuite \ | ||||||
|  | -		CC="$(CC_FOR_TARGET)" CFLAGS="$(CFLAGS)" \ | ||||||
|  | -		CXX="$(CXX_FOR_TARGET)" CXXFLAGS="$(CXXFLAGS)" \ | ||||||
|  | +		CC="$(CC_FOR_TARGET)" CFLAGS="$(CFLAGS_FOR_TARGET)" \ | ||||||
|  | +		CXX="$(CXX_FOR_TARGET)" CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \ | ||||||
|  |  		CC_FOR_HOST="$(CC)" CFLAGS_FOR_HOST="$(CFLAGS)" \ | ||||||
|  |  		OFILES="$(OFILES)" BFDLIB="$(TESTBFDLIB)" \ | ||||||
|  |  		LIBIBERTY="$(LIBIBERTY) $(LIBINTL)" LIBS="$(LIBS)" \ | ||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -32,6 +32,11 @@ $(Package/ath10k-firmware-default) | |||||||
|   TITLE:=ath10k firmware for QCA9887 devices |   TITLE:=ath10k firmware for QCA9887 devices | ||||||
| endef | endef | ||||||
|  |  | ||||||
|  | define Package/ath10k-firmware-qca9887-ct | ||||||
|  | $(Package/ath10k-firmware-default) | ||||||
|  |   TITLE:=ath10k-CT firmware for QCA9887 devices | ||||||
|  | endef | ||||||
|  |  | ||||||
| QCA9887_REV:=3cce88e245f2d685e49411c4f80998f94baf67b8 | QCA9887_REV:=3cce88e245f2d685e49411c4f80998f94baf67b8 | ||||||
| QCA9887_FIRMWARE_FILE:=firmware-5.bin_10.2.4-1.0-00013 | QCA9887_FIRMWARE_FILE:=firmware-5.bin_10.2.4-1.0-00013 | ||||||
| QCA9887_FIRMWARE_FILE_HASH:=5966408bd41f309edb595344b8dd088c0fed212debfd91e5f3e8a55ea119c16d | QCA9887_FIRMWARE_FILE_HASH:=5966408bd41f309edb595344b8dd088c0fed212debfd91e5f3e8a55ea119c16d | ||||||
| @@ -58,7 +63,6 @@ $(eval $(call Download,ath10k-qca9887-board)) | |||||||
|  |  | ||||||
| define Package/ath10k-firmware-qca988x | define Package/ath10k-firmware-qca988x | ||||||
| $(Package/ath10k-firmware-default) | $(Package/ath10k-firmware-default) | ||||||
|   DEFAULT:=PACKAGE_kmod-ath10k |  | ||||||
|   TITLE:=ath10k firmware for QCA988x devices |   TITLE:=ath10k firmware for QCA988x devices | ||||||
|   SECTION:=firmware |   SECTION:=firmware | ||||||
|   CATEGORY:=Firmware |   CATEGORY:=Firmware | ||||||
| @@ -72,13 +76,20 @@ define Download/ct-firmware | |||||||
|   URL_FILE:=$($(1)_FIRMWARE_FILE_CT) |   URL_FILE:=$($(1)_FIRMWARE_FILE_CT) | ||||||
| endef | endef | ||||||
|  |  | ||||||
| QCA988X_FIRMWARE_FILE_CT:=firmware-2-ct-full-community.bin-19.rc1-lede | QCA988X_FIRMWARE_FILE_CT:=firmware-2-ct-full-community.bin-19-rc3-lede | ||||||
| define Download/ath10k-firmware-qca988x-ct | define Download/ath10k-firmware-qca988x-ct | ||||||
|   $(call Download/ct-firmware,QCA988X,) |   $(call Download/ct-firmware,QCA988X,) | ||||||
|   HASH:=ad41b29a9eebf1066f993beb571f3bd13f14ea89336ef9d4f3b31ee57e7abe54 |   HASH:=4112d78161a2c20e7a9490ea8d04e9f919508bafb097d88761dcce026c26f93f | ||||||
| endef | endef | ||||||
| $(eval $(call Download,ath10k-firmware-qca988x-ct)) | $(eval $(call Download,ath10k-firmware-qca988x-ct)) | ||||||
|  |  | ||||||
|  | QCA9887_FIRMWARE_FILE_CT:=firmware-2-ct-full-community.bin-19-rc3-lede | ||||||
|  | define Download/ath10k-firmware-qca9887-ct | ||||||
|  |   $(call Download/ct-firmware,QCA9887,ath10k-9887) | ||||||
|  |   HASH:=18b61875726d4384de46f75dec1d42fea31aa6d66dba4940cb9d375bc98732e4 | ||||||
|  | endef | ||||||
|  | $(eval $(call Download,ath10k-firmware-qca9887-ct)) | ||||||
|  |  | ||||||
| QCA99X0_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-9.bin-lede.001 | QCA99X0_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-9.bin-lede.001 | ||||||
| define Download/ath10k-firmware-qca99x0-ct | define Download/ath10k-firmware-qca99x0-ct | ||||||
|   $(call Download/ct-firmware,QCA99X0,ath10k-10-4) |   $(call Download/ct-firmware,QCA99X0,ath10k-10-4) | ||||||
| @@ -107,6 +118,13 @@ $(Package/ath10k-firmware-default) | |||||||
|   CATEGORY:=Firmware |   CATEGORY:=Firmware | ||||||
| endef | endef | ||||||
|  |  | ||||||
|  | define Package/ath10k-firmware-qca9887-ct | ||||||
|  | $(Package/ath10k-firmware-default) | ||||||
|  |   TITLE:=ath10k CT 10.1 firmware for QCA9887 devices | ||||||
|  |   SECTION:=firmware | ||||||
|  |   CATEGORY:=Firmware | ||||||
|  | endef | ||||||
|  |  | ||||||
| define Package/ath10k-firmware-qca988x-ct/description | define Package/ath10k-firmware-qca988x-ct/description | ||||||
| Alternative ath10k firmware for QCA988X from Candela Technologies. | Alternative ath10k firmware for QCA988X from Candela Technologies. | ||||||
| Enables IBSS and other features.  See: | Enables IBSS and other features.  See: | ||||||
| @@ -116,6 +134,14 @@ is un-selected since the driver will try to load firmware-5.bin before | |||||||
| firmware-2.bin | firmware-2.bin | ||||||
| endef | endef | ||||||
|  |  | ||||||
|  | define Package/ath10k-firmware-qca9887-ct/description | ||||||
|  | Alternative ath10k firmware for QCA9887 from Candela Technologies. | ||||||
|  | Enables IBSS and other features.  See: | ||||||
|  | http://www.candelatech.com/ath10k-10.1.php | ||||||
|  | This firmware conflicts with the standard 9887 firmware, so select only | ||||||
|  | one. | ||||||
|  | endef | ||||||
|  |  | ||||||
| define Package/ath10k-firmware-qca99x0-ct/description | define Package/ath10k-firmware-qca99x0-ct/description | ||||||
| Alternative ath10k firmware for QCA99x0 from Candela Technologies. | Alternative ath10k firmware for QCA99x0 from Candela Technologies. | ||||||
| Enables IBSS and other features.  See: | Enables IBSS and other features.  See: | ||||||
| @@ -177,18 +203,18 @@ define Download/qca99x0-board | |||||||
| endef | endef | ||||||
| $(eval $(call Download,qca99x0-board)) | $(eval $(call Download,qca99x0-board)) | ||||||
|  |  | ||||||
| QCA9984_BOARD_REV:=deb1832c56c706d0f6cb539113e09f0daaa52b5f | QCA9984_BOARD_REV:=719c0127e52bd70559e71b85ab0331790e1bf66c | ||||||
| QCA9984_BOARD_FILE:=board-2.bin | QCA9984_BOARD_FILE:=board-2.bin | ||||||
| QCA9984_BOARD_FILE_DL:=$(QCA9984_BOARD_FILE).$(QCA9984_BOARD_REV) | QCA9984_BOARD_FILE_DL:=$(QCA9984_BOARD_FILE).$(QCA9984_BOARD_REV) | ||||||
| QCA9984_FIRMWARE_REV:=deb1832c56c706d0f6cb539113e09f0daaa52b5f | QCA9984_FIRMWARE_REV:=d43cb1188154037506e94abf3aa456cc934c6861 | ||||||
| QCA9984_FIRMWARE_FILE:=firmware-5.bin_10.4-3.3-00102 | QCA9984_FIRMWARE_FILE:=firmware-5.bin_10.4-3.4-00072 | ||||||
| QCA9984_FIRMWARE_FILE_DL:=$(QCA9984_FIRMWARE_FILE).$(QCA9984_FIRMWARE_REV) | QCA9984_FIRMWARE_FILE_DL:=$(QCA9984_FIRMWARE_FILE).$(QCA9984_FIRMWARE_REV) | ||||||
|  |  | ||||||
| define Download/ath10k-qca9984-board | define Download/ath10k-qca9984-board | ||||||
|   URL:=https://source.codeaurora.org/quic/qsdk/oss/firmware/ath10k-firmware/plain/ath10k/QCA9984/hw1.0/ |   URL:=https://source.codeaurora.org/quic/qsdk/oss/firmware/ath10k-firmware/plain/ath10k/QCA9984/hw1.0/ | ||||||
|   URL_FILE:=$(QCA9984_BOARD_FILE)?id=$(QCA9984_BOARD_REV) |   URL_FILE:=$(QCA9984_BOARD_FILE)?id=$(QCA9984_BOARD_REV) | ||||||
|   FILE:=$(QCA9984_BOARD_FILE_DL) |   FILE:=$(QCA9984_BOARD_FILE_DL) | ||||||
|   HASH:=6a79ff0e8cc71549e771b41dbb7dad862d8e29da852f8aff25ce1e4bd5ea263e |   HASH:=e968b214fd76d5b7859f71841ce40fbd5f47336c3ccbaf95e23f902f5e569aef | ||||||
| endef | endef | ||||||
| $(eval $(call Download,ath10k-qca9984-board)) | $(eval $(call Download,ath10k-qca9984-board)) | ||||||
|  |  | ||||||
| @@ -196,7 +222,7 @@ define Download/ath10k-qca9984-firmware | |||||||
|   URL:=https://source.codeaurora.org/quic/qsdk/oss/firmware/ath10k-firmware/plain/ath10k/QCA9984/hw1.0/ |   URL:=https://source.codeaurora.org/quic/qsdk/oss/firmware/ath10k-firmware/plain/ath10k/QCA9984/hw1.0/ | ||||||
|   URL_FILE:=$(QCA9984_FIRMWARE_FILE)?id=$(QCA9984_FIRMWARE_REV) |   URL_FILE:=$(QCA9984_FIRMWARE_FILE)?id=$(QCA9984_FIRMWARE_REV) | ||||||
|   FILE:=$(QCA9984_FIRMWARE_FILE_DL) |   FILE:=$(QCA9984_FIRMWARE_FILE_DL) | ||||||
|   HASH:=490ad52df76a4fa8004a3a8c21dd43bb8262dd2816df48a6408706b82491f299 |   HASH:=28d5834e8c4ca8fcef9ea033cd8b9b0f9ee84ecf30dbde84c9c64bf8dd9912bc | ||||||
| endef | endef | ||||||
| $(eval $(call Download,ath10k-qca9984-firmware)) | $(eval $(call Download,ath10k-qca9984-firmware)) | ||||||
|  |  | ||||||
| @@ -224,6 +250,16 @@ define Package/ath10k-firmware-qca988x/install | |||||||
| 		$(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-5.bin | 		$(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-5.bin | ||||||
| endef | endef | ||||||
|  |  | ||||||
|  | define Package/ath10k-firmware-qca9887-ct/install | ||||||
|  | 	$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9887/hw1.0 | ||||||
|  | 	$(INSTALL_DATA) \ | ||||||
|  | 		$(DL_DIR)/$(call CT_FIRMWARE_FILE,QCA9887) \ | ||||||
|  | 		$(1)/lib/firmware/ath10k/QCA9887/hw1.0/firmware-2.bin | ||||||
|  | 	$(INSTALL_DATA) \ | ||||||
|  | 		$(DL_DIR)/$(QCA9887_BOARD_FILE_DL) \ | ||||||
|  | 		$(1)/lib/firmware/ath10k/QCA9887/hw1.0/board.bin | ||||||
|  | endef | ||||||
|  |  | ||||||
| define Package/ath10k-firmware-qca988x-ct/install | define Package/ath10k-firmware-qca988x-ct/install | ||||||
| 	$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA988X/hw2.0 | 	$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA988X/hw2.0 | ||||||
| 	$(INSTALL_DATA) \ | 	$(INSTALL_DATA) \ | ||||||
| @@ -297,6 +333,7 @@ $(eval $(call BuildPackage,ath10k-firmware-qca99x0)) | |||||||
| $(eval $(call BuildPackage,ath10k-firmware-qca6174)) | $(eval $(call BuildPackage,ath10k-firmware-qca6174)) | ||||||
| $(eval $(call BuildPackage,ath10k-firmware-qca9984)) | $(eval $(call BuildPackage,ath10k-firmware-qca9984)) | ||||||
|  |  | ||||||
|  | $(eval $(call BuildPackage,ath10k-firmware-qca9887-ct)) | ||||||
| $(eval $(call BuildPackage,ath10k-firmware-qca988x-ct)) | $(eval $(call BuildPackage,ath10k-firmware-qca988x-ct)) | ||||||
| $(eval $(call BuildPackage,ath10k-firmware-qca99x0-ct)) | $(eval $(call BuildPackage,ath10k-firmware-qca99x0-ct)) | ||||||
| $(eval $(call BuildPackage,ath10k-firmware-qca9984-ct)) | $(eval $(call BuildPackage,ath10k-firmware-qca9984-ct)) | ||||||
|   | |||||||
| @@ -22,6 +22,8 @@ PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(BUILD_VARIANT)/$(PKG_NAM | |||||||
| PKG_LICENSE:=GPL-2.0 GPL-2.0+ | PKG_LICENSE:=GPL-2.0 GPL-2.0+ | ||||||
| PKG_LICENSE_FILES:=Licenses/README | PKG_LICENSE_FILES:=Licenses/README | ||||||
|  |  | ||||||
|  | PKG_FLAGS:=nonshared | ||||||
|  |  | ||||||
| include $(INCLUDE_DIR)/package.mk | include $(INCLUDE_DIR)/package.mk | ||||||
|  |  | ||||||
| define fman/Default | define fman/Default | ||||||
|   | |||||||
| @@ -20,6 +20,15 @@ define Package/mwifiex-pcie-firmware/install | |||||||
| endef | endef | ||||||
| $(eval $(call BuildPackage,mwifiex-pcie-firmware)) | $(eval $(call BuildPackage,mwifiex-pcie-firmware)) | ||||||
|  |  | ||||||
|  | Package/mwifiex-sdio-firmware = $(call Package/firmware-default,Marvell 8887 firmware) | ||||||
|  | define Package/mwifiex-sdio-firmware/install | ||||||
|  | 	$(INSTALL_DIR) $(1)/lib/firmware/mrvl | ||||||
|  | 	$(INSTALL_DATA) \ | ||||||
|  | 		$(PKG_BUILD_DIR)/mrvl/sd8887_uapsta.bin \ | ||||||
|  | 		$(1)/lib/firmware/mrvl/ | ||||||
|  | endef | ||||||
|  | $(eval $(call BuildPackage,mwifiex-sdio-firmware)) | ||||||
|  |  | ||||||
| Package/libertas-usb-firmware = $(call Package/firmware-default,Marvell 8388/8682 USB firmware) | Package/libertas-usb-firmware = $(call Package/firmware-default,Marvell 8388/8682 USB firmware) | ||||||
| define Package/libertas-usb-firmware/install | define Package/libertas-usb-firmware/install | ||||||
| 	$(INSTALL_DIR) $(1)/lib/firmware/libertas | 	$(INSTALL_DIR) $(1)/lib/firmware/libertas | ||||||
|   | |||||||
| @@ -20,6 +20,8 @@ PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(BUILD_VARIANT)/$(PKG_NAM | |||||||
| PKG_LICENSE:=GPL-2.0 GPL-2.0+ | PKG_LICENSE:=GPL-2.0 GPL-2.0+ | ||||||
| PKG_LICENSE_FILES:=Licenses/README | PKG_LICENSE_FILES:=Licenses/README | ||||||
|  |  | ||||||
|  | PKG_FLAGS:=nonshared | ||||||
|  |  | ||||||
| include $(INCLUDE_DIR)/package.mk | include $(INCLUDE_DIR)/package.mk | ||||||
|  |  | ||||||
| define ppfe/Default | define ppfe/Default | ||||||
|   | |||||||
| @@ -22,6 +22,8 @@ PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(BUILD_VARIANT)/$(PKG_NAM | |||||||
| PKG_LICENSE:=GPL-2.0 GPL-2.0+ | PKG_LICENSE:=GPL-2.0 GPL-2.0+ | ||||||
| PKG_LICENSE_FILES:=Licenses/README | PKG_LICENSE_FILES:=Licenses/README | ||||||
|  |  | ||||||
|  | PKG_FLAGS:=nonshared | ||||||
|  |  | ||||||
| include $(INCLUDE_DIR)/package.mk | include $(INCLUDE_DIR)/package.mk | ||||||
|  |  | ||||||
| define rcw/Default | define rcw/Default | ||||||
|   | |||||||
| @@ -81,3 +81,32 @@ | |||||||
|   |   | ||||||
|  	adev->channel = channel; |  	adev->channel = channel; | ||||||
|   |   | ||||||
|  | --- a/merge.c | ||||||
|  | +++ b/merge.c | ||||||
|  | @@ -2776,7 +2776,10 @@ void acx_irq_work(struct work_struct *wo | ||||||
|  |  		/* HOST_INT_SCAN_COMPLETE */ | ||||||
|  |  		if (irqmasked & HOST_INT_SCAN_COMPLETE) { | ||||||
|  |  			if (test_bit(ACX_FLAG_SCANNING, &adev->flags)) { | ||||||
|  | -				ieee80211_scan_completed(adev->hw, false); | ||||||
|  | +				struct cfg80211_scan_info info = { | ||||||
|  | +					.aborted = false | ||||||
|  | +				}; | ||||||
|  | +				ieee80211_scan_completed(adev->hw, &info); | ||||||
|  |  				log(L_INIT, "scan completed\n"); | ||||||
|  |  				clear_bit(ACX_FLAG_SCANNING, &adev->flags); | ||||||
|  |  			} | ||||||
|  | @@ -3138,10 +3141,13 @@ int acx_op_start(struct ieee80211_hw *hw | ||||||
|  |   | ||||||
|  |  void acx_stop(acx_device_t *adev) | ||||||
|  |  { | ||||||
|  | +	struct cfg80211_scan_info info = { | ||||||
|  | +		.aborted = true | ||||||
|  | +	}; | ||||||
|  |  	acxmem_lock_flags; | ||||||
|  |   | ||||||
|  |  	if (test_bit(ACX_FLAG_SCANNING, &adev->flags)) { | ||||||
|  | -		ieee80211_scan_completed(adev->hw, true); | ||||||
|  | +		ieee80211_scan_completed(adev->hw, &info); | ||||||
|  |  		acx_issue_cmd(adev, ACX1xx_CMD_STOP_SCAN, NULL, 0); | ||||||
|  |  		clear_bit(ACX_FLAG_SCANNING, &adev->flags); | ||||||
|  |  	} | ||||||
|   | |||||||
| @@ -8,9 +8,9 @@ PKG_LICENSE_FILES:= | |||||||
|  |  | ||||||
| PKG_SOURCE_URL:=https://github.com/greearb/ath10k-ct.git | PKG_SOURCE_URL:=https://github.com/greearb/ath10k-ct.git | ||||||
| PKG_SOURCE_PROTO:=git | PKG_SOURCE_PROTO:=git | ||||||
| PKG_SOURCE_DATE:=2017-01-10 | PKG_SOURCE_DATE:=2017-01-26 | ||||||
| PKG_SOURCE_VERSION:=f5bacb83baf95e887c50c286606f4f565ef71d86 | PKG_SOURCE_VERSION:=d2bc84ff277936c58231f0c2280242eda4199e63 | ||||||
| PKG_MIRROR_HASH:=845950a177ed6dd7ad3f645df79403e9980f089a09b66e74a9b88abe58dfe5e6 | PKG_MIRROR_HASH:=6b734b987db00b97b06faca686dcebc56fb23b93093afbb35d5cf534987269bf | ||||||
|  |  | ||||||
| PKG_MAINTAINER:=Ben Greear <greearb@candelatech.com> | PKG_MAINTAINER:=Ben Greear <greearb@candelatech.com> | ||||||
| PKG_BUILD_PARALLEL:=1 | PKG_BUILD_PARALLEL:=1 | ||||||
| @@ -23,7 +23,7 @@ include $(INCLUDE_DIR)/package.mk | |||||||
| define KernelPackage/ath10k-ct | define KernelPackage/ath10k-ct | ||||||
|   SUBMENU:=Wireless Drivers |   SUBMENU:=Wireless Drivers | ||||||
|   TITLE:=ath10k-ct driver optimized for CT ath10k firmware |   TITLE:=ath10k-ct driver optimized for CT ath10k firmware | ||||||
|   DEPENDS:=+kmod-mac80211 +kmod-ath +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT @PCI_SUPPORT +@KERNEL_RELAY |   DEPENDS:=+kmod-mac80211 +kmod-ath +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT @PCI_SUPPORT +@KERNEL_RELAY +kmod-hwmon-core | ||||||
|   FILES:=\ |   FILES:=\ | ||||||
| 	$(PKG_BUILD_DIR)/ath10k/ath10k_pci.ko \ | 	$(PKG_BUILD_DIR)/ath10k/ath10k_pci.ko \ | ||||||
| 	$(PKG_BUILD_DIR)/ath10k/ath10k_core.ko | 	$(PKG_BUILD_DIR)/ath10k/ath10k_core.ko | ||||||
|   | |||||||
							
								
								
									
										97
									
								
								package/kernel/ath10k-ct/patches/100-kernel_compat.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										97
									
								
								package/kernel/ath10k-ct/patches/100-kernel_compat.patch
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,97 @@ | |||||||
|  | --- a/ath10k/debug.c | ||||||
|  | +++ b/ath10k/debug.c | ||||||
|  | @@ -166,11 +166,11 @@ void ath10k_debug_print_hwfw_info(struct | ||||||
|  |  		    ar->id.subsystem_vendor, ar->id.subsystem_device); | ||||||
|  |   | ||||||
|  |  	ath10k_info(ar, "kconfig debug %d debugfs %d tracing %d dfs %d testmode %d\n", | ||||||
|  | -		    config_enabled(CONFIG_ATH10K_DEBUG), | ||||||
|  | -		    config_enabled(CONFIG_ATH10K_DEBUGFS), | ||||||
|  | -		    config_enabled(CONFIG_ATH10K_TRACING), | ||||||
|  | -		    config_enabled(CONFIG_ATH10K_DFS_CERTIFIED), | ||||||
|  | -		    config_enabled(CONFIG_NL80211_TESTMODE)); | ||||||
|  | +		    IS_ENABLED(CONFIG_ATH10K_DEBUG), | ||||||
|  | +		    IS_ENABLED(CONFIG_ATH10K_DEBUGFS), | ||||||
|  | +		    IS_ENABLED(CONFIG_ATH10K_TRACING), | ||||||
|  | +		    IS_ENABLED(CONFIG_ATH10K_DFS_CERTIFIED), | ||||||
|  | +		    IS_ENABLED(CONFIG_NL80211_TESTMODE)); | ||||||
|  |   | ||||||
|  |  	firmware = ar->normal_mode_fw.fw_file.firmware; | ||||||
|  |  	if (firmware) | ||||||
|  | @@ -3397,7 +3397,7 @@ int ath10k_debug_register(struct ath10k | ||||||
|  |  	debugfs_create_file("nf_cal_period", S_IRUSR | S_IWUSR, | ||||||
|  |  			    ar->debug.debugfs_phy, ar, &fops_nf_cal_period); | ||||||
|  |   | ||||||
|  | -	if (config_enabled(CONFIG_ATH10K_DFS_CERTIFIED)) { | ||||||
|  | +	if (IS_ENABLED(CONFIG_ATH10K_DFS_CERTIFIED)) { | ||||||
|  |  		debugfs_create_file("dfs_simulate_radar", S_IWUSR, | ||||||
|  |  				    ar->debug.debugfs_phy, ar, | ||||||
|  |  				    &fops_simulate_radar); | ||||||
|  | --- a/ath10k/mac.c | ||||||
|  | +++ b/ath10k/mac.c | ||||||
|  | @@ -3556,7 +3556,7 @@ static void ath10k_regd_update(struct at | ||||||
|  |   | ||||||
|  |  	regpair = ar->ath_common.regulatory.regpair; | ||||||
|  |   | ||||||
|  | -	if (config_enabled(CONFIG_ATH10K_DFS_CERTIFIED) && ar->dfs_detector) { | ||||||
|  | +	if (IS_ENABLED(CONFIG_ATH10K_DFS_CERTIFIED) && ar->dfs_detector) { | ||||||
|  |  		nl_dfs_reg = ar->dfs_detector->region; | ||||||
|  |  		wmi_dfs_reg = ath10k_mac_get_dfs_region(nl_dfs_reg); | ||||||
|  |  		ath10k_dbg(ar, ATH10K_DBG_REGULATORY, | ||||||
|  | @@ -3590,7 +3590,7 @@ static void ath10k_reg_notifier(struct w | ||||||
|  |   | ||||||
|  |  	ath_reg_notifier_apply(wiphy, request, &ar->ath_common.regulatory); | ||||||
|  |   | ||||||
|  | -	if (config_enabled(CONFIG_ATH10K_DFS_CERTIFIED) && ar->dfs_detector) { | ||||||
|  | +	if (IS_ENABLED(CONFIG_ATH10K_DFS_CERTIFIED) && ar->dfs_detector) { | ||||||
|  |  		ath10k_dbg(ar, ATH10K_DBG_REGULATORY, "reg-notifier: dfs region 0x%x\n", | ||||||
|  |  			   request->dfs_region); | ||||||
|  |  		result = ar->dfs_detector->set_dfs_domain(ar->dfs_detector, | ||||||
|  | @@ -8863,7 +8863,7 @@ int ath10k_mac_register(struct ath10k *a | ||||||
|  |  	if (!test_bit(ATH10K_FLAG_RAW_MODE, &ar->dev_flags)) | ||||||
|  |  		ar->hw->netdev_features = NETIF_F_HW_CSUM; | ||||||
|  |   | ||||||
|  | -	if (config_enabled(CONFIG_ATH10K_DFS_CERTIFIED)) { | ||||||
|  | +	if (IS_ENABLED(CONFIG_ATH10K_DFS_CERTIFIED)) { | ||||||
|  |  		/* Init ath dfs pattern detector */ | ||||||
|  |  		ar->ath_common.debug_mask = ATH_DBG_DFS; | ||||||
|  |  		ar->dfs_detector = dfs_pattern_detector_init(&ar->ath_common, | ||||||
|  | @@ -8908,7 +8908,7 @@ err_unregister: | ||||||
|  |  	ieee80211_unregister_hw(ar->hw); | ||||||
|  |   | ||||||
|  |  err_dfs_detector_exit: | ||||||
|  | -	if (config_enabled(CONFIG_ATH10K_DFS_CERTIFIED) && ar->dfs_detector) | ||||||
|  | +	if (IS_ENABLED(CONFIG_ATH10K_DFS_CERTIFIED) && ar->dfs_detector) | ||||||
|  |  		ar->dfs_detector->exit(ar->dfs_detector); | ||||||
|  |   | ||||||
|  |  err_free: | ||||||
|  | @@ -8923,7 +8923,7 @@ void ath10k_mac_unregister(struct ath10k | ||||||
|  |  { | ||||||
|  |  	ieee80211_unregister_hw(ar->hw); | ||||||
|  |   | ||||||
|  | -	if (config_enabled(CONFIG_ATH10K_DFS_CERTIFIED) && ar->dfs_detector) | ||||||
|  | +	if (IS_ENABLED(CONFIG_ATH10K_DFS_CERTIFIED) && ar->dfs_detector) | ||||||
|  |  		ar->dfs_detector->exit(ar->dfs_detector); | ||||||
|  |   | ||||||
|  |  	kfree(ar->mac.sbands[NL80211_BAND_2GHZ].channels); | ||||||
|  | --- a/ath10k/thermal.c | ||||||
|  | +++ b/ath10k/thermal.c | ||||||
|  | @@ -192,7 +192,7 @@ int ath10k_thermal_register(struct ath10 | ||||||
|  |   | ||||||
|  |  	/* Avoid linking error on devm_hwmon_device_register_with_groups, I | ||||||
|  |  	 * guess linux/hwmon.h is missing proper stubs. */ | ||||||
|  | -	if (!config_enabled(CONFIG_HWMON)) | ||||||
|  | +	if (!IS_ENABLED(CONFIG_HWMON)) | ||||||
|  |  		return 0; | ||||||
|  |   | ||||||
|  |  	hwmon_dev = devm_hwmon_device_register_with_groups(ar->dev, | ||||||
|  | --- a/ath10k/wmi.c | ||||||
|  | +++ b/ath10k/wmi.c | ||||||
|  | @@ -3788,7 +3788,7 @@ void ath10k_wmi_event_dfs(struct ath10k | ||||||
|  |  		   phyerr->tsf_timestamp, tsf, buf_len); | ||||||
|  |   | ||||||
|  |  	/* Skip event if DFS disabled */ | ||||||
|  | -	if (!config_enabled(CONFIG_ATH10K_DFS_CERTIFIED)) | ||||||
|  | +	if (!IS_ENABLED(CONFIG_ATH10K_DFS_CERTIFIED)) | ||||||
|  |  		return; | ||||||
|  |   | ||||||
|  |  	ATH10K_DFS_STAT_INC(ar, pulses_total); | ||||||
							
								
								
									
										11
									
								
								package/kernel/ath10k-ct/patches/110-api_fix.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								package/kernel/ath10k-ct/patches/110-api_fix.patch
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | |||||||
|  | --- a/ath10k/htt_rx.c | ||||||
|  | +++ b/ath10k/htt_rx.c | ||||||
|  | @@ -2490,7 +2490,7 @@ bool ath10k_htt_t2h_msg_handler(struct a | ||||||
|  |  		u32 freq = __le32_to_cpu(resp->chan_change.freq); | ||||||
|  |   | ||||||
|  |  		ar->tgt_oper_chan = | ||||||
|  | -			__ieee80211_get_channel(ar->hw->wiphy, freq); | ||||||
|  | +			ieee80211_get_channel(ar->hw->wiphy, freq); | ||||||
|  |  		ath10k_dbg(ar, ATH10K_DBG_HTT, | ||||||
|  |  			   "htt chan change freq %u phymode %s\n", | ||||||
|  |  			   freq, ath10k_wmi_phymode_str(phymode)); | ||||||
| @@ -1,6 +1,6 @@ | |||||||
| # | # | ||||||
| # Copyright (C) 2012-2016 OpenWrt.org | # Copyright (C) 2012-2016 OpenWrt.org | ||||||
| # Copyright (C) 2016 LEDE project | # Copyright (C) 2017 LEDE project | ||||||
| # | # | ||||||
| # This is free software, licensed under the GNU General Public License v2. | # This is free software, licensed under the GNU General Public License v2. | ||||||
| # See /LICENSE for more information. | # See /LICENSE for more information. | ||||||
| @@ -9,8 +9,8 @@ include $(TOPDIR)/rules.mk | |||||||
| include $(INCLUDE_DIR)/kernel.mk | include $(INCLUDE_DIR)/kernel.mk | ||||||
|  |  | ||||||
| PKG_NAME:=brcm2708-gpu-fw | PKG_NAME:=brcm2708-gpu-fw | ||||||
| PKG_VERSION:=2016-12-04 | PKG_VERSION:=2017-03-03 | ||||||
| PKG_RELEASE:=d760a4ffd378c648ff5d9854e26dc868a5e1fd09 | PKG_RELEASE:=78c4983379de0537f49a97fb37ceaaf42632b28c | ||||||
|  |  | ||||||
| PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)/rpi-firmware-$(PKG_RELEASE) | PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)/rpi-firmware-$(PKG_RELEASE) | ||||||
|  |  | ||||||
| @@ -33,7 +33,7 @@ define Download/bootcode_bin | |||||||
|   FILE:=$(RPI_FIRMWARE_FILE)-bootcode.bin |   FILE:=$(RPI_FIRMWARE_FILE)-bootcode.bin | ||||||
|   URL:=$(RPI_FIRMWARE_URL) |   URL:=$(RPI_FIRMWARE_URL) | ||||||
|   URL_FILE:=bootcode.bin |   URL_FILE:=bootcode.bin | ||||||
|   HASH:=a11bd31647c25712648757be75a19fa78c1df6f2409c7bf9bd202903f0421c0c |   HASH:=d990031baec20fe2cd5e24d9f3d6fc34891afdb128838d010d9a0249ae29ea6b | ||||||
| endef | endef | ||||||
| $(eval $(call Download,bootcode_bin)) | $(eval $(call Download,bootcode_bin)) | ||||||
|  |  | ||||||
| @@ -41,7 +41,7 @@ define Download/fixup_dat | |||||||
|   FILE:=$(RPI_FIRMWARE_FILE)-fixup.dat |   FILE:=$(RPI_FIRMWARE_FILE)-fixup.dat | ||||||
|   URL:=$(RPI_FIRMWARE_URL) |   URL:=$(RPI_FIRMWARE_URL) | ||||||
|   URL_FILE:=fixup.dat |   URL_FILE:=fixup.dat | ||||||
|   HASH:=93314d9e01fb53bdf4a25422de89d103cd2e779bd5e81663c658eaecd0c8018e |   HASH:=38b69384f62bc7b64f17dcedc03c5582af6b4f8dfc25fe5904d4eb3181a3387b | ||||||
| endef | endef | ||||||
| $(eval $(call Download,fixup_dat)) | $(eval $(call Download,fixup_dat)) | ||||||
|  |  | ||||||
| @@ -49,7 +49,7 @@ define Download/fixup_cd_dat | |||||||
|   FILE:=$(RPI_FIRMWARE_FILE)-fixup_cd.dat |   FILE:=$(RPI_FIRMWARE_FILE)-fixup_cd.dat | ||||||
|   URL:=$(RPI_FIRMWARE_URL) |   URL:=$(RPI_FIRMWARE_URL) | ||||||
|   URL_FILE:=fixup_cd.dat |   URL_FILE:=fixup_cd.dat | ||||||
|   HASH:=638671b81590bfdda5eac683d2025e50bb71c663e702f047ef299e23722f6cdd |   HASH:=05c682ffcc74cd1356f1b9a32a7034763bfea94e5cb54eaaa2e69affc1cd33d7 | ||||||
| endef | endef | ||||||
| $(eval $(call Download,fixup_cd_dat)) | $(eval $(call Download,fixup_cd_dat)) | ||||||
|  |  | ||||||
| @@ -57,7 +57,7 @@ define Download/start_elf | |||||||
|   FILE:=$(RPI_FIRMWARE_FILE)-start.elf |   FILE:=$(RPI_FIRMWARE_FILE)-start.elf | ||||||
|   URL:=$(RPI_FIRMWARE_URL) |   URL:=$(RPI_FIRMWARE_URL) | ||||||
|   URL_FILE:=start.elf |   URL_FILE:=start.elf | ||||||
|   HASH:=cd60fdce9022fa1195a27f3fdf8eba9136476649006e33b72cbdb23dc3b74e90 |   HASH:=59b9d26b463a84f017fae186493bb54e642de6c7e0376b3cbe3375df6132edc0 | ||||||
| endef | endef | ||||||
| $(eval $(call Download,start_elf)) | $(eval $(call Download,start_elf)) | ||||||
|  |  | ||||||
| @@ -65,7 +65,7 @@ define Download/start_cd_elf | |||||||
|   FILE:=$(RPI_FIRMWARE_FILE)-start_cd.elf |   FILE:=$(RPI_FIRMWARE_FILE)-start_cd.elf | ||||||
|   URL:=$(RPI_FIRMWARE_URL) |   URL:=$(RPI_FIRMWARE_URL) | ||||||
|   URL_FILE:=start_cd.elf |   URL_FILE:=start_cd.elf | ||||||
|   HASH:=2f0cdcdaad7b9bf64f5288e206d54e007597c0c4068a5b893c02e0f4c0785ca5 |   HASH:=fb9aea03eb6790062c100166444bf7d2b8a6cea605bd041f905fcacefacbbae2 | ||||||
| endef | endef | ||||||
| $(eval $(call Download,start_cd_elf)) | $(eval $(call Download,start_cd_elf)) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,92 +0,0 @@ | |||||||
| # |  | ||||||
| # Copyright (C) 2010 OpenWrt.org |  | ||||||
| # |  | ||||||
| # This is free software, licensed under the GNU General Public License v2. |  | ||||||
| # See /LICENSE for more information. |  | ||||||
| # |  | ||||||
|  |  | ||||||
| include $(TOPDIR)/rules.mk |  | ||||||
| include $(INCLUDE_DIR)/kernel.mk |  | ||||||
|  |  | ||||||
| PKG_NAME:=ep80579-drivers |  | ||||||
| PKG_VERSION:=1.0.34 |  | ||||||
| PKG_RELEASE:=1 |  | ||||||
|  |  | ||||||
| PKG_SOURCE:=Embedded.L.1.0.34.ADI.R100.tar.gz |  | ||||||
| PKG_SOURCE_URL:=ftp://ftp.adiengineering.com/Archive/OcracokeIsland/Drivers/Linux/1.0.34/ |  | ||||||
| PKG_HASH:=f00684176a3dd1dc9ea8d96ecd1ecade5103f351ed93b9e3a5ff5f3f3295e2a9 |  | ||||||
|  |  | ||||||
| PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) |  | ||||||
|  |  | ||||||
| include $(INCLUDE_DIR)/package.mk |  | ||||||
|  |  | ||||||
| define KernelPackage/ep80579-drivers/Default |  | ||||||
|   DEPENDS:=@TARGET_x86_ep80579 |  | ||||||
| endef |  | ||||||
|  |  | ||||||
| define KernelPackage/ep80579-eth |  | ||||||
| $(call KernelPackage/ep80579-drivers/Default) |  | ||||||
|   SUBMENU:=Network Devices |  | ||||||
|   TITLE:=Intel EP80579 ethernet driver |  | ||||||
|   FILES:= \ |  | ||||||
| 	$(PKG_BUILD_DIR)/Embedded/src/GbE/gcu.ko \ |  | ||||||
| 	$(PKG_BUILD_DIR)/Embedded/src/GbE/iegbe.ko |  | ||||||
|   AUTOLOAD:=$(call AutoLoad,40,gcu iegbe) |  | ||||||
| endef |  | ||||||
|  |  | ||||||
| define KernelPackage/ep80579-misc |  | ||||||
| $(call KernelPackage/ep80579-drivers/Default) |  | ||||||
|   SUBMENU:=Other modules |  | ||||||
|   TITLE:=Misc. Intel EP80579 drivers (DMA,, gpio) |  | ||||||
|   FILES:= \ |  | ||||||
| 	$(PKG_BUILD_DIR)/Embedded/src/EDMA/dma.ko \ |  | ||||||
| 	$(PKG_BUILD_DIR)/Embedded/src/GPIO/gpio.ko |  | ||||||
|   AUTOLOAD:=$(call AutoLoad,40,gpio dma) |  | ||||||
| endef |  | ||||||
|  |  | ||||||
| define KernelPackage/ep80579-can |  | ||||||
| $(call KernelPackage/ep80579-drivers/Default) |  | ||||||
|   SUBMENU:=Other modules |  | ||||||
|   TITLE:=Intel EP80579 CAN driver |  | ||||||
|   FILES:= \ |  | ||||||
| 	$(PKG_BUILD_DIR)/Embedded/src/1588/timesync.ko \ |  | ||||||
| 	$(PKG_BUILD_DIR)/Embedded/src/CAN/can.ko |  | ||||||
|   AUTOLOAD:=$(call AutoLoad,40,timesync can) |  | ||||||
| endef |  | ||||||
|  |  | ||||||
| define Build/Prepare |  | ||||||
| 	rm -rf $(PKG_BUILD_DIR) |  | ||||||
| 	mkdir -p $(PKG_BUILD_DIR) |  | ||||||
| 	tar xzvf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR)/ |  | ||||||
| 	$(Build/Patch) |  | ||||||
| endef |  | ||||||
|  |  | ||||||
| define Build/Compile/Subdir |  | ||||||
| 	$(MAKE) -C "$(LINUX_DIR)" \ |  | ||||||
| 		KSRC="$(LINUX_DIR)" \ |  | ||||||
| 		KOBJ="$(LINUX_DIR)" \ |  | ||||||
| 		ENV_DIR=$(PKG_BUILD_DIR)/Embedded \ |  | ||||||
| 		SUBDIRS="$(PKG_BUILD_DIR)/Embedded/src/$(1)" \ |  | ||||||
| 		CROSS_COMPILE="$(TARGET_CROSS)" \ |  | ||||||
| 		ARCHIVER="$(TARGET_CROSS)ar" \ |  | ||||||
| 		COMPILER="$(TARGET_CC)" \ |  | ||||||
| 		LINKER="$(TARGET_CROSS)ld" \ |  | ||||||
| 		ARCH="$(LINUX_KARCH)" |  | ||||||
| endef |  | ||||||
|  |  | ||||||
| define Build/Compile |  | ||||||
| 	$(call Build/Compile/Subdir,GbE) |  | ||||||
| 	$(call Build/Compile/Subdir,CAN) |  | ||||||
| 	$(call Build/Compile/Subdir,EDMA) |  | ||||||
| 	$(call Build/Compile/Subdir,GPIO) |  | ||||||
| 	$(call Build/Compile/Subdir,WDT) |  | ||||||
| 	$(call Build/Compile/Subdir,1588) |  | ||||||
| endef |  | ||||||
|  |  | ||||||
| define KernelPackage/ep80579-eth/install |  | ||||||
| endef |  | ||||||
|  |  | ||||||
| $(eval $(call KernelPackage,ep80579-can)) |  | ||||||
| $(eval $(call KernelPackage,ep80579-eth)) |  | ||||||
| $(eval $(call KernelPackage,ep80579-misc)) |  | ||||||
|  |  | ||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -1,22 +0,0 @@ | |||||||
| --- a/build_system/build_files/common.mk |  | ||||||
| +++ b/build_system/build_files/common.mk |  | ||||||
| @@ -122,7 +122,7 @@ CC=$(COMPILER) |  | ||||||
|  LD=$(LINKER) |  | ||||||
|  AR=$(ARCHIVER) |  | ||||||
|   |  | ||||||
| -CFLAGS+=-O2 |  | ||||||
| +#CFLAGS+=-O2 |  | ||||||
|   |  | ||||||
|   |  | ||||||
|  PWD= $(shell pwd) |  | ||||||
| --- a/build_system/build_files/OS/linux_2.6.mk |  | ||||||
| +++ b/build_system/build_files/OS/linux_2.6.mk |  | ||||||
| @@ -80,7 +80,7 @@ endif |  | ||||||
|   |  | ||||||
|   |  | ||||||
|  ifeq ($(OS_LEVEL), kernel_space) |  | ||||||
| -CFLAGS+=  |  | ||||||
| +#CFLAGS+=  |  | ||||||
|  endif |  | ||||||
|   |  | ||||||
|   |  | ||||||
| @@ -1,53 +0,0 @@ | |||||||
| --- a/Embedded/src/1588/1588.c |  | ||||||
| +++ b/Embedded/src/1588/1588.c |  | ||||||
| @@ -291,7 +291,7 @@ int pci_probe(struct pci_dev *dev, const |  | ||||||
|   |  | ||||||
|      } |  | ||||||
|   |  | ||||||
| -    if ( request_irq(dev->irq, ×ync_isr, SA_SHIRQ, DRIVERNAME, |  | ||||||
| +    if ( request_irq(dev->irq, ×ync_isr, IRQF_SHARED, DRIVERNAME, |  | ||||||
|           &g_drvr_data) ) |  | ||||||
|      { |  | ||||||
|        printk("%s-pci_probe: irq\n", DRIVERNAME); |  | ||||||
| --- a/Embedded/src/CAN/can_main.c |  | ||||||
| +++ b/Embedded/src/CAN/can_main.c |  | ||||||
| @@ -424,7 +424,7 @@ int can_open(struct inode *inode, struct |  | ||||||
|      err = request_irq( |  | ||||||
|          can_os->irq, |  | ||||||
|          can_irq_handler, |  | ||||||
| -        SA_SHIRQ, |  | ||||||
| +        IRQF_SHARED, |  | ||||||
|          iminor(can_os->inode) ? CAN_PROC_1 : CAN_PROC_0, |  | ||||||
|          &(g_can_os[iminor(can_os->inode)]) |  | ||||||
|          ); |  | ||||||
| --- a/Embedded/src/EDMA/dma_linux.c |  | ||||||
| +++ b/Embedded/src/EDMA/dma_linux.c |  | ||||||
| @@ -367,7 +367,7 @@ int32_t edma_resume(struct pci_dev *dev) |  | ||||||
|          return -ENODEV; |  | ||||||
|      } |  | ||||||
|   |  | ||||||
| -    if (request_irq(dev->irq, &edma_irq_handler, SA_SHIRQ, |  | ||||||
| +    if (request_irq(dev->irq, &edma_irq_handler, IRQF_SHARED, |  | ||||||
|                          g_char_drvr_name, dev) ) |  | ||||||
|      { |  | ||||||
|   |  | ||||||
| @@ -829,7 +829,7 @@ int32_t edma_probe(struct pci_dev * dev, |  | ||||||
|      /* |  | ||||||
|      * Obtain a (shared) Interrupt Request (IRQ) Line from the OS. |  | ||||||
|      */ |  | ||||||
| -    if (request_irq(dev->irq, &edma_irq_handler, SA_SHIRQ, |  | ||||||
| +    if (request_irq(dev->irq, &edma_irq_handler, IRQF_SHARED, |  | ||||||
|                          g_char_drvr_name, dev) ) |  | ||||||
|      { |  | ||||||
|   |  | ||||||
| --- a/Embedded/src/WDT/iwdt.c |  | ||||||
| +++ b/Embedded/src/WDT/iwdt.c |  | ||||||
| @@ -1461,7 +1461,7 @@ static int __init wdt_init_one(struct pc |  | ||||||
|   |  | ||||||
|       /* Request irq only if wdt_irq is other than 0 */ |  | ||||||
|       if (wdt_irq) { |  | ||||||
| -        if (request_irq(wdt_irq, wdt_isr, SA_INTERRUPT | SA_SHIRQ, |  | ||||||
| +        if (request_irq(wdt_irq, wdt_isr, IRQF_DISABLED | IRQF_SHARED, |  | ||||||
|             "iwdt", &wdt_miscdev)) { |  | ||||||
|             printk("IRQ %d is not free.\n", wdt_irq); |  | ||||||
|             return -EIO; |  | ||||||
| @@ -1,56 +0,0 @@ | |||||||
| --- a/Embedded/src/GbE/iegbe_main.c |  | ||||||
| +++ b/Embedded/src/GbE/iegbe_main.c |  | ||||||
| @@ -724,6 +724,26 @@ static void iegbe_dump_eeprom(struct ieg |  | ||||||
|  	kfree(data); |  | ||||||
|  } |  | ||||||
|   |  | ||||||
| +static const struct net_device_ops iegbe_netdev_ops = { |  | ||||||
| +	.ndo_open		= iegbe_open, |  | ||||||
| +	.ndo_stop		= iegbe_close, |  | ||||||
| +	.ndo_start_xmit		= iegbe_xmit_frame, |  | ||||||
| +	.ndo_get_stats		= iegbe_get_stats, |  | ||||||
| +	.ndo_set_rx_mode	= iegbe_set_rx_mode, |  | ||||||
| +	.ndo_set_mac_address	= iegbe_set_mac, |  | ||||||
| +	.ndo_tx_timeout		= iegbe_tx_timeout, |  | ||||||
| +	.ndo_change_mtu		= iegbe_change_mtu, |  | ||||||
| +	.ndo_do_ioctl		= iegbe_ioctl, |  | ||||||
| +	.ndo_validate_addr	= eth_validate_addr, |  | ||||||
| + |  | ||||||
| +	.ndo_vlan_rx_register	= iegbe_vlan_rx_register, |  | ||||||
| +	.ndo_vlan_rx_add_vid	= iegbe_vlan_rx_add_vid, |  | ||||||
| +	.ndo_vlan_rx_kill_vid	= iegbe_vlan_rx_kill_vid, |  | ||||||
| +#ifdef CONFIG_NET_POLL_CONTROLLER |  | ||||||
| +	.ndo_poll_controller	= iegbe_netpoll, |  | ||||||
| +#endif |  | ||||||
| +}; |  | ||||||
| + |  | ||||||
|  /** |  | ||||||
|   * iegbe_probe - Device Initialization Routine |  | ||||||
|   * @pdev: PCI device information struct |  | ||||||
| @@ -800,24 +820,11 @@ static int __devinit iegbe_probe(struct |  | ||||||
|  	if (!hw->hw_addr) |  | ||||||
|          goto err_ioremap; |  | ||||||
|   |  | ||||||
| -    netdev->open = &iegbe_open; |  | ||||||
| -    netdev->stop = &iegbe_close; |  | ||||||
| -    netdev->hard_start_xmit = &iegbe_xmit_frame; |  | ||||||
| -    netdev->get_stats = &iegbe_get_stats; |  | ||||||
| -	netdev->set_rx_mode = &iegbe_set_rx_mode; |  | ||||||
| -	netdev->set_mac_address = &iegbe_set_mac; |  | ||||||
| -    netdev->change_mtu = &iegbe_change_mtu; |  | ||||||
| -    netdev->do_ioctl = &iegbe_ioctl; |  | ||||||
| +	netdev->netdev_ops = &iegbe_netdev_ops; |  | ||||||
|  	set_ethtool_ops(netdev); |  | ||||||
| -    netdev->tx_timeout = &iegbe_tx_timeout; |  | ||||||
|  	netdev->watchdog_timeo = 5 * HZ; |  | ||||||
|  	netif_napi_add(netdev, &adapter->napi, iegbe_clean, 64); |  | ||||||
| -    netdev->vlan_rx_register = iegbe_vlan_rx_register; |  | ||||||
| -    netdev->vlan_rx_add_vid = iegbe_vlan_rx_add_vid; |  | ||||||
| -    netdev->vlan_rx_kill_vid = iegbe_vlan_rx_kill_vid; |  | ||||||
| -#ifdef CONFIG_NET_POLL_CONTROLLER |  | ||||||
| -    netdev->poll_controller = iegbe_netpoll; |  | ||||||
| -#endif |  | ||||||
| + |  | ||||||
|  	strncpy(netdev->name, pci_name(pdev), sizeof(netdev->name) - 1); |  | ||||||
|   |  | ||||||
|   |  | ||||||
| @@ -1,41 +0,0 @@ | |||||||
| --- a/Embedded/src/GbE/iegbe_main.c |  | ||||||
| +++ b/Embedded/src/GbE/iegbe_main.c |  | ||||||
| @@ -3465,12 +3465,12 @@ static irqreturn_t iegbe_intr_msi(int ir |  | ||||||
|  	    printk("Critical error! ICR = 0x%x\n", icr); |  | ||||||
|  	    return IRQ_HANDLED; |  | ||||||
|  	} |  | ||||||
| -	if (likely(netif_rx_schedule_prep(netdev, &adapter->napi))) { |  | ||||||
| +	if (likely(napi_schedule_prep(&adapter->napi))) { |  | ||||||
|  		adapter->total_tx_bytes = 0; |  | ||||||
|  		adapter->total_tx_packets = 0; |  | ||||||
|  		adapter->total_rx_bytes = 0; |  | ||||||
|  		adapter->total_rx_packets = 0; |  | ||||||
| -		__netif_rx_schedule(netdev, &adapter->napi); |  | ||||||
| +		__napi_schedule(&adapter->napi); |  | ||||||
|  	} else |  | ||||||
|  		iegbe_irq_enable(adapter); |  | ||||||
|   |  | ||||||
| @@ -3527,12 +3527,12 @@ iegbe_intr(int irq, void *data) |  | ||||||
|  		E1000_WRITE_REG(&adapter->hw, IMC, ~0); |  | ||||||
|  		E1000_WRITE_FLUSH(&adapter->hw); |  | ||||||
|  	} |  | ||||||
| -	if (likely(netif_rx_schedule_prep(netdev, &adapter->napi))) { |  | ||||||
| +	if (likely(napi_schedule_prep(&adapter->napi))) { |  | ||||||
|  		adapter->total_tx_bytes = 0; |  | ||||||
|  		adapter->total_tx_packets = 0; |  | ||||||
|  		adapter->total_rx_bytes = 0; |  | ||||||
|  		adapter->total_rx_packets = 0; |  | ||||||
| -		__netif_rx_schedule(netdev, &adapter->napi); |  | ||||||
| +		__napi_schedule(&adapter->napi); |  | ||||||
|  	} else |  | ||||||
|  		/* this really should not happen! if it does it is basically a |  | ||||||
|  		 * bug, but not a hard error, so enable ints and continue */ |  | ||||||
| @@ -3574,7 +3574,7 @@ static int iegbe_clean(struct napi_struc |  | ||||||
|  	if (work_done < budget) { |  | ||||||
|  		if (likely(adapter->itr_setting & 3)) |  | ||||||
|  			iegbe_set_itr(adapter); |  | ||||||
| -		netif_rx_complete(poll_dev, napi); |  | ||||||
| +		napi_complete(napi); |  | ||||||
|  		iegbe_irq_enable(adapter); |  | ||||||
|  	} |  | ||||||
|   |  | ||||||
| @@ -1,103 +0,0 @@ | |||||||
| --- a/Embedded/src/GbE/iegbe.h |  | ||||||
| +++ b/Embedded/src/GbE/iegbe.h |  | ||||||
| @@ -316,7 +316,6 @@ struct iegbe_adapter { |  | ||||||
|  				int cleaned_count); |  | ||||||
|  	struct iegbe_rx_ring *rx_ring;      /* One per active queue */ |  | ||||||
|  	struct napi_struct napi; |  | ||||||
| -	struct net_device *polling_netdev;  /* One per active queue */ |  | ||||||
|   |  | ||||||
|  	int num_tx_queues; |  | ||||||
|  	int num_rx_queues; |  | ||||||
| --- a/Embedded/src/GbE/iegbe_main.c |  | ||||||
| +++ b/Embedded/src/GbE/iegbe_main.c |  | ||||||
| @@ -763,7 +763,7 @@ static int __devinit iegbe_probe(struct |  | ||||||
|  	struct iegbe_hw *hw; |  | ||||||
|   |  | ||||||
|  	static int cards_found = 0; |  | ||||||
| -    int i, err, pci_using_dac; |  | ||||||
| +	int err, pci_using_dac; |  | ||||||
|  	u16 eeprom_data = 0; |  | ||||||
|  	u16 eeprom_apme_mask = E1000_EEPROM_APME; |  | ||||||
|  	int bars;  |  | ||||||
| @@ -984,11 +984,8 @@ err_eeprom: |  | ||||||
|  		iegbe_phy_hw_reset(hw); |  | ||||||
|  	if (hw->flash_address) |  | ||||||
|  		iounmap(hw->flash_address); |  | ||||||
| -	for (i = 0; i < adapter->num_rx_queues; i++) |  | ||||||
| -		dev_put(&adapter->polling_netdev[i]); |  | ||||||
|  	kfree(adapter->tx_ring); |  | ||||||
|  	kfree(adapter->rx_ring); |  | ||||||
| -	kfree(adapter->polling_netdev); |  | ||||||
|  err_sw_init: |  | ||||||
|  	iounmap(hw->hw_addr); |  | ||||||
|  err_ioremap: |  | ||||||
| @@ -1017,7 +1014,6 @@ iegbe_remove(struct pci_dev *pdev) |  | ||||||
|      struct net_device *netdev = pci_get_drvdata(pdev); |  | ||||||
|      struct iegbe_adapter *adapter = netdev_priv(netdev); |  | ||||||
|      uint32_t manc; |  | ||||||
| -    int i; |  | ||||||
|   |  | ||||||
|      if(adapter->hw.mac_type >= iegbe_82540 |  | ||||||
|         && adapter->hw.mac_type != iegbe_icp_xxxx |  | ||||||
| @@ -1030,15 +1026,11 @@ iegbe_remove(struct pci_dev *pdev) |  | ||||||
|      } |  | ||||||
|   |  | ||||||
|      unregister_netdev(netdev); |  | ||||||
| -    for (i = 0x0; i < adapter->num_rx_queues; i++) |  | ||||||
| -		dev_put(&adapter->polling_netdev[i]); |  | ||||||
| - |  | ||||||
|      if(!iegbe_check_phy_reset_block(&adapter->hw)) { |  | ||||||
|          iegbe_phy_hw_reset(&adapter->hw); |  | ||||||
|      } |  | ||||||
|      kfree(adapter->tx_ring); |  | ||||||
|      kfree(adapter->rx_ring); |  | ||||||
| -    kfree(adapter->polling_netdev); |  | ||||||
|   |  | ||||||
|      iounmap(adapter->hw.hw_addr); |  | ||||||
|      pci_release_regions(pdev); |  | ||||||
| @@ -1061,7 +1053,6 @@ iegbe_sw_init(struct iegbe_adapter *adap |  | ||||||
|      struct iegbe_hw *hw = &adapter->hw; |  | ||||||
|      struct net_device *netdev = adapter->netdev; |  | ||||||
|      struct pci_dev *pdev = adapter->pdev; |  | ||||||
| -    int i; |  | ||||||
|   |  | ||||||
|      /* PCI config space info */ |  | ||||||
|   |  | ||||||
| @@ -1111,11 +1102,6 @@ iegbe_sw_init(struct iegbe_adapter *adap |  | ||||||
|  		return -ENOMEM; |  | ||||||
|  	} |  | ||||||
|   |  | ||||||
| -	for (i = 0; i < adapter->num_rx_queues; i++) { |  | ||||||
| -		adapter->polling_netdev[i].priv = adapter; |  | ||||||
| -		dev_hold(&adapter->polling_netdev[i]); |  | ||||||
| -		set_bit(__LINK_STATE_START, &adapter->polling_netdev[i].state); |  | ||||||
| -	} |  | ||||||
|  	spin_lock_init(&adapter->tx_queue_lock); |  | ||||||
|   |  | ||||||
|          /* |  | ||||||
| @@ -1137,8 +1123,7 @@ iegbe_sw_init(struct iegbe_adapter *adap |  | ||||||
|   * @adapter: board private structure to initialize |  | ||||||
|   * |  | ||||||
|   * We allocate one ring per queue at run-time since we don't know the |  | ||||||
| - * number of queues at compile-time.  The polling_netdev array is |  | ||||||
| - * intended for Multiqueue, but should work fine with a single queue. |  | ||||||
| + * number of queues at compile-time. |  | ||||||
|   **/ |  | ||||||
|   |  | ||||||
|  static int __devinit |  | ||||||
| @@ -1158,15 +1143,6 @@ iegbe_alloc_queues(struct iegbe_adapter |  | ||||||
|  		return -ENOMEM; |  | ||||||
|  	} |  | ||||||
|   |  | ||||||
| -	adapter->polling_netdev = kcalloc(adapter->num_rx_queues, |  | ||||||
| -	                                  sizeof(struct net_device), |  | ||||||
| -	                                  GFP_KERNEL); |  | ||||||
| -	if (!adapter->polling_netdev) { |  | ||||||
| -		kfree(adapter->tx_ring); |  | ||||||
| -		kfree(adapter->rx_ring); |  | ||||||
| -		return -ENOMEM; |  | ||||||
| -	} |  | ||||||
| - |  | ||||||
|      return E1000_SUCCESS; |  | ||||||
|  } |  | ||||||
|   |  | ||||||
| @@ -1,60 +0,0 @@ | |||||||
| --- a/Embedded/src/GbE/iegbe_main.c |  | ||||||
| +++ b/Embedded/src/GbE/iegbe_main.c |  | ||||||
| @@ -2161,7 +2161,8 @@ static void iegbe_set_rx_mode(struct net |  | ||||||
|  { |  | ||||||
|  	struct iegbe_adapter *adapter = netdev_priv(netdev); |  | ||||||
|  	struct iegbe_hw *hw = &adapter->hw; |  | ||||||
| -	struct dev_addr_list *uc_ptr; |  | ||||||
| +	struct netdev_hw_addr *ha; |  | ||||||
| +	bool use_uc = false; |  | ||||||
|  	struct dev_addr_list *mc_ptr; |  | ||||||
|  	u32 rctl; |  | ||||||
|  	u32 hash_value; |  | ||||||
| @@ -2187,12 +2188,11 @@ int mta_reg_count = E1000_NUM_MTA_REGIST |  | ||||||
|  		} |  | ||||||
|  	} |  | ||||||
|   |  | ||||||
| -	uc_ptr = NULL; |  | ||||||
|  	if (netdev->uc_count > rar_entries - 1) { |  | ||||||
|  		rctl |= E1000_RCTL_UPE; |  | ||||||
|  	} else if (!(netdev->flags & IFF_PROMISC)) { |  | ||||||
|  		rctl &= ~E1000_RCTL_UPE; |  | ||||||
| -		uc_ptr = netdev->uc_list; |  | ||||||
| +		use_uc = true; |  | ||||||
|  	} |  | ||||||
|   |  | ||||||
|  	E1000_WRITE_REG(&adapter->hw, RCTL, rctl); |  | ||||||
| @@ -2210,13 +2210,20 @@ int mta_reg_count = E1000_NUM_MTA_REGIST |  | ||||||
|  	 * if there are not 14 addresses, go ahead and clear the filters |  | ||||||
|  	 * -- with 82571 controllers only 0-13 entries are filled here |  | ||||||
|  	 */ |  | ||||||
| +	i = 1; |  | ||||||
| +	if (use_uc) |  | ||||||
| +		list_for_each_entry(ha, &netdev->uc_list, list) { |  | ||||||
| +			if (i == rar_entries) |  | ||||||
| +				break; |  | ||||||
| +			iegbe_rar_set(hw, ha->addr, i++); |  | ||||||
| +		} |  | ||||||
| + |  | ||||||
| +	WARN_ON(i == rar_entries); |  | ||||||
| + |  | ||||||
|  	mc_ptr = netdev->mc_list; |  | ||||||
|   |  | ||||||
| -	for (i = 1; i < rar_entries; i++) { |  | ||||||
| -		if (uc_ptr) { |  | ||||||
| -			iegbe_rar_set(hw, uc_ptr->da_addr, i); |  | ||||||
| -			uc_ptr = uc_ptr->next; |  | ||||||
| -		} else if (mc_ptr) {		 |  | ||||||
| +	for (; i < rar_entries; i++) { |  | ||||||
| +		if (mc_ptr) { |  | ||||||
|  			iegbe_rar_set(hw, mc_ptr->da_addr, i); |  | ||||||
|  			mc_ptr = mc_ptr->next; |  | ||||||
|  		} else { |  | ||||||
| @@ -2226,7 +2233,6 @@ int mta_reg_count = E1000_NUM_MTA_REGIST |  | ||||||
|  			E1000_WRITE_FLUSH(&adapter->hw); |  | ||||||
|  		} |  | ||||||
|  	} |  | ||||||
| -	WARN_ON(uc_ptr != NULL); |  | ||||||
|   |  | ||||||
|  	/* clear the old settings from the multicast hash table */ |  | ||||||
|   |  | ||||||
| @@ -1,20 +0,0 @@ | |||||||
| --- a/Embedded/src/GbE/iegbe_main.c |  | ||||||
| +++ b/Embedded/src/GbE/iegbe_main.c |  | ||||||
| @@ -2188,7 +2188,7 @@ int mta_reg_count = E1000_NUM_MTA_REGIST |  | ||||||
|  		} |  | ||||||
|  	} |  | ||||||
|   |  | ||||||
| -	if (netdev->uc_count > rar_entries - 1) { |  | ||||||
| +	if (netdev->uc.count > rar_entries - 1) { |  | ||||||
|  		rctl |= E1000_RCTL_UPE; |  | ||||||
|  	} else if (!(netdev->flags & IFF_PROMISC)) { |  | ||||||
|  		rctl &= ~E1000_RCTL_UPE; |  | ||||||
| @@ -2212,7 +2212,7 @@ int mta_reg_count = E1000_NUM_MTA_REGIST |  | ||||||
|  	 */ |  | ||||||
|  	i = 1; |  | ||||||
|  	if (use_uc) |  | ||||||
| -		list_for_each_entry(ha, &netdev->uc_list, list) { |  | ||||||
| +		list_for_each_entry(ha, &netdev->uc.list, list) { |  | ||||||
|  			if (i == rar_entries) |  | ||||||
|  				break; |  | ||||||
|  			iegbe_rar_set(hw, ha->addr, i++); |  | ||||||
| @@ -1,20 +0,0 @@ | |||||||
| --- a/Embedded/src/GbE/iegbe_main.c |  | ||||||
| +++ b/Embedded/src/GbE/iegbe_main.c |  | ||||||
| @@ -775,13 +775,13 @@ static int __devinit iegbe_probe(struct |  | ||||||
|  	if (err) |  | ||||||
|          return err; |  | ||||||
|   |  | ||||||
| -	if (!pci_set_dma_mask(pdev, DMA_64BIT_MASK) && |  | ||||||
| -	    !pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK)) { |  | ||||||
| +	if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) && |  | ||||||
| +	    !pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64))) { |  | ||||||
|  		pci_using_dac = 1; |  | ||||||
|          } else { |  | ||||||
| -             err = pci_set_dma_mask(pdev, DMA_32BIT_MASK); |  | ||||||
| +             err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)); |  | ||||||
|     	     if (err) { |  | ||||||
| -			err = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK); |  | ||||||
| +			err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)); |  | ||||||
|  			if (err) { |  | ||||||
|  				E1000_ERR("No usable DMA configuration, " |  | ||||||
|  					  "aborting\n"); |  | ||||||
| @@ -1,12 +0,0 @@ | |||||||
| --- a/Embedded/src/GbE/iegbe_ethtool.c |  | ||||||
| +++ b/Embedded/src/GbE/iegbe_ethtool.c |  | ||||||
| @@ -944,7 +944,8 @@ iegbe_intr_test(struct iegbe_adapter *ad |  | ||||||
|      *data = 0; |  | ||||||
|   |  | ||||||
|      /* Hook up test interrupt handler just for this test */ |  | ||||||
| -     if(!request_irq(irq, &iegbe_test_intr, 0, netdev->name, netdev)) { |  | ||||||
| +     if(!request_irq(irq, &iegbe_test_intr, IRQF_PROBE_SHARED, netdev->name, |  | ||||||
| +			netdev)) { |  | ||||||
|           shared_int = FALSE; |  | ||||||
|       } else if(request_irq(irq, &iegbe_test_intr, IRQF_SHARED, |  | ||||||
|                    netdev->name, netdev)){ |  | ||||||
| @@ -1,747 +0,0 @@ | |||||||
| --- a/Embedded/src/GbE/iegbe_oem_phy.c |  | ||||||
| +++ b/Embedded/src/GbE/iegbe_oem_phy.c |  | ||||||
| @@ -65,6 +65,10 @@ static int32_t iegbe_oem_link_m88_setup( |  | ||||||
|  static int32_t iegbe_oem_set_phy_mode(struct iegbe_hw *hw); |  | ||||||
|  static int32_t iegbe_oem_detect_phy(struct iegbe_hw *hw); |  | ||||||
|   |  | ||||||
| +static int32_t iegbe_oem_link_bcm5481_setup(struct iegbe_hw *hw); |  | ||||||
| +static int32_t bcm5481_read_18sv (struct iegbe_hw *hw, int sv, uint16_t *data); |  | ||||||
| +static int32_t oi_phy_setup (struct iegbe_hw *hw); |  | ||||||
| + |  | ||||||
|  /** |  | ||||||
|   * iegbe_oem_setup_link |  | ||||||
|   * @hw: iegbe_hw struct containing device specific information |  | ||||||
| @@ -114,6 +118,10 @@ iegbe_oem_setup_link(struct iegbe_hw *hw |  | ||||||
|      } |  | ||||||
|   |  | ||||||
|      switch (hw->phy_id) { |  | ||||||
| +	case BCM5395S_PHY_ID: |  | ||||||
| +		return E1000_SUCCESS; |  | ||||||
| +		break; |  | ||||||
| + |  | ||||||
|          case M88E1000_I_PHY_ID: |  | ||||||
|          case M88E1141_E_PHY_ID: |  | ||||||
|              ret_val = iegbe_oem_link_m88_setup(hw); |  | ||||||
| @@ -121,6 +129,12 @@ iegbe_oem_setup_link(struct iegbe_hw *hw |  | ||||||
|                  return ret_val;  |  | ||||||
|              } |  | ||||||
|          break;  |  | ||||||
| +	case BCM5481_PHY_ID: |  | ||||||
| +		ret_val = iegbe_oem_link_bcm5481_setup(hw); |  | ||||||
| +		if(ret_val) {  |  | ||||||
| +			return ret_val;  |  | ||||||
| +		} |  | ||||||
| +		break;  |  | ||||||
|          default: |  | ||||||
|              DEBUGOUT("Invalid PHY ID\n"); |  | ||||||
|              return -E1000_ERR_PHY_TYPE; |  | ||||||
| @@ -179,6 +193,51 @@ iegbe_oem_setup_link(struct iegbe_hw *hw |  | ||||||
|  #endif /* ifdef EXTERNAL_MDIO */ |  | ||||||
|  } |  | ||||||
|   |  | ||||||
| +/** |  | ||||||
| + * iegbe_oem_link_bcm5481_setup |  | ||||||
| + * @hw: iegbe_hw struct containing device specific information |  | ||||||
| + * |  | ||||||
| + * Returns E1000_SUCCESS, negative E1000 error code on failure |  | ||||||
| + * |  | ||||||
| + * copied verbatim from iegbe_oem_link_m88_setup |  | ||||||
| + **/ |  | ||||||
| +static int32_t |  | ||||||
| +iegbe_oem_link_bcm5481_setup(struct iegbe_hw *hw) |  | ||||||
| +{ |  | ||||||
| +	int32_t ret_val; |  | ||||||
| +	uint16_t phy_data; |  | ||||||
| + |  | ||||||
| +	//DEBUGFUNC(__func__); |  | ||||||
| + |  | ||||||
| +	if(!hw) |  | ||||||
| +		return -1; |  | ||||||
| + |  | ||||||
| +	/* phy_reset_disable is set in iegbe_oem_set_phy_mode */ |  | ||||||
| +	if(hw->phy_reset_disable) |  | ||||||
| +		return E1000_SUCCESS; |  | ||||||
| + |  | ||||||
| +	// Enable MDIX in extended control reg. |  | ||||||
| +	ret_val = iegbe_oem_read_phy_reg_ex(hw, BCM5481_ECTRL, &phy_data); |  | ||||||
| +	if(ret_val) |  | ||||||
| +	{ |  | ||||||
| +		DEBUGOUT("Unable to read BCM5481_ECTRL register\n"); |  | ||||||
| +		return ret_val; |  | ||||||
| +	} |  | ||||||
| + |  | ||||||
| +	phy_data &= ~BCM5481_ECTRL_DISMDIX; |  | ||||||
| +	ret_val = iegbe_oem_write_phy_reg_ex(hw, BCM5481_ECTRL, phy_data); |  | ||||||
| +	if(ret_val) |  | ||||||
| +	{ |  | ||||||
| +		DEBUGOUT("Unable to write BCM5481_ECTRL register\n"); |  | ||||||
| +		return ret_val; |  | ||||||
| +	} |  | ||||||
| + |  | ||||||
| +	ret_val = oi_phy_setup (hw); |  | ||||||
| +	if (ret_val) |  | ||||||
| +		return ret_val; |  | ||||||
| + |  | ||||||
| +	return E1000_SUCCESS; |  | ||||||
| +} |  | ||||||
|   |  | ||||||
|  /** |  | ||||||
|   * iegbe_oem_link_m88_setup |  | ||||||
| @@ -340,6 +399,11 @@ iegbe_oem_force_mdi(struct iegbe_hw *hw, |  | ||||||
|       * see iegbe_phy_force_speed_duplex, which does the following for M88 |  | ||||||
|       */ |  | ||||||
|        switch (hw->phy_id) { |  | ||||||
| +		case BCM5395S_PHY_ID: |  | ||||||
| +		case BCM5481_PHY_ID: |  | ||||||
| +			DEBUGOUT("WARNING: An empty iegbe_oem_force_mdi() has been called!\n"); |  | ||||||
| +			break; |  | ||||||
| + |  | ||||||
|            case M88E1000_I_PHY_ID: |  | ||||||
|            case M88E1141_E_PHY_ID: |  | ||||||
|                ret_val = iegbe_oem_read_phy_reg_ex(hw,  |  | ||||||
| @@ -415,6 +479,8 @@ iegbe_oem_phy_reset_dsp(struct iegbe_hw |  | ||||||
|       switch (hw->phy_id) { |  | ||||||
|           case M88E1000_I_PHY_ID: |  | ||||||
|           case M88E1141_E_PHY_ID: |  | ||||||
| +		case BCM5481_PHY_ID: |  | ||||||
| +		case BCM5395S_PHY_ID: |  | ||||||
|               DEBUGOUT("No DSP to reset on OEM PHY\n"); |  | ||||||
|           break; |  | ||||||
|           default: |  | ||||||
| @@ -460,6 +526,11 @@ iegbe_oem_cleanup_after_phy_reset(struct |  | ||||||
|       * see iegbe_phy_force_speed_duplex, which does the following for M88 |  | ||||||
|       */ |  | ||||||
|      switch (hw->phy_id) { |  | ||||||
| +		case BCM5395S_PHY_ID: |  | ||||||
| +		case BCM5481_PHY_ID: |  | ||||||
| +            DEBUGOUT("WARNING: An empty iegbe_oem_cleanup_after_phy_reset() has been called!\n"); |  | ||||||
| +        break; |  | ||||||
| + |  | ||||||
|          case M88E1000_I_PHY_ID: |  | ||||||
|          case M88E1141_E_PHY_ID: |  | ||||||
|              /* |  | ||||||
| @@ -573,6 +644,11 @@ iegbe_oem_set_phy_mode(struct iegbe_hw * |  | ||||||
|       * use iegbe_set_phy_mode as example |  | ||||||
|       */ |  | ||||||
|      switch (hw->phy_id) { |  | ||||||
| +		case BCM5395S_PHY_ID: |  | ||||||
| +		case BCM5481_PHY_ID: |  | ||||||
| +             DEBUGOUT("WARNING: An empty iegbe_oem_set_phy_mode() has been called!\n"); |  | ||||||
| +         break; |  | ||||||
| + |  | ||||||
|           case M88E1000_I_PHY_ID: |  | ||||||
|           case M88E1141_E_PHY_ID: |  | ||||||
|               ret_val = iegbe_read_eeprom(hw,  |  | ||||||
| @@ -641,6 +717,19 @@ iegbe_oem_detect_phy(struct iegbe_hw *hw |  | ||||||
|      } |  | ||||||
|      hw->phy_type = iegbe_phy_oem; |  | ||||||
|   |  | ||||||
| +{ |  | ||||||
| +	// If MAC2 (BCM5395 switch), manually detect the phy |  | ||||||
| +	struct iegbe_adapter *adapter; |  | ||||||
| +	uint32_t device_number; |  | ||||||
| +	adapter = (struct iegbe_adapter *) hw->back; |  | ||||||
| +	device_number = PCI_SLOT(adapter->pdev->devfn); |  | ||||||
| +	if (device_number == ICP_XXXX_MAC_2) { |  | ||||||
| +		hw->phy_id = BCM5395S_PHY_ID; |  | ||||||
| +		hw->phy_revision = 0; |  | ||||||
| +		return E1000_SUCCESS; |  | ||||||
| +	} |  | ||||||
| +} |  | ||||||
| + |  | ||||||
|      ret_val = iegbe_oem_read_phy_reg_ex(hw, PHY_ID1, &phy_id_high); |  | ||||||
|      if(ret_val) { |  | ||||||
|          DEBUGOUT("Unable to read PHY register PHY_ID1\n"); |  | ||||||
| @@ -690,6 +779,8 @@ iegbe_oem_get_tipg(struct iegbe_hw *hw) |  | ||||||
|      switch (hw->phy_id) { |  | ||||||
|           case M88E1000_I_PHY_ID: |  | ||||||
|           case M88E1141_E_PHY_ID: |  | ||||||
| +		case BCM5481_PHY_ID: |  | ||||||
| +		case BCM5395S_PHY_ID: |  | ||||||
|               phy_num = DEFAULT_ICP_XXXX_TIPG_IPGT; |  | ||||||
|           break; |  | ||||||
|           default: |  | ||||||
| @@ -738,6 +829,8 @@ iegbe_oem_phy_is_copper(struct iegbe_hw |  | ||||||
|      switch (hw->phy_id) { |  | ||||||
|          case M88E1000_I_PHY_ID: |  | ||||||
|          case M88E1141_E_PHY_ID: |  | ||||||
| +		case BCM5481_PHY_ID: |  | ||||||
| +		case BCM5395S_PHY_ID: |  | ||||||
|              isCopper = TRUE; |  | ||||||
|          break; |  | ||||||
|          default: |  | ||||||
| @@ -796,13 +889,13 @@ iegbe_oem_get_phy_dev_number(struct iegb |  | ||||||
|  	switch(device_number) |  | ||||||
|      { |  | ||||||
|        case ICP_XXXX_MAC_0:  |  | ||||||
| -	      hw->phy_addr = 0x00; |  | ||||||
| +	      hw->phy_addr = 0x01; |  | ||||||
|  	  break; |  | ||||||
|        case ICP_XXXX_MAC_1:  |  | ||||||
| -	      hw->phy_addr = 0x01; |  | ||||||
| +	      hw->phy_addr = 0x02; |  | ||||||
|  	  break; |  | ||||||
|        case ICP_XXXX_MAC_2:  |  | ||||||
| -	      hw->phy_addr = 0x02; |  | ||||||
| +	      hw->phy_addr = 0x00; |  | ||||||
|  	  break; |  | ||||||
|  	  default:  hw->phy_addr = 0x00; |  | ||||||
|      } |  | ||||||
| @@ -851,6 +944,12 @@ iegbe_oem_mii_ioctl(struct iegbe_adapter |  | ||||||
|      if(!adapter || !ifr) { |  | ||||||
|          return -1; |  | ||||||
|      } |  | ||||||
| + |  | ||||||
| +	// If MAC2 (BCM5395 switch) then leave now |  | ||||||
| +	if ((PCI_SLOT(adapter->pdev->devfn)) == ICP_XXXX_MAC_2) { |  | ||||||
| +			return -1; |  | ||||||
| +	} |  | ||||||
| + |  | ||||||
|      switch (data->reg_num) { |  | ||||||
|          case PHY_CTRL: |  | ||||||
|              if(mii_reg & MII_CR_POWER_DOWN) { |  | ||||||
| @@ -987,6 +1086,11 @@ void iegbe_oem_get_phy_regs(struct iegbe |  | ||||||
|       * [10] = mdix mode |  | ||||||
|       */ |  | ||||||
|      switch (adapter->hw.phy_id) { |  | ||||||
| +	case BCM5395S_PHY_ID: |  | ||||||
| +	case BCM5481_PHY_ID: |  | ||||||
| +		DEBUGOUT("WARNING: An empty iegbe_oem_get_phy_regs() has been called!\n"); |  | ||||||
| +	break; |  | ||||||
| + |  | ||||||
|          case M88E1000_I_PHY_ID: |  | ||||||
|          case M88E1141_E_PHY_ID: |  | ||||||
|              if(corrected_len > 0) { |  | ||||||
| @@ -1068,8 +1172,13 @@ iegbe_oem_phy_loopback(struct iegbe_adap |  | ||||||
|       * Loopback configuration is the same for each of the supported PHYs. |  | ||||||
|       */ |  | ||||||
|      switch (adapter->hw.phy_id) { |  | ||||||
| +		case BCM5395S_PHY_ID: |  | ||||||
| +			DEBUGOUT("WARNING: An empty iegbe_oem_phy_loopback() has been called!\n"); |  | ||||||
| +			break; |  | ||||||
| + |  | ||||||
|          case M88E1000_I_PHY_ID: |  | ||||||
|          case M88E1141_E_PHY_ID: |  | ||||||
| +		case BCM5481_PHY_ID: |  | ||||||
|   |  | ||||||
|            adapter->hw.autoneg = FALSE; |  | ||||||
|   |  | ||||||
| @@ -1182,8 +1291,14 @@ iegbe_oem_loopback_cleanup(struct iegbe_ |  | ||||||
|      } |  | ||||||
|   |  | ||||||
|      switch (adapter->hw.phy_id) { |  | ||||||
| +		case BCM5395S_PHY_ID: |  | ||||||
| +		DEBUGOUT("WARNING: An empty iegbe_oem_loopback_cleanup() has been called!\n"); |  | ||||||
| +		return; |  | ||||||
| +		break; |  | ||||||
| + |  | ||||||
|          case M88E1000_I_PHY_ID: |  | ||||||
|          case M88E1141_E_PHY_ID: |  | ||||||
| +		case BCM5481_PHY_ID: |  | ||||||
|          default: |  | ||||||
|              adapter->hw.autoneg = TRUE; |  | ||||||
|           |  | ||||||
| @@ -1243,6 +1358,11 @@ iegbe_oem_phy_speed_downgraded(struct ie |  | ||||||
|       */ |  | ||||||
|   |  | ||||||
|      switch (hw->phy_id) { |  | ||||||
| +		case BCM5395S_PHY_ID: |  | ||||||
| +		case BCM5481_PHY_ID: |  | ||||||
| +			*isDowngraded = 0; |  | ||||||
| +			break; |  | ||||||
| + |  | ||||||
|          case M88E1000_I_PHY_ID: |  | ||||||
|          case M88E1141_E_PHY_ID: |  | ||||||
|              ret_val = iegbe_oem_read_phy_reg_ex(hw, M88E1000_PHY_SPEC_STATUS,  |  | ||||||
| @@ -1305,6 +1425,11 @@ iegbe_oem_check_polarity(struct iegbe_hw |  | ||||||
|       */ |  | ||||||
|   |  | ||||||
|      switch (hw->phy_id) { |  | ||||||
| +		case BCM5395S_PHY_ID: |  | ||||||
| +		case BCM5481_PHY_ID: |  | ||||||
| +			*polarity = 0; |  | ||||||
| +			break; |  | ||||||
| + |  | ||||||
|          case M88E1000_I_PHY_ID: |  | ||||||
|          case M88E1141_E_PHY_ID: |  | ||||||
|              /* return the Polarity bit in the Status register. */ |  | ||||||
| @@ -1367,6 +1492,25 @@ iegbe_oem_phy_is_full_duplex(struct iegb |  | ||||||
|       */ |  | ||||||
|           |  | ||||||
|        switch (hw->phy_id) { |  | ||||||
| +		case BCM5395S_PHY_ID: |  | ||||||
| +			/* Always full duplex */ |  | ||||||
| +			*isFD = 1; |  | ||||||
| +			break; |  | ||||||
| + |  | ||||||
| +		case BCM5481_PHY_ID: |  | ||||||
| +			ret_val = iegbe_read_phy_reg(hw, BCM5481_ASTAT, &phy_data); |  | ||||||
| +			if(ret_val) return ret_val; |  | ||||||
| + |  | ||||||
| +				switch (BCM5481_ASTAT_HCD(phy_data)) { |  | ||||||
| +					case BCM5481_ASTAT_1KBTFD: |  | ||||||
| +					case BCM5481_ASTAT_100BTXFD: |  | ||||||
| +						*isFD = 1; |  | ||||||
| +						break; |  | ||||||
| +					default: |  | ||||||
| +						*isFD = 0; |  | ||||||
| +				} |  | ||||||
| +			break; |  | ||||||
| + |  | ||||||
|            case M88E1000_I_PHY_ID: |  | ||||||
|            case M88E1141_E_PHY_ID: |  | ||||||
|               ret_val = iegbe_oem_read_phy_reg_ex(hw, M88E1000_PHY_SPEC_STATUS, |  | ||||||
| @@ -1423,6 +1567,25 @@ iegbe_oem_phy_is_speed_1000(struct iegbe |  | ||||||
|       */ |  | ||||||
|   |  | ||||||
|      switch (hw->phy_id) { |  | ||||||
| +		case BCM5395S_PHY_ID: |  | ||||||
| +			/* Always 1000mb */ |  | ||||||
| +			*is1000 = 1; |  | ||||||
| +			break; |  | ||||||
| + |  | ||||||
| +		case BCM5481_PHY_ID: |  | ||||||
| +			ret_val = iegbe_read_phy_reg(hw, BCM5481_ASTAT, &phy_data); |  | ||||||
| +			if(ret_val) return ret_val; |  | ||||||
| + |  | ||||||
| +				switch (BCM5481_ASTAT_HCD(phy_data)) { |  | ||||||
| +					case BCM5481_ASTAT_1KBTFD: |  | ||||||
| +					case BCM5481_ASTAT_1KBTHD: |  | ||||||
| +						*is1000 = 1; |  | ||||||
| +					break; |  | ||||||
| +				default: |  | ||||||
| +					*is1000 = 0; |  | ||||||
| +				} |  | ||||||
| +			break; |  | ||||||
| + |  | ||||||
|          case M88E1000_I_PHY_ID: |  | ||||||
|          case M88E1141_E_PHY_ID: |  | ||||||
|              ret_val = iegbe_oem_read_phy_reg_ex(hw, M88E1000_PHY_SPEC_STATUS,  |  | ||||||
| @@ -1478,6 +1641,25 @@ iegbe_oem_phy_is_speed_100(struct iegbe_ |  | ||||||
|       * see iegbe_config_mac_to_phy |  | ||||||
|       */ |  | ||||||
|      switch (hw->phy_id) { |  | ||||||
| +		case BCM5395S_PHY_ID: |  | ||||||
| +			/* Always 1000Mb, never 100mb */ |  | ||||||
| +			*is100 = 0; |  | ||||||
| +			break; |  | ||||||
| + |  | ||||||
| +		case BCM5481_PHY_ID: |  | ||||||
| +			ret_val = iegbe_read_phy_reg(hw, BCM5481_ASTAT, &phy_data); |  | ||||||
| +			if(ret_val) return ret_val; |  | ||||||
| + |  | ||||||
| +			switch (BCM5481_ASTAT_HCD(phy_data)) { |  | ||||||
| +				case BCM5481_ASTAT_100BTXFD: |  | ||||||
| +				case BCM5481_ASTAT_100BTXHD: |  | ||||||
| +					*is100 = 1; |  | ||||||
| +					break; |  | ||||||
| +				default: |  | ||||||
| +					*is100 = 0; |  | ||||||
| +			} |  | ||||||
| +			break; |  | ||||||
| + |  | ||||||
|          case M88E1000_I_PHY_ID: |  | ||||||
|          case M88E1141_E_PHY_ID: |  | ||||||
|              ret_val = iegbe_oem_read_phy_reg_ex(hw,  |  | ||||||
| @@ -1535,6 +1717,11 @@ iegbe_oem_phy_get_info(struct iegbe_hw * |  | ||||||
|       * see iegbe_phy_m88_get_info |  | ||||||
|       */ |  | ||||||
|      switch (hw->phy_id) { |  | ||||||
| +		case BCM5395S_PHY_ID: |  | ||||||
| +		case BCM5481_PHY_ID: |  | ||||||
| +			DEBUGOUT("WARNING: An empty iegbe_oem_phy_get_info() has been called!\n"); |  | ||||||
| +			break; |  | ||||||
| + |  | ||||||
|          case M88E1000_I_PHY_ID: |  | ||||||
|          case M88E1141_E_PHY_ID: |  | ||||||
|    /* The downshift status is checked only once, after link is |  | ||||||
| @@ -1636,8 +1823,13 @@ iegbe_oem_phy_hw_reset(struct iegbe_hw * |  | ||||||
|       * the M88 used in truxton.  |  | ||||||
|       */ |  | ||||||
|      switch (hw->phy_id) { |  | ||||||
| +		case BCM5395S_PHY_ID: |  | ||||||
| +			DEBUGOUT("WARNING: An empty iegbe_oem_phy_hw_reset() has been called!\n"); |  | ||||||
| +			break; |  | ||||||
| + |  | ||||||
|          case M88E1000_I_PHY_ID: |  | ||||||
|          case M88E1141_E_PHY_ID: |  | ||||||
| +		case BCM5481_PHY_ID: |  | ||||||
|              ret_val = iegbe_oem_read_phy_reg_ex(hw, PHY_CTRL, &phy_data); |  | ||||||
|              if(ret_val) { |  | ||||||
|                  DEBUGOUT("Unable to read register PHY_CTRL\n"); |  | ||||||
| @@ -1699,6 +1891,8 @@ iegbe_oem_phy_init_script(struct iegbe_h |  | ||||||
|      switch (hw->phy_id) { |  | ||||||
|          case M88E1000_I_PHY_ID: |  | ||||||
|          case M88E1141_E_PHY_ID: |  | ||||||
| +		case BCM5481_PHY_ID: |  | ||||||
| +		case BCM5395S_PHY_ID: |  | ||||||
|              DEBUGOUT("Nothing to do for OEM PHY Init"); |  | ||||||
|          break; |  | ||||||
|          default: |  | ||||||
| @@ -1735,6 +1929,11 @@ iegbe_oem_read_phy_reg_ex(struct iegbe_h |  | ||||||
|          return -1; |  | ||||||
|      } |  | ||||||
|   |  | ||||||
| +	if (hw->phy_id == BCM5395S_PHY_ID) { |  | ||||||
| +		DEBUGOUT("WARNING: iegbe_oem_read_phy_reg_ex() has been unexpectedly called!\n"); |  | ||||||
| +		return -1; |  | ||||||
| +	} |  | ||||||
| + |  | ||||||
|      /* call the GCU func that will read the phy |  | ||||||
|       *  |  | ||||||
|       * Make note that the M88 phy is what'll be used on Truxton. |  | ||||||
| @@ -1782,6 +1981,11 @@ iegbe_oem_set_trans_gasket(struct iegbe_ |  | ||||||
|      } |  | ||||||
|   |  | ||||||
|       switch (hw->phy_id) { |  | ||||||
| +		case BCM5395S_PHY_ID: |  | ||||||
| +		case BCM5481_PHY_ID: |  | ||||||
| +			DEBUGOUT("WARNING: An empty iegbe_oem_set_trans_gasket() has been called!\n"); |  | ||||||
| +			break; |  | ||||||
| + |  | ||||||
|           case M88E1000_I_PHY_ID: |  | ||||||
|           case M88E1141_E_PHY_ID: |  | ||||||
|           /* Gasket set correctly for Marvell Phys, so nothing to do */ |  | ||||||
| @@ -1886,6 +2090,8 @@ iegbe_oem_phy_needs_reset_with_mac(struc |  | ||||||
|      switch (hw->phy_id) { |  | ||||||
|          case M88E1000_I_PHY_ID: |  | ||||||
|          case M88E1141_E_PHY_ID: |  | ||||||
| +		case BCM5481_PHY_ID: |  | ||||||
| +		case BCM5395S_PHY_ID: |  | ||||||
|              ret_val = FALSE; |  | ||||||
|          break; |  | ||||||
|          default: |  | ||||||
| @@ -1935,6 +2141,8 @@ iegbe_oem_config_dsp_after_link_change(s |  | ||||||
|      switch (hw->phy_id) { |  | ||||||
|          case M88E1000_I_PHY_ID: |  | ||||||
|          case M88E1141_E_PHY_ID: |  | ||||||
| +		case BCM5481_PHY_ID: |  | ||||||
| +		case BCM5395S_PHY_ID: |  | ||||||
|              DEBUGOUT("No DSP to configure on OEM PHY"); |  | ||||||
|          break; |  | ||||||
|          default: |  | ||||||
| @@ -1978,6 +2186,12 @@ iegbe_oem_get_cable_length(struct iegbe_ |  | ||||||
|      } |  | ||||||
|   |  | ||||||
|      switch (hw->phy_id) { |  | ||||||
| +		case BCM5395S_PHY_ID: |  | ||||||
| +		case BCM5481_PHY_ID: |  | ||||||
| +			*min_length = 0; |  | ||||||
| +			*max_length = iegbe_igp_cable_length_150; |  | ||||||
| +			break; |  | ||||||
| + |  | ||||||
|          case M88E1000_I_PHY_ID: |  | ||||||
|          case M88E1141_E_PHY_ID: |  | ||||||
|              ret_val = iegbe_oem_read_phy_reg_ex(hw,  |  | ||||||
| @@ -2061,6 +2275,23 @@ iegbe_oem_phy_is_link_up(struct iegbe_hw |  | ||||||
|       */ |  | ||||||
|   |  | ||||||
|      switch (hw->phy_id) { |  | ||||||
| +		case BCM5395S_PHY_ID: |  | ||||||
| +			/* Link always up */ |  | ||||||
| +			*isUp = TRUE; |  | ||||||
| +			return E1000_SUCCESS; |  | ||||||
| +			break; |  | ||||||
| + |  | ||||||
| +		case BCM5481_PHY_ID: |  | ||||||
| +			iegbe_oem_read_phy_reg_ex(hw, BCM5481_ESTAT, &phy_data); |  | ||||||
| +			ret_val = iegbe_oem_read_phy_reg_ex(hw, BCM5481_ESTAT, &phy_data); |  | ||||||
| +			if(ret_val) |  | ||||||
| +			{ |  | ||||||
| +				DEBUGOUT("Unable to read PHY register BCM5481_ESTAT\n"); |  | ||||||
| +				return ret_val; |  | ||||||
| +			} |  | ||||||
| +			statusMask = BCM5481_ESTAT_LINK; |  | ||||||
| +			break; |  | ||||||
| + |  | ||||||
|          case M88E1000_I_PHY_ID: |  | ||||||
|          case M88E1141_E_PHY_ID: |  | ||||||
|              iegbe_oem_read_phy_reg_ex(hw, M88E1000_PHY_SPEC_STATUS, &phy_data);  |  | ||||||
| @@ -2092,3 +2323,210 @@ iegbe_oem_phy_is_link_up(struct iegbe_hw |  | ||||||
|  #endif /* ifdef EXTERNAL_MDIO */ |  | ||||||
|  } |  | ||||||
|   |  | ||||||
| + |  | ||||||
| + |  | ||||||
| +//----- |  | ||||||
| +// Read BCM5481 expansion register |  | ||||||
| +// |  | ||||||
| +int32_t |  | ||||||
| +bcm5481_read_ex (struct iegbe_hw *hw, uint16_t reg, uint16_t *data) |  | ||||||
| +{ |  | ||||||
| +	int ret; |  | ||||||
| +	uint16_t selector; |  | ||||||
| +	uint16_t reg_data; |  | ||||||
| + |  | ||||||
| +	// Get the current value of bits 15:12 |  | ||||||
| +	ret = iegbe_oem_read_phy_reg_ex (hw, 0x15, &selector); |  | ||||||
| +	if (ret) |  | ||||||
| +		return ret; |  | ||||||
| + |  | ||||||
| +	// Select the expansion register |  | ||||||
| +	selector &= 0xf000; |  | ||||||
| +	selector |= (0xf << 8) | (reg); |  | ||||||
| +	iegbe_oem_write_phy_reg_ex (hw, 0x17, selector); |  | ||||||
| + |  | ||||||
| +	// Read the expansion register |  | ||||||
| +	ret = iegbe_oem_read_phy_reg_ex (hw, 0x15, ®_data); |  | ||||||
| + |  | ||||||
| +	// De-select the expansion registers. |  | ||||||
| +	selector &= 0xf000; |  | ||||||
| +	iegbe_oem_write_phy_reg_ex (hw, 0x17, selector); |  | ||||||
| + |  | ||||||
| +	if (ret) |  | ||||||
| +		return ret; |  | ||||||
| + |  | ||||||
| +	*data = reg_data; |  | ||||||
| +	return ret; |  | ||||||
| +} |  | ||||||
| + |  | ||||||
| +//----- |  | ||||||
| +//	Read reg 0x18 sub-register |  | ||||||
| +// |  | ||||||
| +static int32_t |  | ||||||
| +bcm5481_read_18sv (struct iegbe_hw *hw, int sv, uint16_t *data) |  | ||||||
| +{ |  | ||||||
| +	int	ret; |  | ||||||
| +	uint16_t	tmp_data; |  | ||||||
| + |  | ||||||
| +	// Select reg 0x18, sv |  | ||||||
| +	tmp_data = ((sv & BCM5481_R18H_SV_MASK) << 12) | BCM5481_R18H_SV_MCTRL; |  | ||||||
| +	ret = iegbe_oem_write_phy_reg_ex (hw, BCM5481_R18H, tmp_data); |  | ||||||
| +	if(ret) |  | ||||||
| +		return ret; |  | ||||||
| + |  | ||||||
| +	// Read reg 0x18, sv |  | ||||||
| +	ret = iegbe_oem_read_phy_reg_ex (hw, BCM5481_R18H, &tmp_data); |  | ||||||
| +	if(ret) |  | ||||||
| +		return ret; |  | ||||||
| + |  | ||||||
| +	*data = tmp_data; |  | ||||||
| +	return ret; |  | ||||||
| +} |  | ||||||
| + |  | ||||||
| +//----- |  | ||||||
| +//	Read reg 0x1C sub-register |  | ||||||
| +// |  | ||||||
| +int32_t |  | ||||||
| +bcm5481_read_1csv (struct iegbe_hw *hw, int sv, uint16_t *data) |  | ||||||
| +{ |  | ||||||
| +	int ret; |  | ||||||
| +	uint16_t tmp_data; |  | ||||||
| + |  | ||||||
| +	// Select reg 0x1c, sv |  | ||||||
| +	tmp_data = ((sv & BCM5481_R1CH_SV_MASK) << BCM5481_R1CH_SV_SHIFT); |  | ||||||
| + |  | ||||||
| +	ret = iegbe_oem_write_phy_reg_ex (hw, BCM5481_R1CH, tmp_data); |  | ||||||
| +	if(ret) |  | ||||||
| +		return ret; |  | ||||||
| + |  | ||||||
| +	// Read reg 0x1c, sv |  | ||||||
| +	ret = iegbe_oem_read_phy_reg_ex (hw, BCM5481_R1CH, &tmp_data); |  | ||||||
| +	if(ret) |  | ||||||
| +		return ret; |  | ||||||
| + |  | ||||||
| +	*data = tmp_data; |  | ||||||
| +	return ret; |  | ||||||
| +} |  | ||||||
| + |  | ||||||
| +//----- |  | ||||||
| +//	Read-modify-write a 0x1C register. |  | ||||||
| +// |  | ||||||
| +//	hw   - hardware access info. |  | ||||||
| +//	reg  - 0x1C register to modify. |  | ||||||
| +//	data - bits which should be set. |  | ||||||
| +//	mask - the '1' bits in this argument will be cleared in the data |  | ||||||
| +//         read from 'reg' then 'data' will be or'd in and the result |  | ||||||
| +//         will be written to 'reg'. |  | ||||||
| + |  | ||||||
| +int32_t |  | ||||||
| +bcm5481_rmw_1csv (struct iegbe_hw *hw, uint16_t reg, uint16_t data, uint16_t mask) |  | ||||||
| +{ |  | ||||||
| +	int32_t		ret; |  | ||||||
| +	uint16_t	reg_data; |  | ||||||
| + |  | ||||||
| +	ret = 0; |  | ||||||
| + |  | ||||||
| +	ret = bcm5481_read_1csv (hw, reg, ®_data); |  | ||||||
| +	if (ret) |  | ||||||
| +	{ |  | ||||||
| +		DEBUGOUT("Unable to read BCM5481 1CH register\n"); |  | ||||||
| +		printk (KERN_ERR "Unable to read BCM5481 1CH register [0x%x]\n", reg); |  | ||||||
| +		return ret; |  | ||||||
| +	} |  | ||||||
| + |  | ||||||
| +	reg_data &= ~mask; |  | ||||||
| +	reg_data |= (BCM5481_R1CH_WE | data); |  | ||||||
| + |  | ||||||
| +	ret = iegbe_oem_write_phy_reg_ex (hw, BCM5481_R1CH, reg_data); |  | ||||||
| +	if(ret) |  | ||||||
| +	{ |  | ||||||
| +		DEBUGOUT("Unable to write BCM5481 1CH register\n"); |  | ||||||
| +		printk (KERN_ERR "Unable to write BCM5481 1CH register\n"); |  | ||||||
| +		return ret; |  | ||||||
| +	} |  | ||||||
| + |  | ||||||
| +	return ret; |  | ||||||
| +} |  | ||||||
| + |  | ||||||
| +int32_t |  | ||||||
| +oi_phy_setup (struct iegbe_hw *hw) |  | ||||||
| +{ |  | ||||||
| +	int	ret; |  | ||||||
| +	uint16_t	pmii_data; |  | ||||||
| +	uint16_t	mctrl_data; |  | ||||||
| +	uint16_t	cacr_data; |  | ||||||
| + |  | ||||||
| +	ret = 0; |  | ||||||
| + |  | ||||||
| +	// Set low power mode via reg 0x18, sv010, bit 6 |  | ||||||
| +	// Do a read-modify-write on reg 0x18, sv010 register to preserve existing bits. |  | ||||||
| +	ret = bcm5481_read_18sv (hw, BCM5481_R18H_SV_PMII, &pmii_data); |  | ||||||
| +	if (ret) |  | ||||||
| +	{ |  | ||||||
| +		DEBUGOUT("Unable to read BCM5481_R18H_SV_PMII register\n"); |  | ||||||
| +		printk (KERN_ERR "Unable to read BCM5481_R18H_SV_PMII register\n"); |  | ||||||
| +		return ret; |  | ||||||
| +	} |  | ||||||
| + |  | ||||||
| +	// Set the LPM bit in the data just read and write back to sv010 |  | ||||||
| +	// The shadow register select bits [2:0] are set by reading the sv010 |  | ||||||
| +	// register. |  | ||||||
| +	pmii_data |= BCM5481_R18H_SV010_LPM; |  | ||||||
| +	ret = iegbe_oem_write_phy_reg_ex (hw, BCM5481_R18H, pmii_data); |  | ||||||
| +	if(ret) |  | ||||||
| +	{ |  | ||||||
| +		DEBUGOUT("Unable to write BCM5481_R18H register\n"); |  | ||||||
| +		printk (KERN_ERR "Unable to write BCM5481_R18H register\n"); |  | ||||||
| +		return ret; |  | ||||||
| +	} |  | ||||||
| + |  | ||||||
| + |  | ||||||
| +	// Set the RGMII RXD to RXC skew bit in reg 0x18, sv111 |  | ||||||
| + |  | ||||||
| +	if (bcm5481_read_18sv (hw, BCM5481_R18H_SV_MCTRL, &mctrl_data)) |  | ||||||
| +	{ |  | ||||||
| +		DEBUGOUT("Unable to read BCM5481_R18H_SV_MCTRL register\n"); |  | ||||||
| +		printk (KERN_ERR "Unable to read BCM5481_R18H_SV_MCTRL register\n"); |  | ||||||
| +		return ret; |  | ||||||
| +	} |  | ||||||
| +	mctrl_data |= (BCM5481_R18H_WE | BCM5481_R18H_SV111_SKEW); |  | ||||||
| + |  | ||||||
| +	ret = iegbe_oem_write_phy_reg_ex (hw, BCM5481_R18H, mctrl_data); |  | ||||||
| +	if(ret) |  | ||||||
| +	{ |  | ||||||
| +		DEBUGOUT("Unable to write BCM5481_R18H register\n"); |  | ||||||
| +		printk (KERN_ERR "Unable to write BCM5481_R18H register\n"); |  | ||||||
| +		return ret; |  | ||||||
| +	} |  | ||||||
| + |  | ||||||
| +	// Enable RGMII transmit clock delay in reg 0x1c, sv00011 |  | ||||||
| +	ret = bcm5481_read_1csv (hw, BCM5481_R1CH_CACR, &cacr_data); |  | ||||||
| +	if (ret) |  | ||||||
| +	{ |  | ||||||
| +		DEBUGOUT("Unable to read BCM5481_R1CH_CACR register\n"); |  | ||||||
| +		printk (KERN_ERR "Unable to read BCM5481_R1CH_CACR register\n"); |  | ||||||
| +		return ret; |  | ||||||
| +	} |  | ||||||
| + |  | ||||||
| +	cacr_data |= (BCM5481_R1CH_WE | BCM5481_R1CH_CACR_TCD); |  | ||||||
| + |  | ||||||
| +	ret = iegbe_oem_write_phy_reg_ex (hw, BCM5481_R1CH, cacr_data); |  | ||||||
| +	if(ret) |  | ||||||
| +	{ |  | ||||||
| +		DEBUGOUT("Unable to write BCM5481_R1CH register\n"); |  | ||||||
| +		printk (KERN_ERR "Unable to write BCM5481_R1CH register\n"); |  | ||||||
| +		return ret; |  | ||||||
| +	} |  | ||||||
| + |  | ||||||
| +	// Enable dual link speed indication (0x1c, sv 00010, bit 2) |  | ||||||
| +	ret = bcm5481_rmw_1csv (hw, BCM5481_R1CH_SC1, BCM5481_R1CH_SC1_LINK, BCM5481_R1CH_SC1_LINK); |  | ||||||
| +	if (ret) |  | ||||||
| +		return ret; |  | ||||||
| + |  | ||||||
| +	// Enable link and activity on ACTIVITY LED (0x1c, sv 01001, bit 4=1, bit 3=0) |  | ||||||
| +	ret = bcm5481_rmw_1csv (hw, BCM5481_R1CH_LCTRL, BCM5481_R1CH_LCTRL_ALEN, BCM5481_R1CH_LCTRL_ALEN | BCM5481_R1CH_LCTRL_AEN); |  | ||||||
| +	if (ret) |  | ||||||
| +		return ret; |  | ||||||
| + |  | ||||||
| +	return ret; |  | ||||||
| +} |  | ||||||
| --- a/Embedded/src/GbE/iegbe_oem_phy.h |  | ||||||
| +++ b/Embedded/src/GbE/iegbe_oem_phy.h |  | ||||||
| @@ -95,6 +95,8 @@ int32_t iegbe_oem_phy_is_link_up(struct |  | ||||||
|   |  | ||||||
|  #define DEFAULT_ICP_XXXX_TIPG_IPGT 8      /* Inter Packet Gap Transmit Time */ |  | ||||||
|  #define ICP_XXXX_TIPG_IPGT_MASK 0x000003FFUL  |  | ||||||
| +#define BCM5481_PHY_ID		0x0143BCA0 |  | ||||||
| +#define BCM5395S_PHY_ID		0x0143BCF0 |  | ||||||
|   |  | ||||||
|  /* Miscellaneous defines */ |  | ||||||
|  #ifdef IEGBE_10_100_ONLY |  | ||||||
| @@ -103,5 +105,65 @@ int32_t iegbe_oem_phy_is_link_up(struct |  | ||||||
|      #define ICP_XXXX_AUTONEG_ADV_DEFAULT	0x2F |  | ||||||
|  #endif |  | ||||||
|   |  | ||||||
| +/* BCM5481 specifics */ |  | ||||||
| + |  | ||||||
| +#define BCM5481_ECTRL		(0x10) |  | ||||||
| +#define BCM5481_ESTAT		(0x11) |  | ||||||
| +#define BCM5481_RXERR		(0x12) |  | ||||||
| +#define BCM5481_EXPRW		(0x15) |  | ||||||
| +#define BCM5481_EXPACC		(0x17) |  | ||||||
| +#define BCM5481_ASTAT		(0x19) |  | ||||||
| +#define BCM5481_R18H		(0x18) |  | ||||||
| +#define BCM5481_R1CH		(0x1c) |  | ||||||
| + |  | ||||||
| +/* indirect register access via register 18h */ |  | ||||||
| + |  | ||||||
| +#define BCM5481_R18H_SV_MASK	(7) // Mask for SV bits. |  | ||||||
| +#define BCM5481_R18H_SV_ACTRL	(0) // SV000 Aux. control |  | ||||||
| +#define BCM5481_R18H_SV_10BT	(1) // SV001 10Base-T |  | ||||||
| +#define BCM5481_R18H_SV_PMII	(2) // SV010 Power/MII control |  | ||||||
| +#define BCM5481_R18H_SV_MTEST	(4) // SV100 Misc. test |  | ||||||
| +#define BCM5481_R18H_SV_MCTRL	(7) // SV111 Misc. control |  | ||||||
| + |  | ||||||
| +#define BCM5481_R18H_SV001_POL	(1 << 13) // Polarity |  | ||||||
| +#define BCM5481_R18H_SV010_LPM	(1 << 6) |  | ||||||
| +#define BCM5481_R18H_SV111_SKEW	(1 << 8) |  | ||||||
| +#define BCM5481_R18H_WE		(1 << 15) // Write enable |  | ||||||
| + |  | ||||||
| +// 0x1c registers |  | ||||||
| +#define BCM5481_R1CH_SV_SHIFT	(10) |  | ||||||
| +#define BCM5481_R1CH_SV_MASK	(0x1f) |  | ||||||
| +#define BCM5481_R1CH_SC1	(0x02) // sv00010 Spare control 1 |  | ||||||
| +#define BCM5481_R1CH_CACR	(0x03) // sv00011 Clock alignment control |  | ||||||
| +#define BCM5481_R1CH_LCTRL	(0x09) // sv01001 LED control |  | ||||||
| +#define BCM5481_R1CH_LEDS1	(0x0d) // sv01101 LED selector 1 |  | ||||||
| + |  | ||||||
| +// 0x1c common |  | ||||||
| +#define BCM5481_R1CH_WE		(1 << 15) // Write enable |  | ||||||
| + |  | ||||||
| +// 0x1c, sv 00010 |  | ||||||
| +#define BCM5481_R1CH_SC1_LINK	(1 << 2) // sv00010 Linkspeed |  | ||||||
| + |  | ||||||
| +// 0x1c, sv 00011 |  | ||||||
| +#define BCM5481_R1CH_CACR_TCD	(1 << 9) // sv00011 RGMII tx clock delay |  | ||||||
| + |  | ||||||
| +// 0x1c, sv 01001 |  | ||||||
| +#define BCM5481_R1CH_LCTRL_ALEN	(1 << 4) // Activity/Link enable on ACTIVITY LED |  | ||||||
| +#define BCM5481_R1CH_LCTRL_AEN	(1 << 3) // Activity enable on ACTIVITY LED |  | ||||||
| + |  | ||||||
| +#define BCM5481_ECTRL_DISMDIX	(1 <<14) |  | ||||||
| + |  | ||||||
| +#define BCM5481_MCTRL_AUTOMDIX	(1 <<9) |  | ||||||
| + |  | ||||||
| +#define BCM5481_ESTAT_LINK	(1 << 8) |  | ||||||
| + |  | ||||||
| +#define BCM5481_ASTAT_ANC	(1 << 15) |  | ||||||
| +#define BCM5481_ASTAT_ANHCD	(7 << 8) |  | ||||||
| +#define BCM5481_ASTAT_HCD(x)	((x >> 8) & 7) |  | ||||||
| +#define BCM5481_ASTAT_1KBTFD	(0x7) |  | ||||||
| +#define BCM5481_ASTAT_1KBTHD	(0x6) |  | ||||||
| +#define BCM5481_ASTAT_100BTXFD	(0x5) |  | ||||||
| +#define BCM5481_ASTAT_100BTXHD	(0x3) |  | ||||||
| + |  | ||||||
|  #endif /* ifndef _IEGBE_OEM_PHY_H_ */ |  | ||||||
|    |  | ||||||
| @@ -1,11 +0,0 @@ | |||||||
| --- a/Embedded/src/CAN/icp_can_user.h |  | ||||||
| +++ b/Embedded/src/CAN/icp_can_user.h |  | ||||||
| @@ -63,6 +63,8 @@ |  | ||||||
|  #ifndef __ICP_CAN_USER_H__ |  | ||||||
|  #define __ICP_CAN_USER_H__ |  | ||||||
|   |  | ||||||
| +#include <linux/ioctl.h> |  | ||||||
| + |  | ||||||
|  /***************************************************************************** |  | ||||||
|   * Device IO control codes. |  | ||||||
|   *****************************************************************************/ |  | ||||||
| @@ -1,11 +0,0 @@ | |||||||
| --- a/Embedded/src/CAN/can_main.c |  | ||||||
| +++ b/Embedded/src/CAN/can_main.c |  | ||||||
| @@ -70,6 +70,8 @@ |  | ||||||
|   |  | ||||||
|  #include "can_main.h" |  | ||||||
|  #include "can_ioctl.h" |  | ||||||
| +#include <linux/fs.h> |  | ||||||
| + |  | ||||||
|   |  | ||||||
|  MODULE_AUTHOR("Intel(R) Corporation"); |  | ||||||
|  MODULE_DESCRIPTION("Controller Area Network Driver"); |  | ||||||
| @@ -1,23 +0,0 @@ | |||||||
| --- a/Embedded/src/CAN/can_main.c |  | ||||||
| +++ b/Embedded/src/CAN/can_main.c |  | ||||||
| @@ -654,7 +654,7 @@ int can_dev_io(struct inode *inode, stru |  | ||||||
|  /***************************************************************************** |  | ||||||
|   * Interrupt handler. |  | ||||||
|   *****************************************************************************/ |  | ||||||
| -irqreturn_t can_irq_handler(int irq, void *dev_id, struct pt_regs *regs) |  | ||||||
| +irqreturn_t can_irq_handler(int irq, void *dev_id) |  | ||||||
|  { |  | ||||||
|      can_os_t *can_os = (can_os_t *) dev_id; |  | ||||||
|      unsigned int int_status; |  | ||||||
| --- a/Embedded/src/CAN/can_main.h |  | ||||||
| +++ b/Embedded/src/CAN/can_main.h |  | ||||||
| @@ -165,8 +165,7 @@ int can_dev_io( |  | ||||||
|   |  | ||||||
|  irqreturn_t can_irq_handler( |  | ||||||
|      int irq,  |  | ||||||
| -    void *dev_id,  |  | ||||||
| -    struct pt_regs *regs); |  | ||||||
| +    void *dev_id); |  | ||||||
|   |  | ||||||
|  void can_tasklet( |  | ||||||
|      unsigned long arg |  | ||||||
| @@ -1,40 +0,0 @@ | |||||||
| --- a/Embedded/src/CAN/can_main.c |  | ||||||
| +++ b/Embedded/src/CAN/can_main.c |  | ||||||
| @@ -214,8 +214,8 @@ int can_pci_probe(struct pci_dev *dev, c |  | ||||||
|      spin_lock_init(&(g_can_os[can_num].int_spinlock)); |  | ||||||
|      spin_lock_init(&(g_can_os[can_num].open_spinlock)); |  | ||||||
|   |  | ||||||
| -    dev->dev.driver_data = (void *) &(g_can_os[can_num]); |  | ||||||
| -    if (!dev->dev.driver_data) |  | ||||||
| +    dev_set_drvdata(&dev->dev, (void *) &(g_can_os[can_num])); |  | ||||||
| +    if (!dev_get_drvdata(&dev->dev)) |  | ||||||
|      { |  | ||||||
|          printk("Couldn't create CAN device %d. Exiting.\n", |  | ||||||
|              dev->device); |  | ||||||
| @@ -237,7 +237,7 @@ int can_pci_probe(struct pci_dev *dev, c |  | ||||||
|   *****************************************************************************/ |  | ||||||
|  void can_pci_remove(struct pci_dev *dev) |  | ||||||
|  { |  | ||||||
| -    can_os_t *can_os = dev->dev.driver_data; |  | ||||||
| +    can_os_t *can_os = dev_get_drvdata(&dev->dev); |  | ||||||
|   |  | ||||||
|      iounmap(can_os->pci_remap); |  | ||||||
|      icp_can_destroy(can_os->can); |  | ||||||
| @@ -251,7 +251,7 @@ int can_pci_suspend(struct pci_dev *dev, |  | ||||||
|  { |  | ||||||
|      unsigned int i; |  | ||||||
|      unsigned int int_status; |  | ||||||
| -    can_os_t *can_os = dev->dev.driver_data; |  | ||||||
| +    can_os_t *can_os = dev_get_drvdata(&dev->dev); |  | ||||||
|      int err; |  | ||||||
|   |  | ||||||
|  	/* Indicate that we are suspending */ |  | ||||||
| @@ -322,7 +322,7 @@ int can_pci_suspend(struct pci_dev *dev, |  | ||||||
|  int can_pci_resume(struct pci_dev *dev) |  | ||||||
|  { |  | ||||||
|      unsigned int i; |  | ||||||
| -    can_os_t *can_os = dev->dev.driver_data; |  | ||||||
| +    can_os_t *can_os = dev_get_drvdata(&dev->dev); |  | ||||||
|   |  | ||||||
|  	/* Restore PCI CFG space */ |  | ||||||
|  	pci_restore_state(dev); |  | ||||||
| @@ -1,59 +0,0 @@ | |||||||
| --- a/Embedded/src/WDT/iwdt.c |  | ||||||
| +++ b/Embedded/src/WDT/iwdt.c |  | ||||||
| @@ -180,19 +180,19 @@ MODULE_PARM_DESC(wdt_scale, "Intel WDT s |  | ||||||
|  module_param(wdt_intr_type, byte, WDT_INT_TYPE_IRQ); |  | ||||||
|  MODULE_PARM_DESC(wdt_intr_type, "Intel WDT interrupt type (default SERIRQ)."); |  | ||||||
|   |  | ||||||
| -module_param(wdt_margin1, uint, TIMER_MARGIN); |  | ||||||
| +module_param(wdt_margin1, uint, 0); |  | ||||||
|  MODULE_PARM_DESC(wdt_margin1, "First stage Intel WDT timeout in steps of 1 ms by default."); |  | ||||||
|   |  | ||||||
| -module_param(wdt_margin2, uint, TIMER_MARGIN); |  | ||||||
| +module_param(wdt_margin2, uint, 0); |  | ||||||
|  MODULE_PARM_DESC(wdt_margin2, "Second stage Intel WDT timeout in steps of 1 ms by default."); |  | ||||||
|   |  | ||||||
|  module_param(nowayout, int, 0); |  | ||||||
|  MODULE_PARM_DESC(nowayout, "Intel WDT can't be stopped once started (default=0)"); |  | ||||||
|   |  | ||||||
| -module_param(wdt_index_port, int, 0x4E); |  | ||||||
| +module_param(wdt_index_port, int, 0); |  | ||||||
|  MODULE_PARM_DESC(wdt_index_port, "WDT Index Port (default 0x4e)"); |  | ||||||
|   |  | ||||||
| -module_param(wdt_data_port, int, 0x4E); |  | ||||||
| +module_param(wdt_data_port, int, 0); |  | ||||||
|  MODULE_PARM_DESC(wdt_data_port, "WDT Data Port (default 0x4f)"); |  | ||||||
|   |  | ||||||
|  static int wdt_get_iobase(struct pci_dev *dev, u16 *iobase, int *irq); |  | ||||||
| @@ -218,7 +218,7 @@ static ssize_t wdt_write(struct file *fi |  | ||||||
|                       size_t count, loff_t * pos); |  | ||||||
|  static int wdt_ioctl(struct inode *inode, struct file *file, |  | ||||||
|                      unsigned int cmd, unsigned long arg); |  | ||||||
| -static irqreturn_t wdt_isr(int irq, void *dev_id, struct pt_regs *regs); |  | ||||||
| +static irqreturn_t wdt_isr(int irq, void *dev_id); |  | ||||||
|  static void __exit wdt_cleanup(void); |  | ||||||
|  static int __init wdt_init(void); |  | ||||||
|  static int __init wdt_init_one(struct pci_dev *dev, |  | ||||||
| @@ -255,7 +255,7 @@ static struct pci_driver wdt_driver = { |  | ||||||
|       name:        "iwdt", |  | ||||||
|       id_table:     lpc_pci_tbl, |  | ||||||
|       probe:        wdt_init_one, |  | ||||||
| -     remove:        __devexit(wdt_remove_one), |  | ||||||
| +     remove:        __devexit_p(wdt_remove_one), |  | ||||||
|       suspend:      wdt_pci_suspend, |  | ||||||
|       resume:       wdt_pci_resume, |  | ||||||
|  }; |  | ||||||
| @@ -1393,12 +1393,12 @@ static int wdt_ioctl(struct inode *inode |  | ||||||
|   |  | ||||||
|  /* |  | ||||||
|   * Function Name:   wdt_isr() |  | ||||||
| - * Parameter:    int irq - irq number, void *dev_id, struct pt_regs *regs |  | ||||||
| + * Parameter:    int irq - irq number, void *dev_id |  | ||||||
|   * Return Value::   IRQ_NONE -  if the interrupt is not for wdt. |  | ||||||
|   *           IRQ_HANDLED - if it is for wdt. |  | ||||||
|   * Description:     This is the interrupt service routine of the WDT. |  | ||||||
|   */ |  | ||||||
| -static irqreturn_t wdt_isr(int irq, void *dev_id, struct pt_regs *regs) |  | ||||||
| +static irqreturn_t wdt_isr(int irq, void *dev_id) |  | ||||||
|  { |  | ||||||
|       u8 val; |  | ||||||
|   |  | ||||||
| @@ -1,22 +0,0 @@ | |||||||
| --- a/Embedded/src/EDMA/dma_linux.c |  | ||||||
| +++ b/Embedded/src/EDMA/dma_linux.c |  | ||||||
| @@ -149,8 +149,7 @@ int32_t edma_suspend (struct pci_dev *de |  | ||||||
|  int32_t edma_resume(struct pci_dev *dev); |  | ||||||
|  int32_t initialize_edma_device(struct edma_device *device); |  | ||||||
|   |  | ||||||
| -static irqreturn_t edma_irq_handler(int32_t irq, void * dev_id, |  | ||||||
| -                                    struct pt_regs * regs); |  | ||||||
| +static irqreturn_t edma_irq_handler(int32_t irq, void * dev_id); |  | ||||||
|   |  | ||||||
|  /* Prototypes - Misc. */ |  | ||||||
|   |  | ||||||
| @@ -429,8 +428,7 @@ int32_t edma_release(struct inode * inod |  | ||||||
|   * Return Values: HANDLED = 1, NOT_HANDLED = 0 |  | ||||||
|   *****************************************************************************/ |  | ||||||
|   |  | ||||||
| -static irqreturn_t edma_irq_handler(int32_t irq, void * dev_id, |  | ||||||
| -                                    struct pt_regs * regs) |  | ||||||
| +static irqreturn_t edma_irq_handler(int32_t irq, void * dev_id) |  | ||||||
|  { |  | ||||||
|   |  | ||||||
|      uint32_t clear_bits; |  | ||||||
| @@ -1,22 +0,0 @@ | |||||||
| --- a/Embedded/src/1588/1588.c |  | ||||||
| +++ b/Embedded/src/1588/1588.c |  | ||||||
| @@ -631,7 +631,7 @@ int restore_interrupts(void) |  | ||||||
|        IRQ_NONE => this device did not interrupt |  | ||||||
|   |  | ||||||
|  ******************************************************************************/ |  | ||||||
| -irqreturn_t timesync_isr(int irq, void *dev_id, struct pt_regs *regs) |  | ||||||
| +irqreturn_t timesync_isr(int irq, void *dev_id) |  | ||||||
|  { |  | ||||||
|      if ( !ixTimeSyncAccEventAmmsFlagGet() && !ixTimeSyncAccEventAsmsFlagGet()&& |  | ||||||
|         !ixTimeSyncAccEventAtmFlagGet() && !ixTimeSyncAccEventPpsmFlagGet()&& |  | ||||||
| --- a/Embedded/src/1588/1588.h |  | ||||||
| +++ b/Embedded/src/1588/1588.h |  | ||||||
| @@ -128,7 +128,7 @@ int pci_suspend(struct pci_dev *dev, pm_ |  | ||||||
|  int pci_resume(struct pci_dev *dev); |  | ||||||
|  int pci_probe(struct pci_dev *dev, const struct pci_device_id *id); |  | ||||||
|  void pci_remove(struct pci_dev *dev); |  | ||||||
| -irqreturn_t timesync_isr(int irq, void *dev_id, struct pt_regs *regs); |  | ||||||
| +irqreturn_t timesync_isr(int irq, void *dev_id); |  | ||||||
|   |  | ||||||
|  // private functions |  | ||||||
|  int save_reg_state(void); |  | ||||||
| @@ -1,22 +0,0 @@ | |||||||
| --- a/Embedded/src/CAN/can_main.h |  | ||||||
| +++ b/Embedded/src/CAN/can_main.h |  | ||||||
| @@ -65,7 +65,7 @@ |  | ||||||
|   |  | ||||||
|  #include <linux/interrupt.h> |  | ||||||
|  #include <linux/pci.h> |  | ||||||
| -#include <asm/semaphore.h> |  | ||||||
| +#include <linux/semaphore.h> |  | ||||||
|  #include <linux/spinlock.h> |  | ||||||
|  #include <linux/cdev.h> |  | ||||||
|  #include <asm/uaccess.h> |  | ||||||
| --- a/Embedded/src/EDMA/dma_linux.c |  | ||||||
| +++ b/Embedded/src/EDMA/dma_linux.c |  | ||||||
| @@ -87,7 +87,7 @@ |  | ||||||
|  #include <linux/fcntl.h>   /* O_ACCMODE */ |  | ||||||
|  #include <asm/system.h>    /* cli, *_flags */ |  | ||||||
|  #include <asm/uaccess.h>   /* copy_to_user */ |  | ||||||
| -#include <asm/semaphore.h> |  | ||||||
| +#include <linux/semaphore.h> |  | ||||||
|  #include <asm/io.h>        /* inb(), outb() */ |  | ||||||
|  #include <linux/kmod.h> |  | ||||||
|  #include <linux/ioport.h>  /* request_region */ |  | ||||||
| @@ -1,30 +0,0 @@ | |||||||
| --- a/Embedded/src/1588/1588.c |  | ||||||
| +++ b/Embedded/src/1588/1588.c |  | ||||||
| @@ -72,6 +72,7 @@ |  | ||||||
|   * |  | ||||||
|   ****************************************************************************/ |  | ||||||
|   |  | ||||||
| +#include <linux/sched.h> |  | ||||||
|  #include "1588.h" |  | ||||||
|   |  | ||||||
|  MODULE_AUTHOR("Intel(R) Corporation"); |  | ||||||
| --- a/Embedded/src/CAN/can_main.c |  | ||||||
| +++ b/Embedded/src/CAN/can_main.c |  | ||||||
| @@ -68,6 +68,7 @@ |  | ||||||
|   * |  | ||||||
|   **************************************************************************/ |  | ||||||
|   |  | ||||||
| +#include <linux/sched.h> |  | ||||||
|  #include "can_main.h" |  | ||||||
|  #include "can_ioctl.h" |  | ||||||
|  #include <linux/fs.h> |  | ||||||
| --- a/Embedded/src/WDT/iwdt.c |  | ||||||
| +++ b/Embedded/src/WDT/iwdt.c |  | ||||||
| @@ -137,6 +137,7 @@ |  | ||||||
|  #include <linux/watchdog.h> |  | ||||||
|  #include <linux/miscdevice.h> |  | ||||||
|  #include <linux/interrupt.h> |  | ||||||
| +#include <linux/sched.h> |  | ||||||
|  #include "iwdt.h" |  | ||||||
|   |  | ||||||
|  MODULE_AUTHOR("Intel(R) Corporation"); |  | ||||||
| @@ -1,31 +0,0 @@ | |||||||
| --- a/Embedded/src/GbE/kcompat.h |  | ||||||
| +++ b/Embedded/src/GbE/kcompat.h |  | ||||||
| @@ -46,12 +46,6 @@ GPL LICENSE SUMMARY |  | ||||||
|  #include <linux/sched.h> |  | ||||||
|  #include <asm/io.h> |  | ||||||
|   |  | ||||||
| -#ifndef IRQ_HANDLED |  | ||||||
| -#define irqreturn_t void |  | ||||||
| -#define IRQ_HANDLED |  | ||||||
| -#define IRQ_NONE |  | ||||||
| -#endif |  | ||||||
| - |  | ||||||
|  #ifndef SET_NETDEV_DEV |  | ||||||
|  #define SET_NETDEV_DEV(net, pdev) |  | ||||||
|  #endif |  | ||||||
| @@ -748,6 +742,15 @@ extern void dump_stack(void); |  | ||||||
|   |  | ||||||
|  #endif /* 2.4.24 */ |  | ||||||
|   |  | ||||||
| +/*****************************************************************************/ |  | ||||||
| +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) ) |  | ||||||
| +#ifndef IRQ_HANDLED |  | ||||||
| +#define irqreturn_t void |  | ||||||
| +#define IRQ_HANDLED |  | ||||||
| +#define IRQ_NONE |  | ||||||
| +#endif |  | ||||||
| +#endif /* < 2.6.30 */ |  | ||||||
| + |  | ||||||
|  #endif /* _KCOMPAT_H_ */ |  | ||||||
|   |  | ||||||
|    |  | ||||||
| @@ -1,11 +0,0 @@ | |||||||
| --- a/Embedded/src/GbE/iegbe_main.c |  | ||||||
| +++ b/Embedded/src/GbE/iegbe_main.c |  | ||||||
| @@ -3534,7 +3534,7 @@ static int iegbe_clean(struct napi_struc |  | ||||||
|  	int tx_cleaned = 0, work_done = 0; |  | ||||||
|   |  | ||||||
|  	/* Must NOT use netdev_priv macro here. */ |  | ||||||
| -	adapter = poll_dev->priv; |  | ||||||
| +	adapter = netdev_priv(poll_dev); |  | ||||||
|   |  | ||||||
|  	/* iegbe_clean is called per-cpu.  This lock protects |  | ||||||
|  	 * tx_ring[0] from being cleaned by multiple cpus |  | ||||||
| @@ -1,91 +0,0 @@ | |||||||
| --- a/Embedded/src/GbE/Makefile |  | ||||||
| +++ b/Embedded/src/GbE/Makefile |  | ||||||
| @@ -60,19 +60,19 @@ GBE_NAME = iegbe |  | ||||||
|  GCU_NAME = gcu |  | ||||||
|   |  | ||||||
|  VERSION_FILE := $(KSRC)/include/linux/version.h |  | ||||||
| -UTS_REL_FILE := $(KSRC)/include/linux/utsrelease.h |  | ||||||
| -CONFIG_FILE  := $(KSRC)/include/linux/autoconf.h |  | ||||||
| +UTS_REL_FILE := $(KSRC)/include/generated/utsrelease.h |  | ||||||
| +CONFIG_FILE  := $(KSRC)/include/generated/autoconf.h |  | ||||||
|   |  | ||||||
|  ifeq (,$(wildcard $(VERSION_FILE))) |  | ||||||
|    $(error Linux kernel source not configured - missing version.h) |  | ||||||
|  endif |  | ||||||
|   |  | ||||||
|  ifeq (,$(wildcard $(CONFIG_FILE))) |  | ||||||
| -  $(error Linux kernel source not configured - missing autoconf.h) |  | ||||||
| +    $(error Linux kernel source not configured - missing autoconf.h) |  | ||||||
|  endif |  | ||||||
|   |  | ||||||
|  ifeq (,$(wildcard $(UTS_REL_FILE))) |  | ||||||
| -  $(error Linux kernel source not configured - missing utsrelease.h) |  | ||||||
| +    $(error Linux kernel source not configured - missing utsrelease.h) |  | ||||||
|  endif |  | ||||||
|   |  | ||||||
|  # set the install path |  | ||||||
| --- a/Embedded/src/1588/Makefile |  | ||||||
| +++ b/Embedded/src/1588/Makefile |  | ||||||
| @@ -97,8 +97,8 @@ OUTPUT_PATH ?= / |  | ||||||
|  EXTRA_LDFLAGS += -whole-archive |  | ||||||
|   |  | ||||||
|  VERSION_FILE := $(KOBJ)/include/linux/version.h |  | ||||||
| -UTS_REL_FILE := $(KSRC)/include/linux/utsrelease.h |  | ||||||
| -CONFIG_FILE  := $(KOBJ)/include/linux/autoconf.h |  | ||||||
| +UTS_REL_FILE := $(KSRC)/include/generated/utsrelease.h |  | ||||||
| +CONFIG_FILE  := $(KOBJ)/include/generated/autoconf.h |  | ||||||
|   |  | ||||||
|    |  | ||||||
|  # as of 2.6.16, kernel define UTS_RELEASE has been moved to utsrelease.h |  | ||||||
| --- a/Embedded/src/CAN/Makefile |  | ||||||
| +++ b/Embedded/src/CAN/Makefile |  | ||||||
| @@ -100,8 +100,8 @@ OUTPUT_PATH ?= / |  | ||||||
|  EXTRA_LDFLAGS += -whole-archive |  | ||||||
|   |  | ||||||
|  VERSION_FILE := $(KOBJ)/include/linux/version.h |  | ||||||
| -UTS_REL_FILE := $(KSRC)/include/linux/utsrelease.h |  | ||||||
| -CONFIG_FILE  := $(KOBJ)/include/linux/autoconf.h |  | ||||||
| +UTS_REL_FILE := $(KSRC)/include/generated/utsrelease.h |  | ||||||
| +CONFIG_FILE  := $(KOBJ)/include/generated/autoconf.h |  | ||||||
|   |  | ||||||
|    |  | ||||||
|  # as of 2.6.16, kernel define UTS_RELEASE has been moved to utsrelease.h |  | ||||||
| --- a/Embedded/src/EDMA/Makefile |  | ||||||
| +++ b/Embedded/src/EDMA/Makefile |  | ||||||
| @@ -114,8 +114,8 @@ OUTPUT_PATH ?= / |  | ||||||
|  EXTRA_LDFLAGS += -whole-archive |  | ||||||
|   |  | ||||||
|  VERSION_FILE := $(KOBJ)/include/linux/version.h |  | ||||||
| -UTS_REL_FILE := $(KSRC)/include/linux/utsrelease.h |  | ||||||
| -CONFIG_FILE  := $(KOBJ)/include/linux/autoconf.h |  | ||||||
| +UTS_REL_FILE := $(KSRC)/include/generated/utsrelease.h |  | ||||||
| +CONFIG_FILE  := $(KOBJ)/include/generated/autoconf.h |  | ||||||
|   |  | ||||||
|    |  | ||||||
|  # as of 2.6.16, kernel define UTS_RELEASE has been moved to utsrelease.h |  | ||||||
| --- a/Embedded/src/GPIO/Makefile |  | ||||||
| +++ b/Embedded/src/GPIO/Makefile |  | ||||||
| @@ -97,8 +97,8 @@ OUTPUT_PATH ?= / |  | ||||||
|  EXTRA_LDFLAGS += -whole-archive |  | ||||||
|   |  | ||||||
|  VERSION_FILE := $(KOBJ)/include/linux/version.h |  | ||||||
| -UTS_REL_FILE := $(KSRC)/include/linux/utsrelease.h |  | ||||||
| -CONFIG_FILE  := $(KOBJ)/include/linux/autoconf.h |  | ||||||
| +UTS_REL_FILE := $(KSRC)/include/generated/utsrelease.h |  | ||||||
| +CONFIG_FILE  := $(KOBJ)/include/generated/autoconf.h |  | ||||||
|   |  | ||||||
|    |  | ||||||
|  # as of 2.6.16, kernel define UTS_RELEASE has been moved to utsrelease.h |  | ||||||
| --- a/Embedded/src/WDT/Makefile |  | ||||||
| +++ b/Embedded/src/WDT/Makefile |  | ||||||
| @@ -99,8 +99,8 @@ OUTPUT_PATH ?= / |  | ||||||
|  EXTRA_LDFLAGS += -whole-archive |  | ||||||
|   |  | ||||||
|  VERSION_FILE := $(KOBJ)/include/linux/version.h |  | ||||||
| -UTS_REL_FILE := $(KSRC)/include/linux/utsrelease.h |  | ||||||
| -CONFIG_FILE  := $(KOBJ)/include/linux/autoconf.h |  | ||||||
| +UTS_REL_FILE := $(KSRC)/include/generated/utsrelease.h |  | ||||||
| +CONFIG_FILE  := $(KOBJ)/include/generated/autoconf.h |  | ||||||
|   |  | ||||||
|    |  | ||||||
|  # as of 2.6.16, kernel define UTS_RELEASE has been moved to utsrelease.h |  | ||||||
| @@ -1,392 +0,0 @@ | |||||||
| --- a/Embedded/src/GbE/kcompat.h |  | ||||||
| +++ b/Embedded/src/GbE/kcompat.h |  | ||||||
| @@ -590,6 +590,10 @@ static inline void _kc_synchronize_irq() |  | ||||||
|  #define ETHTOOL_OPS_COMPAT |  | ||||||
|  #endif |  | ||||||
|   |  | ||||||
| +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) |  | ||||||
| +#define HAVE_NETIF_MSG 1 |  | ||||||
| +#endif |  | ||||||
| + |  | ||||||
|  #ifndef HAVE_NETIF_MSG |  | ||||||
|  #define HAVE_NETIF_MSG 1 |  | ||||||
|  enum { |  | ||||||
| --- a/Embedded/src/GbE/iegbe_main.c |  | ||||||
| +++ b/Embedded/src/GbE/iegbe_main.c |  | ||||||
| @@ -159,9 +159,9 @@ static void iegbe_smartspeed(struct iegb |  | ||||||
|  static inline int iegbe_82547_fifo_workaround(struct iegbe_adapter *adapter, |  | ||||||
|                            struct sk_buff *skb); |  | ||||||
|   |  | ||||||
| -static void iegbe_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp); |  | ||||||
| -static void iegbe_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid); |  | ||||||
| -static void iegbe_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid); |  | ||||||
| +static bool iegbe_vlan_used(struct iegbe_adapter *adapter); |  | ||||||
| +static int iegbe_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid); |  | ||||||
| +static int iegbe_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid); |  | ||||||
|  static void iegbe_restore_vlan(struct iegbe_adapter *adapter); |  | ||||||
|   |  | ||||||
|  static int iegbe_notify_reboot(struct notifier_block *, |  | ||||||
| @@ -324,8 +324,8 @@ static void iegbe_update_mng_vlan(struct |  | ||||||
|          struct net_device *netdev = adapter->netdev; |  | ||||||
|  	u16 vid = hw->mng_cookie.vlan_id; |  | ||||||
|          u16 old_vid = adapter->mng_vlan_id; |  | ||||||
| -        if (adapter->vlgrp) { |  | ||||||
| -                if (!vlan_group_get_device(adapter->vlgrp, vid)) { |  | ||||||
| +        if (iegbe_vlan_used(adapter)) { |  | ||||||
| +                if (!test_bit(old_vid, adapter->active_vlans)) { |  | ||||||
|  			if (hw->mng_cookie.status & |  | ||||||
|                                  E1000_MNG_DHCP_COOKIE_STATUS_VLAN_SUPPORT) { |  | ||||||
|                                  iegbe_vlan_rx_add_vid(netdev, vid); |  | ||||||
| @@ -335,7 +335,7 @@ static void iegbe_update_mng_vlan(struct |  | ||||||
|   |  | ||||||
|                          if ((old_vid != (u16)E1000_MNG_VLAN_NONE) && |  | ||||||
|                                          (vid != old_vid) && |  | ||||||
| -                            !vlan_group_get_device(adapter->vlgrp, old_vid)) |  | ||||||
| +                            !test_bit(old_vid, adapter->active_vlans)) |  | ||||||
|                                  iegbe_vlan_rx_kill_vid(netdev, old_vid); |  | ||||||
|                  } else |  | ||||||
|                          adapter->mng_vlan_id = vid; |  | ||||||
| @@ -736,7 +736,6 @@ static const struct net_device_ops iegbe |  | ||||||
|  	.ndo_do_ioctl		= iegbe_ioctl, |  | ||||||
|  	.ndo_validate_addr	= eth_validate_addr, |  | ||||||
|   |  | ||||||
| -	.ndo_vlan_rx_register	= iegbe_vlan_rx_register, |  | ||||||
|  	.ndo_vlan_rx_add_vid	= iegbe_vlan_rx_add_vid, |  | ||||||
|  	.ndo_vlan_rx_kill_vid	= iegbe_vlan_rx_kill_vid, |  | ||||||
|  #ifdef CONFIG_NET_POLL_CONTROLLER |  | ||||||
| @@ -767,7 +766,6 @@ static int __devinit iegbe_probe(struct |  | ||||||
|  	u16 eeprom_data = 0; |  | ||||||
|  	u16 eeprom_apme_mask = E1000_EEPROM_APME; |  | ||||||
|  	int bars;  |  | ||||||
| -	DECLARE_MAC_BUF(mac); |  | ||||||
|   |  | ||||||
|  	bars = pci_select_bars(pdev, IORESOURCE_MEM); |  | ||||||
|  	err = pci_enable_device(pdev); |  | ||||||
| @@ -1247,8 +1245,7 @@ static int iegbe_close(struct net_device |  | ||||||
|   |  | ||||||
|  	if ((hw->mng_cookie.status & |  | ||||||
|  			  E1000_MNG_DHCP_COOKIE_STATUS_VLAN_SUPPORT) && |  | ||||||
| -	     !(adapter->vlgrp && |  | ||||||
| -	       vlan_group_get_device(adapter->vlgrp, adapter->mng_vlan_id))) { |  | ||||||
| +	     !test_bit(adapter->mng_vlan_id, adapter->active_vlans)) { |  | ||||||
|  		iegbe_vlan_rx_kill_vid(netdev, adapter->mng_vlan_id); |  | ||||||
|  	} |  | ||||||
|  	return 0; |  | ||||||
| @@ -2163,11 +2160,13 @@ static void iegbe_set_rx_mode(struct net |  | ||||||
|  	struct iegbe_hw *hw = &adapter->hw; |  | ||||||
|  	struct netdev_hw_addr *ha; |  | ||||||
|  	bool use_uc = false; |  | ||||||
| +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) |  | ||||||
|  	struct dev_addr_list *mc_ptr; |  | ||||||
| -	u32 rctl; |  | ||||||
|  	u32 hash_value; |  | ||||||
| -	int i, rar_entries = E1000_RAR_ENTRIES; |  | ||||||
|  int mta_reg_count = E1000_NUM_MTA_REGISTERS; |  | ||||||
| +#endif |  | ||||||
| +	u32 rctl; |  | ||||||
| +	int i, rar_entries = E1000_RAR_ENTRIES; |  | ||||||
|   |  | ||||||
|  	/* reserve RAR[14] for LAA over-write work-around */ |  | ||||||
|  	if (hw->mac_type == iegbe_82571) |  | ||||||
| @@ -2220,6 +2219,7 @@ int mta_reg_count = E1000_NUM_MTA_REGIST |  | ||||||
|   |  | ||||||
|  	WARN_ON(i == rar_entries); |  | ||||||
|   |  | ||||||
| +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) |  | ||||||
|  	mc_ptr = netdev->mc_list; |  | ||||||
|   |  | ||||||
|  	for (; i < rar_entries; i++) { |  | ||||||
| @@ -2247,6 +2247,7 @@ int mta_reg_count = E1000_NUM_MTA_REGIST |  | ||||||
|  		hash_value = iegbe_hash_mc_addr(hw, mc_ptr->da_addr); |  | ||||||
|  		iegbe_mta_set(hw, hash_value); |  | ||||||
|  	} |  | ||||||
| +#endif |  | ||||||
|   |  | ||||||
|  	if (hw->mac_type == iegbe_82542_rev2_0) |  | ||||||
|  		iegbe_leave_82542_rst(adapter); |  | ||||||
| @@ -2821,14 +2822,14 @@ static int iegbe_tx_map(struct iegbe_ada |  | ||||||
|               * Avoid terminating buffers within evenly-aligned |  | ||||||
|               * dwords. */ |  | ||||||
|              if(unlikely(adapter->pcix_82544 && |  | ||||||
| -			   !((unsigned long)(frag->page+offset+size-1) & 4) && |  | ||||||
| +			   !((unsigned long)(frag->page.p+offset+size-1) & 4) && |  | ||||||
|  			   size > 4)) |  | ||||||
|  				size -= 4; |  | ||||||
|   |  | ||||||
|              buffer_info->length = size; |  | ||||||
|              buffer_info->dma = |  | ||||||
|                  pci_map_page(adapter->pdev, |  | ||||||
| -                    frag->page, |  | ||||||
| +                    frag->page.p, |  | ||||||
|                      offset, |  | ||||||
|                      size, |  | ||||||
|                      PCI_DMA_TODEVICE); |  | ||||||
| @@ -3131,7 +3132,7 @@ static int iegbe_xmit_frame(struct sk_bu |  | ||||||
|  		} |  | ||||||
|  	} |  | ||||||
|   |  | ||||||
| -	if (unlikely(adapter->vlgrp && vlan_tx_tag_present(skb))) { |  | ||||||
| +	if (unlikely(iegbe_vlan_used(adapter) && vlan_tx_tag_present(skb))) { |  | ||||||
|  		tx_flags |= E1000_TX_FLAGS_VLAN; |  | ||||||
|  		tx_flags |= (vlan_tx_tag_get(skb) << E1000_TX_FLAGS_VLAN_SHIFT); |  | ||||||
|  	} |  | ||||||
| @@ -3832,10 +3833,12 @@ static bool iegbe_clean_rx_irq(struct ie |  | ||||||
|   |  | ||||||
|  		skb->protocol = eth_type_trans(skb, netdev); |  | ||||||
|   |  | ||||||
| -		if (unlikely(adapter->vlgrp && |  | ||||||
| +		if (unlikely(iegbe_vlan_used(adapter) && |  | ||||||
|  			    (status & E1000_RXD_STAT_VP))) { |  | ||||||
| -			vlan_hwaccel_receive_skb(skb, adapter->vlgrp, |  | ||||||
| -						 le16_to_cpu(rx_desc->special)); |  | ||||||
| +			u16 vid; |  | ||||||
| + |  | ||||||
| +			vid = le16_to_cpu(rx_desc->special); |  | ||||||
| +			__vlan_hwaccel_put_tag(skb, vid); |  | ||||||
|  		} else { |  | ||||||
|  			netif_receive_skb(skb); |  | ||||||
|  		} |  | ||||||
| @@ -3986,9 +3989,10 @@ copydone: |  | ||||||
|  			   cpu_to_le16(E1000_RXDPS_HDRSTAT_HDRSP))) |  | ||||||
|              adapter->rx_hdr_split++; |  | ||||||
|   |  | ||||||
| -        if(unlikely(adapter->vlgrp && (staterr & E1000_RXD_STAT_VP))) { |  | ||||||
| -            vlan_hwaccel_receive_skb(skb, adapter->vlgrp, |  | ||||||
| -				le16_to_cpu(rx_desc->wb.middle.vlan)); |  | ||||||
| +        if(unlikely(iegbe_vlan_used(adapter) && (staterr & E1000_RXD_STAT_VP))) { |  | ||||||
| +	    u16 vid; |  | ||||||
| +	    vid = le16_to_cpu(rx_desc->wb.middle.vlan); |  | ||||||
| +	    __vlan_hwaccel_put_tag(skb, vid); |  | ||||||
|          } else { |  | ||||||
|              netif_receive_skb(skb); |  | ||||||
|          } |  | ||||||
| @@ -4496,17 +4500,25 @@ iegbe_io_write(struct iegbe_hw *hw, unsi |  | ||||||
|      outl(value, port); |  | ||||||
|  } |  | ||||||
|   |  | ||||||
| -static void iegbe_vlan_rx_register(struct net_device *netdev, |  | ||||||
| -				   struct vlan_group *grp) |  | ||||||
| +static bool iegbe_vlan_used(struct iegbe_adapter *adapter) |  | ||||||
| +{ |  | ||||||
| +	u16 vid; |  | ||||||
| + |  | ||||||
| +	for_each_set_bit(vid, adapter->active_vlans, VLAN_N_VID) |  | ||||||
| +		return true; |  | ||||||
| + |  | ||||||
| +	return false; |  | ||||||
| +} |  | ||||||
| + |  | ||||||
| +static void iegbe_vlan_mode(struct net_device *netdev, bool vlan_on) |  | ||||||
|  { |  | ||||||
|      struct iegbe_adapter *adapter = netdev_priv(netdev); |  | ||||||
|      uint32_t ctrl, rctl; |  | ||||||
|   |  | ||||||
|  	if (!test_bit(__E1000_DOWN, &adapter->flags)) |  | ||||||
|      iegbe_irq_disable(adapter); |  | ||||||
| -    adapter->vlgrp = grp; |  | ||||||
|   |  | ||||||
| -    if(grp) { |  | ||||||
| +    if(vlan_on) { |  | ||||||
|          /* enable VLAN tag insert/strip */ |  | ||||||
|          ctrl = E1000_READ_REG(&adapter->hw, CTRL); |  | ||||||
|          ctrl |= E1000_CTRL_VME; |  | ||||||
| @@ -4538,30 +4550,37 @@ static void iegbe_vlan_rx_register(struc |  | ||||||
|      iegbe_irq_enable(adapter); |  | ||||||
|  } |  | ||||||
|   |  | ||||||
| -static void iegbe_vlan_rx_add_vid(struct net_device *netdev, u16 vid) |  | ||||||
| +static int iegbe_vlan_rx_add_vid(struct net_device *netdev, u16 vid) |  | ||||||
|  { |  | ||||||
|      struct iegbe_adapter *adapter = netdev_priv(netdev); |  | ||||||
|      uint32_t vfta, index; |  | ||||||
|      if((adapter->hw.mng_cookie.status & |  | ||||||
|          E1000_MNG_DHCP_COOKIE_STATUS_VLAN_SUPPORT) && |  | ||||||
|          (vid == adapter->mng_vlan_id)) { |  | ||||||
| -        return; |  | ||||||
| +        return 0; |  | ||||||
|      } |  | ||||||
| + |  | ||||||
| +    if (!iegbe_vlan_used(adapter)) |  | ||||||
| +	iegbe_vlan_mode(netdev, true); |  | ||||||
| + |  | ||||||
|      /* add VID to filter table */ |  | ||||||
|      index = (vid >> 0x5) & 0x7F; |  | ||||||
|      vfta = E1000_READ_REG_ARRAY(&adapter->hw, VFTA, index); |  | ||||||
|      vfta |= (0x1 << (vid & 0x1F)); |  | ||||||
|      iegbe_write_vfta(&adapter->hw, index, vfta); |  | ||||||
| + |  | ||||||
| +    set_bit(vid, adapter->active_vlans); |  | ||||||
| + |  | ||||||
| +    return 0; |  | ||||||
|  } |  | ||||||
|   |  | ||||||
| -static void iegbe_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) |  | ||||||
| +static int iegbe_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) |  | ||||||
|  { |  | ||||||
|  	struct iegbe_adapter *adapter = netdev_priv(netdev); |  | ||||||
|  	u32 vfta, index; |  | ||||||
|   |  | ||||||
|  	if (!test_bit(__E1000_DOWN, &adapter->flags)) |  | ||||||
|  	iegbe_irq_disable(adapter); |  | ||||||
| -	vlan_group_set_device(adapter->vlgrp, vid, NULL); |  | ||||||
|  	if (!test_bit(__E1000_DOWN, &adapter->flags)) |  | ||||||
|  	iegbe_irq_enable(adapter); |  | ||||||
|   |  | ||||||
| @@ -4570,21 +4589,26 @@ static void iegbe_vlan_rx_kill_vid(struc |  | ||||||
|  	vfta = E1000_READ_REG_ARRAY(&adapter->hw, VFTA, index); |  | ||||||
|  	vfta &= ~(0x1 << (vid & 0x1F)); |  | ||||||
|  	iegbe_write_vfta(&adapter->hw, index, vfta); |  | ||||||
| + |  | ||||||
| +	clear_bit(vid, adapter->active_vlans); |  | ||||||
| + |  | ||||||
| +	if (!iegbe_vlan_used(adapter)) |  | ||||||
| +		iegbe_vlan_mode(netdev, false); |  | ||||||
| + |  | ||||||
| +	return 0; |  | ||||||
|  } |  | ||||||
|   |  | ||||||
|  static void iegbe_restore_vlan(struct iegbe_adapter *adapter) |  | ||||||
|  { |  | ||||||
| -	iegbe_vlan_rx_register(adapter->netdev, adapter->vlgrp); |  | ||||||
| - |  | ||||||
| -	if (adapter->vlgrp) { |  | ||||||
|  		u16 vid; |  | ||||||
| -		for (vid = 0x0; vid < VLAN_GROUP_ARRAY_LEN; vid++) { |  | ||||||
| -			if (!vlan_group_get_device(adapter->vlgrp, vid)) |  | ||||||
| -				continue; |  | ||||||
| + |  | ||||||
| +	if (!iegbe_vlan_used(adapter)) |  | ||||||
| +		return; |  | ||||||
| + |  | ||||||
| +	iegbe_vlan_mode(adapter->netdev, true); |  | ||||||
| +	for_each_set_bit(vid, adapter->active_vlans, VLAN_N_VID) |  | ||||||
|  			iegbe_vlan_rx_add_vid(adapter->netdev, vid); |  | ||||||
|  		} |  | ||||||
| -	} |  | ||||||
| -} |  | ||||||
|   |  | ||||||
|   |  | ||||||
|  int iegbe_set_spd_dplx(struct iegbe_adapter *adapter, u16 spddplx) |  | ||||||
| @@ -4864,10 +4888,11 @@ iegbe_resume(struct pci_dev *pdev) |  | ||||||
|      default: |  | ||||||
|          break; |  | ||||||
|      } |  | ||||||
| -#endif |  | ||||||
|   |  | ||||||
|      return 0x0; |  | ||||||
|  } |  | ||||||
| +#endif |  | ||||||
| + |  | ||||||
|   |  | ||||||
|  #ifdef CONFIG_NET_POLL_CONTROLLER |  | ||||||
|  /* |  | ||||||
| --- a/Embedded/src/GbE/iegbe_ethtool.c |  | ||||||
| +++ b/Embedded/src/GbE/iegbe_ethtool.c |  | ||||||
| @@ -327,6 +327,7 @@ iegbe_set_pauseparam(struct net_device * |  | ||||||
|      return 0; |  | ||||||
|  } |  | ||||||
|   |  | ||||||
| +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) |  | ||||||
|  static uint32_t |  | ||||||
|  iegbe_get_rx_csum(struct net_device *netdev) |  | ||||||
|  { |  | ||||||
| @@ -392,6 +393,7 @@ iegbe_set_tso(struct net_device *netdev, |  | ||||||
|      return 0; |  | ||||||
|  }  |  | ||||||
|  #endif /* NETIF_F_TSO */ |  | ||||||
| +#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) */ |  | ||||||
|   |  | ||||||
|  static uint32_t |  | ||||||
|  iegbe_get_msglevel(struct net_device *netdev) |  | ||||||
| @@ -807,6 +809,7 @@ err_setup_rx: |  | ||||||
|              E1000_82542_##R : E1000_##R;                           \ |  | ||||||
|          return 1;         }  } |  | ||||||
|   |  | ||||||
| +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) |  | ||||||
|  static int |  | ||||||
|  iegbe_reg_test(struct iegbe_adapter *adapter, uint64_t *data) |  | ||||||
|  { |  | ||||||
| @@ -1710,6 +1713,7 @@ iegbe_diag_test(struct net_device *netde |  | ||||||
|      } |  | ||||||
|      msleep_interruptible(0xfa0); |  | ||||||
|  } |  | ||||||
| +#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) */ |  | ||||||
|   |  | ||||||
|  static void |  | ||||||
|  iegbe_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) |  | ||||||
| @@ -1812,6 +1816,7 @@ iegbe_set_wol(struct net_device *netdev, |  | ||||||
|  /* bit defines for adapter->led_status */ |  | ||||||
|  #define E1000_LED_ON        0 |  | ||||||
|   |  | ||||||
| +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) |  | ||||||
|  static void |  | ||||||
|  iegbe_led_blink_callback(unsigned long data) |  | ||||||
|  { |  | ||||||
| @@ -1864,6 +1869,7 @@ iegbe_phys_id(struct net_device *netdev, |  | ||||||
|   |  | ||||||
|      return 0; |  | ||||||
|  } |  | ||||||
| +#endif |  | ||||||
|   |  | ||||||
|  static int |  | ||||||
|  iegbe_nway_reset(struct net_device *netdev) |  | ||||||
| @@ -1876,11 +1882,13 @@ iegbe_nway_reset(struct net_device *netd |  | ||||||
|      return 0; |  | ||||||
|  } |  | ||||||
|   |  | ||||||
| +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) |  | ||||||
|  static int  |  | ||||||
|  iegbe_get_stats_count(struct net_device *netdev) |  | ||||||
|  { |  | ||||||
|      return E1000_STATS_LEN; |  | ||||||
|  } |  | ||||||
| +#endif |  | ||||||
|   |  | ||||||
|  static void  |  | ||||||
|  iegbe_get_ethtool_stats(struct net_device *netdev,  |  | ||||||
| @@ -1936,6 +1944,8 @@ struct ethtool_ops iegbe_ethtool_ops = { |  | ||||||
|      .set_ringparam          = iegbe_set_ringparam, |  | ||||||
|      .get_pauseparam        = iegbe_get_pauseparam, |  | ||||||
|      .set_pauseparam        = iegbe_set_pauseparam, |  | ||||||
| + |  | ||||||
| +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) |  | ||||||
|      .get_rx_csum        = iegbe_get_rx_csum, |  | ||||||
|      .set_rx_csum        = iegbe_set_rx_csum, |  | ||||||
|      .get_tx_csum            = iegbe_get_tx_csum, |  | ||||||
| @@ -1946,11 +1956,13 @@ struct ethtool_ops iegbe_ethtool_ops = { |  | ||||||
|      .get_tso        = ethtool_op_get_tso, |  | ||||||
|      .set_tso        = iegbe_set_tso, |  | ||||||
|  #endif |  | ||||||
| + |  | ||||||
|      .self_test_count        = iegbe_diag_test_count, |  | ||||||
|      .self_test              = iegbe_diag_test, |  | ||||||
| -    .get_strings            = iegbe_get_strings, |  | ||||||
|      .phys_id                = iegbe_phys_id, |  | ||||||
|      .get_stats_count        = iegbe_get_stats_count, |  | ||||||
| +#endif |  | ||||||
| +    .get_strings            = iegbe_get_strings, |  | ||||||
|      .get_ethtool_stats      = iegbe_get_ethtool_stats, |  | ||||||
|  }; |  | ||||||
|   |  | ||||||
| --- a/Embedded/src/GbE/gcu_main.c |  | ||||||
| +++ b/Embedded/src/GbE/gcu_main.c |  | ||||||
| @@ -93,7 +93,7 @@ static struct pci_driver gcu_driver = { |  | ||||||
|  }; |  | ||||||
|   |  | ||||||
|  static struct gcu_adapter *global_adapter = 0; |  | ||||||
| -static spinlock_t global_adapter_spinlock = SPIN_LOCK_UNLOCKED; |  | ||||||
| +static DEFINE_SPINLOCK(global_adapter_spinlock); |  | ||||||
|  static unsigned long g_intflags = 0; |  | ||||||
|   |  | ||||||
|  MODULE_AUTHOR("Intel(R) Corporation"); |  | ||||||
| --- a/Embedded/src/GbE/iegbe.h |  | ||||||
| +++ b/Embedded/src/GbE/iegbe.h |  | ||||||
| @@ -257,7 +257,7 @@ struct iegbe_adapter { |  | ||||||
|  	struct timer_list tx_fifo_stall_timer; |  | ||||||
|  	struct timer_list watchdog_timer; |  | ||||||
|  	struct timer_list phy_info_timer; |  | ||||||
| -	struct vlan_group *vlgrp; |  | ||||||
| +	unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)]; |  | ||||||
|      	uint16_t mng_vlan_id; |  | ||||||
|  	uint32_t bd_number; |  | ||||||
|  	uint32_t rx_buffer_len; |  | ||||||
| @@ -1,41 +0,0 @@ | |||||||
| --- a/Embedded/src/CAN/can_main.c |  | ||||||
| +++ b/Embedded/src/CAN/can_main.c |  | ||||||
| @@ -72,6 +72,7 @@ |  | ||||||
|  #include "can_main.h" |  | ||||||
|  #include "can_ioctl.h" |  | ||||||
|  #include <linux/fs.h> |  | ||||||
| +#include <linux/module.h> |  | ||||||
|   |  | ||||||
|   |  | ||||||
|  MODULE_AUTHOR("Intel(R) Corporation"); |  | ||||||
| @@ -110,7 +111,7 @@ struct file_operations file_ops = { |  | ||||||
|      .owner        = THIS_MODULE, |  | ||||||
|      .read        = can_read, |  | ||||||
|      .write        = can_write, |  | ||||||
| -    .ioctl        = can_dev_io, |  | ||||||
| +    .unlocked_ioctl = can_dev_io, |  | ||||||
|      .open        = can_open, |  | ||||||
|      .release     = can_release |  | ||||||
|  }; |  | ||||||
| @@ -594,8 +595,7 @@ int icp_can_reset(can_os_t *can_os) |  | ||||||
|  /***************************************************************************** |  | ||||||
|   * Device IO control function. Used by user apps to configure CAN device. |  | ||||||
|   *****************************************************************************/ |  | ||||||
| -int can_dev_io(struct inode *inode, struct file *filp, unsigned int cmd, |  | ||||||
| -      unsigned long arg) |  | ||||||
| +long can_dev_io(struct file *filp, unsigned int cmd, unsigned long arg) |  | ||||||
|  { |  | ||||||
|      can_os_t *can_os; |  | ||||||
|      unsigned int err=0; |  | ||||||
| --- a/Embedded/src/CAN/can_main.h |  | ||||||
| +++ b/Embedded/src/CAN/can_main.h |  | ||||||
| @@ -157,8 +157,7 @@ ssize_t can_write( |  | ||||||
|  int icp_can_reset( |  | ||||||
|      can_os_t *can_os); |  | ||||||
|       |  | ||||||
| -int can_dev_io( |  | ||||||
| -    struct inode *inode,  |  | ||||||
| +long can_dev_io( |  | ||||||
|      struct file *filp,  |  | ||||||
|      unsigned int cmd,  |  | ||||||
|      unsigned long arg); |  | ||||||
| @@ -1,33 +0,0 @@ | |||||||
| --- a/Embedded/src/GPIO/gpio.h |  | ||||||
| +++ b/Embedded/src/GPIO/gpio.h |  | ||||||
| @@ -121,8 +121,7 @@ int gpio_init(void); |  | ||||||
|  void gpio_close(void); |  | ||||||
|  int gpio_open(struct inode *inode, struct file *filp); |  | ||||||
|  int gpio_release(struct inode *inode, struct file *filp); |  | ||||||
| -int gpio_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,  |  | ||||||
| -			   unsigned long arg); |  | ||||||
| +long gpio_ioctl(struct file *filp, unsigned int cmd, unsigned long arg); |  | ||||||
|   |  | ||||||
|  // private driver functions |  | ||||||
|  int gpio_getpininfo(int Signal, char *pBuff); |  | ||||||
| @@ -134,7 +133,7 @@ struct file_operations file_ops = |  | ||||||
|  	.owner	=	THIS_MODULE, |  | ||||||
|  	.open   =    gpio_open, |  | ||||||
|  	.release =   gpio_release,	 |  | ||||||
| -	.ioctl	=	gpio_ioctl, |  | ||||||
| +	.unlocked_ioctl	= gpio_ioctl, |  | ||||||
|  }; |  | ||||||
|   |  | ||||||
|  #endif |  | ||||||
| --- a/Embedded/src/GPIO/gpio_ref.c |  | ||||||
| +++ b/Embedded/src/GPIO/gpio_ref.c |  | ||||||
| @@ -251,8 +251,7 @@ int gpio_release(struct inode *inode, st |  | ||||||
|        0 => success |  | ||||||
|      < 0 => error |  | ||||||
|  ******************************************************************************/ |  | ||||||
| -int gpio_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, |  | ||||||
| -                unsigned long arg) |  | ||||||
| +long gpio_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |  | ||||||
|  { |  | ||||||
|      gpio_ioctl_t Info; |  | ||||||
|      u_int bitstr = 0; |  | ||||||
| @@ -1,31 +0,0 @@ | |||||||
| --- a/Embedded/src/WDT/iwdt.c |  | ||||||
| +++ b/Embedded/src/WDT/iwdt.c |  | ||||||
| @@ -217,8 +217,7 @@ static int wdt_open(struct inode *inode, |  | ||||||
|  static int wdt_release(struct inode *inode, struct file *file); |  | ||||||
|  static ssize_t wdt_write(struct file *file, const char *data, |  | ||||||
|                       size_t count, loff_t * pos); |  | ||||||
| -static int wdt_ioctl(struct inode *inode, struct file *file, |  | ||||||
| -                    unsigned int cmd, unsigned long arg); |  | ||||||
| +static long wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg); |  | ||||||
|  static irqreturn_t wdt_isr(int irq, void *dev_id); |  | ||||||
|  static void __exit wdt_cleanup(void); |  | ||||||
|  static int __init wdt_init(void); |  | ||||||
| @@ -243,7 +242,7 @@ static struct pci_device_id lpc_pci_tbl[ |  | ||||||
|  static struct file_operations wdt_fops = { |  | ||||||
|       owner:        THIS_MODULE, |  | ||||||
|       write:        wdt_write, |  | ||||||
| -     ioctl:        wdt_ioctl, |  | ||||||
| +     unlocked_ioctl: wdt_ioctl, |  | ||||||
|       open:         wdt_open, |  | ||||||
|       release:      wdt_release, |  | ||||||
|  }; |  | ||||||
| @@ -1201,8 +1200,7 @@ char *wdt_get_ioctl_string(unsigned int |  | ||||||
|   * Return Value:    0 - successful, negative value - failed. |  | ||||||
|   * Description:     This function is used to provide IO interface. |  | ||||||
|   */ |  | ||||||
| -static int wdt_ioctl(struct inode *inode, struct file *file, |  | ||||||
| -                    unsigned int cmd, unsigned long arg) |  | ||||||
| +static long wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |  | ||||||
|  { |  | ||||||
|       u8  mode=0, scale=0, int_type=0; |  | ||||||
|       u32 u_margin=0, dcount=0; |  | ||||||
| @@ -1,33 +0,0 @@ | |||||||
| --- a/Embedded/src/1588/1588.c |  | ||||||
| +++ b/Embedded/src/1588/1588.c |  | ||||||
| @@ -664,8 +664,7 @@ irqreturn_t timesync_isr(int irq, void * |  | ||||||
|        0 => success |  | ||||||
|      < 0 => error |  | ||||||
|  ******************************************************************************/ |  | ||||||
| -int timesync_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, |  | ||||||
| -                unsigned long arg) |  | ||||||
| +long timesync_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |  | ||||||
|  { |  | ||||||
|      wait_queue_head_t *event = NULL; |  | ||||||
|      unsigned int bytes_ret = 0; |  | ||||||
| --- a/Embedded/src/1588/1588.h |  | ||||||
| +++ b/Embedded/src/1588/1588.h |  | ||||||
| @@ -121,8 +121,7 @@ MODULE_DEVICE_TABLE(pci, pci_ids); |  | ||||||
|  // Linux functions |  | ||||||
|  int timesync_open(struct inode *inode, struct file *filp); |  | ||||||
|  int timesync_release(struct inode *inode, struct file *filp); |  | ||||||
| -int timesync_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, |  | ||||||
| -				unsigned long arg); |  | ||||||
| +long timesync_ioctl(struct file *filp, unsigned int cmd, unsigned long arg); |  | ||||||
|  void timesync_close(void); |  | ||||||
|  int pci_suspend(struct pci_dev *dev, pm_message_t state); |  | ||||||
|  int pci_resume(struct pci_dev *dev); |  | ||||||
| @@ -142,7 +141,7 @@ struct file_operations file_ops = |  | ||||||
|  	.owner		= THIS_MODULE, |  | ||||||
|  	.open     = timesync_open, |  | ||||||
|  	.release    = timesync_release,	 |  | ||||||
| -	.ioctl		= timesync_ioctl, |  | ||||||
| +	.unlocked_ioctl = timesync_ioctl, |  | ||||||
|  }; |  | ||||||
|   |  | ||||||
|  // Linux pci operations |  | ||||||
							
								
								
									
										52
									
								
								package/kernel/gpio-nct5104d/Makefile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										52
									
								
								package/kernel/gpio-nct5104d/Makefile
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,52 @@ | |||||||
|  | # | ||||||
|  | # Copyright (C) 2017 OpenWrt.org | ||||||
|  | # | ||||||
|  | # This is free software, licensed under the GNU General Public License v2. | ||||||
|  | # See /LICENSE for more information. | ||||||
|  | # | ||||||
|  |  | ||||||
|  | include $(TOPDIR)/rules.mk | ||||||
|  | include $(INCLUDE_DIR)/kernel.mk | ||||||
|  |  | ||||||
|  | PKG_NAME:=gpio-nct5104d | ||||||
|  | PKG_RELEASE:=1 | ||||||
|  |  | ||||||
|  | PKG_MAINTAINER:=Florian Eckert <Eckert.Florian@googlemail.com> | ||||||
|  | PKG_LICENSE:=GPL-2.0 | ||||||
|  |  | ||||||
|  | include $(INCLUDE_DIR)/package.mk | ||||||
|  |  | ||||||
|  | define KernelPackage/gpio-nct5104d | ||||||
|  |   SUBMENU:=Other modules | ||||||
|  |   TITLE:= GPIO nct5104d support | ||||||
|  |   DEPENDS:= @GPIO_SUPPORT @TARGET_x86 | ||||||
|  |   FILES:=$(PKG_BUILD_DIR)/gpio-nct5104d.ko | ||||||
|  |   AUTOLOAD:=$(call AutoLoad,30,gpio-nct5104d,1) | ||||||
|  |   KCONFIG:= | ||||||
|  | endef | ||||||
|  |  | ||||||
|  | define KernelPackage/gpio-nct5104d/description | ||||||
|  |   Support for GPIO functionality of NCT5104D super I/O chip. | ||||||
|  | endef | ||||||
|  |  | ||||||
|  | EXTRA_KCONFIG:= \ | ||||||
|  | 	CONFIG_GPIO_NCT5104D=m | ||||||
|  |  | ||||||
|  | EXTRA_CFLAGS:= \ | ||||||
|  | 	$(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=m,%,$(filter %=m,$(EXTRA_KCONFIG)))) \ | ||||||
|  | 	$(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG)))) \ | ||||||
|  |  | ||||||
|  | MAKE_OPTS:= \ | ||||||
|  | 	ARCH="$(LINUX_KARCH)" \ | ||||||
|  | 	CROSS_COMPILE="$(TARGET_CROSS)" \ | ||||||
|  | 	SUBDIRS="$(PKG_BUILD_DIR)" \ | ||||||
|  | 	EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ | ||||||
|  | 	$(EXTRA_KCONFIG) | ||||||
|  |  | ||||||
|  | define Build/Compile | ||||||
|  | 	 $(MAKE) -C "$(LINUX_DIR)" \ | ||||||
|  | 		$(MAKE_OPTS) \ | ||||||
|  | 		modules | ||||||
|  | endef | ||||||
|  |  | ||||||
|  | $(eval $(call KernelPackage,gpio-nct5104d)) | ||||||
							
								
								
									
										5
									
								
								package/kernel/gpio-nct5104d/src/Kconfig
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								package/kernel/gpio-nct5104d/src/Kconfig
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | |||||||
|  | config GPIO_NCT5104D | ||||||
|  |         tristate "NCT5104D GPIO support" | ||||||
|  |         depends on GENERIC_GPIO | ||||||
|  |         help | ||||||
|  |           Say yes here to support GPIO functionality of NCT5104D super I/O chip | ||||||
							
								
								
									
										1
									
								
								package/kernel/gpio-nct5104d/src/Makefile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								package/kernel/gpio-nct5104d/src/Makefile
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1 @@ | |||||||
|  | obj-${CONFIG_GPIO_NCT5104D}    += gpio-nct5104d.o | ||||||
							
								
								
									
										461
									
								
								package/kernel/gpio-nct5104d/src/gpio-nct5104d.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										461
									
								
								package/kernel/gpio-nct5104d/src/gpio-nct5104d.c
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,461 @@ | |||||||
|  | /* | ||||||
|  |  * GPIO driver for NCT5104D | ||||||
|  |  * | ||||||
|  |  * Author: Tasanakorn Phaipool <tasanakorn@gmail.com> | ||||||
|  |  * | ||||||
|  |  * This program is free software; you can redistribute it and/or modify | ||||||
|  |  * it under the terms of the GNU General Public License as published by | ||||||
|  |  * the Free Software Foundation; either version 2 of the License, or | ||||||
|  |  * (at your option) any later version. | ||||||
|  |  */ | ||||||
|  |  | ||||||
|  | #include <linux/module.h> | ||||||
|  | #include <linux/init.h> | ||||||
|  | #include <linux/platform_device.h> | ||||||
|  | #include <linux/io.h> | ||||||
|  | #include <linux/gpio.h> | ||||||
|  | #include <linux/version.h> | ||||||
|  | #include <linux/dmi.h> | ||||||
|  | #include <linux/string.h> | ||||||
|  |  | ||||||
|  | #define DRVNAME "gpio-nct5104d" | ||||||
|  |  | ||||||
|  | /* | ||||||
|  |  * Super-I/O registers | ||||||
|  |  */ | ||||||
|  | #define SIO_LDSEL		0x07	/* Logical device select */ | ||||||
|  | #define SIO_CHIPID		0x20	/* Chaip ID (2 bytes) */ | ||||||
|  | #define SIO_GPIO_ENABLE	0x30	/* GPIO enable */ | ||||||
|  | #define SIO_GPIO1_MODE		0xE0	/* GPIO1 Mode OpenDrain/Push-Pull */ | ||||||
|  | #define SIO_GPIO2_MODE		0xE1	/* GPIO2 Mode OpenDrain/Push-Pull */ | ||||||
|  |  | ||||||
|  | #define SIO_LD_GPIO		0x07	/* GPIO logical device */ | ||||||
|  | #define SIO_LD_GPIO_MODE	0x0F	/* GPIO mode control device */ | ||||||
|  | #define SIO_UNLOCK_KEY		0x87	/* Key to enable Super-I/O */ | ||||||
|  | #define SIO_LOCK_KEY		0xAA	/* Key to disable Super-I/O */ | ||||||
|  |  | ||||||
|  | #define SIO_NCT5104D_ID					0x1061	/* Chip ID */ | ||||||
|  | #define SIO_PCENGINES_APU_NCT5104D_ID	0xc452	/* Chip ID */ | ||||||
|  |  | ||||||
|  | enum chips { nct5104d }; | ||||||
|  |  | ||||||
|  | static const char * const nct5104d_names[] = { | ||||||
|  | 	"nct5104d" | ||||||
|  | }; | ||||||
|  |  | ||||||
|  | struct nct5104d_sio { | ||||||
|  | 	int addr; | ||||||
|  | 	enum chips type; | ||||||
|  | }; | ||||||
|  |  | ||||||
|  | struct nct5104d_gpio_bank { | ||||||
|  | 	struct gpio_chip chip; | ||||||
|  | 	unsigned int regbase; | ||||||
|  | 	struct nct5104d_gpio_data *data; | ||||||
|  | }; | ||||||
|  |  | ||||||
|  | struct nct5104d_gpio_data { | ||||||
|  | 	struct nct5104d_sio *sio; | ||||||
|  | 	int nr_bank; | ||||||
|  | 	struct nct5104d_gpio_bank *bank; | ||||||
|  | }; | ||||||
|  |  | ||||||
|  | /* | ||||||
|  |  * Super-I/O functions. | ||||||
|  |  */ | ||||||
|  |  | ||||||
|  | static inline int superio_inb(int base, int reg) | ||||||
|  | { | ||||||
|  | 	outb(reg, base); | ||||||
|  | 	return inb(base + 1); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | static int superio_inw(int base, int reg) | ||||||
|  | { | ||||||
|  | 	int val; | ||||||
|  |  | ||||||
|  | 	outb(reg++, base); | ||||||
|  | 	val = inb(base + 1) << 8; | ||||||
|  | 	outb(reg, base); | ||||||
|  | 	val |= inb(base + 1); | ||||||
|  |  | ||||||
|  | 	return val; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | static inline void superio_outb(int base, int reg, int val) | ||||||
|  | { | ||||||
|  | 	outb(reg, base); | ||||||
|  | 	outb(val, base + 1); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | static inline int superio_enter(int base) | ||||||
|  | { | ||||||
|  | 	/* Don't step on other drivers' I/O space by accident. */ | ||||||
|  | 	if (!request_muxed_region(base, 2, DRVNAME)) { | ||||||
|  | 		pr_err(DRVNAME "I/O address 0x%04x already in use\n", base); | ||||||
|  | 		return -EBUSY; | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	/* According to the datasheet the key must be send twice. */ | ||||||
|  | 	outb(SIO_UNLOCK_KEY, base); | ||||||
|  | 	outb(SIO_UNLOCK_KEY, base); | ||||||
|  |  | ||||||
|  | 	return 0; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | static inline void superio_select(int base, int ld) | ||||||
|  | { | ||||||
|  | 	outb(SIO_LDSEL, base); | ||||||
|  | 	outb(ld, base + 1); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | static inline void superio_exit(int base) | ||||||
|  | { | ||||||
|  | 	outb(SIO_LOCK_KEY, base); | ||||||
|  | 	release_region(base, 2); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | /* | ||||||
|  |  * GPIO chip. | ||||||
|  |  */ | ||||||
|  |  | ||||||
|  | static int nct5104d_gpio_direction_in(struct gpio_chip *chip, unsigned offset); | ||||||
|  | static int nct5104d_gpio_get(struct gpio_chip *chip, unsigned offset); | ||||||
|  | static int nct5104d_gpio_direction_out(struct gpio_chip *chip, | ||||||
|  | 				     unsigned offset, int value); | ||||||
|  | static void nct5104d_gpio_set(struct gpio_chip *chip, unsigned offset, int value); | ||||||
|  |  | ||||||
|  | #define NCT5104D_GPIO_BANK(_base, _ngpio, _regbase)			\ | ||||||
|  | 	{								\ | ||||||
|  | 		.chip = {						\ | ||||||
|  | 			.label            = DRVNAME,			\ | ||||||
|  | 			.owner            = THIS_MODULE,		\ | ||||||
|  | 			.direction_input  = nct5104d_gpio_direction_in,	\ | ||||||
|  | 			.get              = nct5104d_gpio_get,		\ | ||||||
|  | 			.direction_output = nct5104d_gpio_direction_out,	\ | ||||||
|  | 			.set              = nct5104d_gpio_set,		\ | ||||||
|  | 			.base             = _base,			\ | ||||||
|  | 			.ngpio            = _ngpio,			\ | ||||||
|  | 			.can_sleep        = true,			\ | ||||||
|  | 		},							\ | ||||||
|  | 		.regbase = _regbase,					\ | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | #define gpio_dir(base) (base + 0) | ||||||
|  | #define gpio_data(base) (base + 1) | ||||||
|  |  | ||||||
|  | static struct nct5104d_gpio_bank nct5104d_gpio_bank[] = { | ||||||
|  | 	NCT5104D_GPIO_BANK(0 , 8, 0xE0), | ||||||
|  | 	NCT5104D_GPIO_BANK(10, 8, 0xE4) | ||||||
|  | }; | ||||||
|  |  | ||||||
|  | static int nct5104d_gpio_direction_in(struct gpio_chip *chip, unsigned offset) | ||||||
|  | { | ||||||
|  | 	int err; | ||||||
|  | 	struct nct5104d_gpio_bank *bank = | ||||||
|  | 		container_of(chip, struct nct5104d_gpio_bank, chip); | ||||||
|  | 	struct nct5104d_sio *sio = bank->data->sio; | ||||||
|  | 	u8 dir; | ||||||
|  |  | ||||||
|  | 	err = superio_enter(sio->addr); | ||||||
|  | 	if (err) | ||||||
|  | 		return err; | ||||||
|  | 	superio_select(sio->addr, SIO_LD_GPIO); | ||||||
|  |  | ||||||
|  | 	dir = superio_inb(sio->addr, gpio_dir(bank->regbase)); | ||||||
|  | 	dir |= (1 << offset); | ||||||
|  | 	superio_outb(sio->addr, gpio_dir(bank->regbase), dir); | ||||||
|  |  | ||||||
|  | 	superio_exit(sio->addr); | ||||||
|  |  | ||||||
|  | 	return 0; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | static int nct5104d_gpio_get(struct gpio_chip *chip, unsigned offset) | ||||||
|  | { | ||||||
|  | 	int err; | ||||||
|  | 	struct nct5104d_gpio_bank *bank = | ||||||
|  | 		container_of(chip, struct nct5104d_gpio_bank, chip); | ||||||
|  | 	struct nct5104d_sio *sio = bank->data->sio; | ||||||
|  | 	u8 data; | ||||||
|  |  | ||||||
|  | 	err = superio_enter(sio->addr); | ||||||
|  | 	if (err) | ||||||
|  | 		return err; | ||||||
|  | 	superio_select(sio->addr, SIO_LD_GPIO); | ||||||
|  |  | ||||||
|  | 	data = superio_inb(sio->addr, gpio_data(bank->regbase)); | ||||||
|  |  | ||||||
|  | 	superio_exit(sio->addr); | ||||||
|  |  | ||||||
|  | 	return !!(data & 1 << offset); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | static int nct5104d_gpio_direction_out(struct gpio_chip *chip, | ||||||
|  | 				     unsigned offset, int value) | ||||||
|  | { | ||||||
|  | 	int err; | ||||||
|  | 	struct nct5104d_gpio_bank *bank = | ||||||
|  | 		container_of(chip, struct nct5104d_gpio_bank, chip); | ||||||
|  | 	struct nct5104d_sio *sio = bank->data->sio; | ||||||
|  | 	u8 dir, data_out; | ||||||
|  |  | ||||||
|  | 	err = superio_enter(sio->addr); | ||||||
|  | 	if (err) | ||||||
|  | 		return err; | ||||||
|  | 	superio_select(sio->addr, SIO_LD_GPIO); | ||||||
|  |  | ||||||
|  | 	data_out = superio_inb(sio->addr, gpio_data(bank->regbase)); | ||||||
|  | 	if (value) | ||||||
|  | 		data_out |= (1 << offset); | ||||||
|  | 	else | ||||||
|  | 		data_out &= ~(1 << offset); | ||||||
|  | 	superio_outb(sio->addr, gpio_data(bank->regbase), data_out); | ||||||
|  |  | ||||||
|  | 	dir = superio_inb(sio->addr, gpio_dir(bank->regbase)); | ||||||
|  | 	dir &= ~(1 << offset); | ||||||
|  | 	superio_outb(sio->addr, gpio_dir(bank->regbase), dir); | ||||||
|  |  | ||||||
|  | 	superio_exit(sio->addr); | ||||||
|  |  | ||||||
|  | 	return 0; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | static void nct5104d_gpio_set(struct gpio_chip *chip, unsigned offset, int value) | ||||||
|  | { | ||||||
|  | 	int err; | ||||||
|  | 	struct nct5104d_gpio_bank *bank = | ||||||
|  | 		container_of(chip, struct nct5104d_gpio_bank, chip); | ||||||
|  | 	struct nct5104d_sio *sio = bank->data->sio; | ||||||
|  | 	u8 data_out; | ||||||
|  |  | ||||||
|  | 	err = superio_enter(sio->addr); | ||||||
|  | 	if (err) | ||||||
|  | 		return; | ||||||
|  | 	superio_select(sio->addr, SIO_LD_GPIO); | ||||||
|  |  | ||||||
|  | 	data_out = superio_inb(sio->addr, gpio_data(bank->regbase)); | ||||||
|  | 	if (value) | ||||||
|  | 		data_out |= (1 << offset); | ||||||
|  | 	else | ||||||
|  | 		data_out &= ~(1 << offset); | ||||||
|  | 	superio_outb(sio->addr, gpio_data(bank->regbase), data_out); | ||||||
|  |  | ||||||
|  | 	superio_exit(sio->addr); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | /* | ||||||
|  |  * Platform device and driver. | ||||||
|  |  */ | ||||||
|  |  | ||||||
|  | static int nct5104d_gpio_probe(struct platform_device *pdev) | ||||||
|  | { | ||||||
|  | 	int err; | ||||||
|  | 	int i; | ||||||
|  | 	struct nct5104d_sio *sio = pdev->dev.platform_data; | ||||||
|  | 	struct nct5104d_gpio_data *data; | ||||||
|  |  | ||||||
|  | 	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); | ||||||
|  | 	if (!data) | ||||||
|  | 		return -ENOMEM; | ||||||
|  |  | ||||||
|  | 	switch (sio->type) { | ||||||
|  | 	case nct5104d: | ||||||
|  | 		data->nr_bank = ARRAY_SIZE(nct5104d_gpio_bank); | ||||||
|  | 		data->bank = nct5104d_gpio_bank; | ||||||
|  | 		break; | ||||||
|  | 	default: | ||||||
|  | 		return -ENODEV; | ||||||
|  | 	} | ||||||
|  | 	data->sio = sio; | ||||||
|  |  | ||||||
|  | 	platform_set_drvdata(pdev, data); | ||||||
|  |  | ||||||
|  | 	/* For each GPIO bank, register a GPIO chip. */ | ||||||
|  | 	for (i = 0; i < data->nr_bank; i++) { | ||||||
|  | 		struct nct5104d_gpio_bank *bank = &data->bank[i]; | ||||||
|  |  | ||||||
|  | 		bank->chip.dev = &pdev->dev; | ||||||
|  | 		bank->data = data; | ||||||
|  |  | ||||||
|  | 		err = gpiochip_add(&bank->chip); | ||||||
|  | 		if (err) { | ||||||
|  | 			dev_err(&pdev->dev, | ||||||
|  | 				"Failed to register gpiochip %d: %d\n", | ||||||
|  | 				i, err); | ||||||
|  | 			goto err_gpiochip; | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	return 0; | ||||||
|  |  | ||||||
|  | err_gpiochip: | ||||||
|  | 	for (i = i - 1; i >= 0; i--) { | ||||||
|  | 		struct nct5104d_gpio_bank *bank = &data->bank[i]; | ||||||
|  |  | ||||||
|  | #if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) | ||||||
|  | 		int rm_err = gpiochip_remove(&bank->chip); | ||||||
|  | 		if (rm_err < 0) | ||||||
|  | 			dev_err(&pdev->dev, | ||||||
|  | 				"Failed to remove gpiochip %d: %d\n", | ||||||
|  | 				i, rm_err); | ||||||
|  | #else /* LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) */ | ||||||
|  | 		gpiochip_remove (&bank->chip); | ||||||
|  | #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) */ | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	return err; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | static int nct5104d_gpio_remove(struct platform_device *pdev) | ||||||
|  | { | ||||||
|  | 	int i; | ||||||
|  | 	struct nct5104d_gpio_data *data = platform_get_drvdata(pdev); | ||||||
|  |  | ||||||
|  | 	for (i = 0; i < data->nr_bank; i++) { | ||||||
|  | 		struct nct5104d_gpio_bank *bank = &data->bank[i]; | ||||||
|  |  | ||||||
|  | #if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) | ||||||
|  | 		int err = gpiochip_remove(&bank->chip); | ||||||
|  | 		if (err) { | ||||||
|  | 			dev_err(&pdev->dev, | ||||||
|  | 				"Failed to remove GPIO gpiochip %d: %d\n", | ||||||
|  | 				i, err); | ||||||
|  | 			return err; | ||||||
|  | 		} | ||||||
|  | #else /* LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) */ | ||||||
|  | 		gpiochip_remove (&bank->chip); | ||||||
|  | #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) */ | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	return 0; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | static int __init nct5104d_find(int addr, struct nct5104d_sio *sio) | ||||||
|  | { | ||||||
|  | 	int err; | ||||||
|  | 	u16 devid; | ||||||
|  | 	u8 gpio_cfg; | ||||||
|  |  | ||||||
|  | 	err = superio_enter(addr); | ||||||
|  | 	if (err) | ||||||
|  | 		return err; | ||||||
|  |  | ||||||
|  | 	err = -ENODEV; | ||||||
|  |  | ||||||
|  | 	devid = superio_inw(addr, SIO_CHIPID); | ||||||
|  | 	switch (devid) { | ||||||
|  | 	case SIO_NCT5104D_ID: | ||||||
|  | 	case SIO_PCENGINES_APU_NCT5104D_ID: | ||||||
|  | 		sio->type = nct5104d; | ||||||
|  | 		/* enable GPIO0 and GPIO1 */ | ||||||
|  | 		superio_select(addr, SIO_LD_GPIO); | ||||||
|  | 		gpio_cfg = superio_inb(addr, SIO_GPIO_ENABLE); | ||||||
|  | 		gpio_cfg |= 0x03; | ||||||
|  | 		superio_outb(addr, SIO_GPIO_ENABLE, gpio_cfg); | ||||||
|  | 		break; | ||||||
|  | 	default: | ||||||
|  | 		pr_info(DRVNAME ": Unsupported device 0x%04x\n", devid); | ||||||
|  | 		goto err; | ||||||
|  | 	} | ||||||
|  | 	sio->addr = addr; | ||||||
|  | 	err = 0; | ||||||
|  |  | ||||||
|  | 	pr_info(DRVNAME ": Found %s at %#x chip id 0x%04x\n", | ||||||
|  | 		nct5104d_names[sio->type], | ||||||
|  | 		(unsigned int) addr, | ||||||
|  | 		(int) superio_inw(addr, SIO_CHIPID)); | ||||||
|  |  | ||||||
|  |         superio_select(sio->addr, SIO_LD_GPIO_MODE); | ||||||
|  |         superio_outb(sio->addr, SIO_GPIO1_MODE, 0x0); | ||||||
|  |         superio_outb(sio->addr, SIO_GPIO2_MODE, 0x0); | ||||||
|  |  | ||||||
|  | err: | ||||||
|  | 	superio_exit(addr); | ||||||
|  | 	return err; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | static struct platform_device *nct5104d_gpio_pdev; | ||||||
|  |  | ||||||
|  | static int __init | ||||||
|  | nct5104d_gpio_device_add(const struct nct5104d_sio *sio) | ||||||
|  | { | ||||||
|  | 	int err; | ||||||
|  |  | ||||||
|  | 	nct5104d_gpio_pdev = platform_device_alloc(DRVNAME, -1); | ||||||
|  | 	if (!nct5104d_gpio_pdev) | ||||||
|  | 		pr_err(DRVNAME ": Error platform_device_alloc\n"); | ||||||
|  | 	if (!nct5104d_gpio_pdev) | ||||||
|  | 		return -ENOMEM; | ||||||
|  |  | ||||||
|  | 	err = platform_device_add_data(nct5104d_gpio_pdev, | ||||||
|  | 				       sio, sizeof(*sio)); | ||||||
|  | 	if (err) { | ||||||
|  | 		pr_err(DRVNAME "Platform data allocation failed\n"); | ||||||
|  | 		goto err; | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	err = platform_device_add(nct5104d_gpio_pdev); | ||||||
|  | 	if (err) { | ||||||
|  | 		pr_err(DRVNAME "Device addition failed\n"); | ||||||
|  | 		goto err; | ||||||
|  | 	} | ||||||
|  | 	pr_info(DRVNAME ": Device added\n"); | ||||||
|  | 	return 0; | ||||||
|  |  | ||||||
|  | err: | ||||||
|  | 	platform_device_put(nct5104d_gpio_pdev); | ||||||
|  |  | ||||||
|  | 	return err; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | /* | ||||||
|  |  */ | ||||||
|  |  | ||||||
|  | static struct platform_driver nct5104d_gpio_driver = { | ||||||
|  | 	.driver = { | ||||||
|  | 		.owner	= THIS_MODULE, | ||||||
|  | 		.name	= DRVNAME, | ||||||
|  | 	}, | ||||||
|  | 	.probe		= nct5104d_gpio_probe, | ||||||
|  | 	.remove		= nct5104d_gpio_remove, | ||||||
|  | }; | ||||||
|  |  | ||||||
|  | static int __init nct5104d_gpio_init(void) | ||||||
|  | { | ||||||
|  | 	int err; | ||||||
|  | 	struct nct5104d_sio sio; | ||||||
|  | 	const char *board_vendor = dmi_get_system_info(DMI_BOARD_VENDOR); | ||||||
|  | 	const char *board_name = dmi_get_system_info(DMI_BOARD_NAME); | ||||||
|  |  | ||||||
|  |  	/* Make sure we only run on PC Engine APU boards */ | ||||||
|  | 	if (!board_name || !board_vendor || strcasecmp(board_vendor, "PC Engines") || strncasecmp(board_name, "apu", 3)) { | ||||||
|  | 		return -ENODEV; | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	if (nct5104d_find(0x2e, &sio) && | ||||||
|  | 	    nct5104d_find(0x4e, &sio)) | ||||||
|  | 		return -ENODEV; | ||||||
|  |  | ||||||
|  | 	err = platform_driver_register(&nct5104d_gpio_driver); | ||||||
|  | 	if (!err) { | ||||||
|  | 		pr_info(DRVNAME ": platform_driver_register\n"); | ||||||
|  | 		err = nct5104d_gpio_device_add(&sio); | ||||||
|  | 		if (err) | ||||||
|  | 			platform_driver_unregister(&nct5104d_gpio_driver); | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	return err; | ||||||
|  | } | ||||||
|  | subsys_initcall(nct5104d_gpio_init); | ||||||
|  |  | ||||||
|  | static void __exit nct5104d_gpio_exit(void) | ||||||
|  | { | ||||||
|  | 	platform_device_unregister(nct5104d_gpio_pdev); | ||||||
|  | 	platform_driver_unregister(&nct5104d_gpio_driver); | ||||||
|  | } | ||||||
|  | module_exit(nct5104d_gpio_exit); | ||||||
|  |  | ||||||
|  | MODULE_DESCRIPTION("GPIO driver for Super-I/O chips NCT5104D"); | ||||||
|  | MODULE_AUTHOR("Tasanakorn Phaipool <tasanakorn@gmail.com>"); | ||||||
|  | MODULE_LICENSE("GPL"); | ||||||
| @@ -12,10 +12,10 @@ PKG_NAME:=sched-cake | |||||||
| PKG_RELEASE:=1 | PKG_RELEASE:=1 | ||||||
|  |  | ||||||
| PKG_SOURCE_PROTO:=git | PKG_SOURCE_PROTO:=git | ||||||
| PKG_SOURCE_URL:=https://github.com/kdarbyshirebryant/sch_cake.git | PKG_SOURCE_URL:=https://github.com/dtaht/sch_cake.git | ||||||
| PKG_SOURCE_DATE:=2016-12-19 | PKG_SOURCE_DATE:=2017-01-28 | ||||||
| PKG_SOURCE_VERSION:=70c8eb766d5afcf3cf187594b7cd776da92bee3c | PKG_SOURCE_VERSION:=9789742cfc596d48583ba4cdbc8f38d026121fa6 | ||||||
| PKG_MIRROR_HASH:=16174db5dad0a5b5ba522d4cfc058cff9851ed013a3a05166b04eb127bb12a24 | PKG_MIRROR_HASH:=2a5afc45722c28ca8778eb50452eb305306e7898b32d7d6d73d3e77edf3cce99 | ||||||
| PKG_MAINTAINER:=Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk> | PKG_MAINTAINER:=Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk> | ||||||
|  |  | ||||||
| include $(INCLUDE_DIR)/package.mk | include $(INCLUDE_DIR)/package.mk | ||||||
|   | |||||||
							
								
								
									
										52
									
								
								package/kernel/leds-apu2/Makefile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										52
									
								
								package/kernel/leds-apu2/Makefile
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,52 @@ | |||||||
|  | # | ||||||
|  | # Copyright (C) 2017 Chris Blake <chrisrblake93@gmail.com> | ||||||
|  | # | ||||||
|  | # This is free software, licensed under the GNU General Public License v2. | ||||||
|  | # See /LICENSE for more information. | ||||||
|  | # | ||||||
|  |  | ||||||
|  | include $(TOPDIR)/rules.mk | ||||||
|  | include $(INCLUDE_DIR)/kernel.mk | ||||||
|  |  | ||||||
|  | PKG_NAME:=leds-apu2 | ||||||
|  | PKG_RELEASE:=1 | ||||||
|  |  | ||||||
|  | PKG_MAINTAINER:=Chris Blake <chrisrblake93@gmail.com> | ||||||
|  | PKG_LICENSE:=GPL-2.0 | ||||||
|  |  | ||||||
|  | include $(INCLUDE_DIR)/package.mk | ||||||
|  |  | ||||||
|  | define KernelPackage/leds-apu2 | ||||||
|  |   SUBMENU:=LED modules | ||||||
|  |   TITLE:= PC Engines APU2/APU3 LED support | ||||||
|  |   DEPENDS:= @GPIO_SUPPORT @TARGET_x86 | ||||||
|  |   FILES:=$(PKG_BUILD_DIR)/leds-apu2.ko | ||||||
|  |   AUTOLOAD:=$(call AutoLoad,41,leds-apu2,1) | ||||||
|  |   KCONFIG:= | ||||||
|  | endef | ||||||
|  |  | ||||||
|  | define KernelPackage/leds-apu2/description | ||||||
|  |   Driver for the PC Engines APU2/APU3 LEDs & Reset Button. | ||||||
|  | endef | ||||||
|  |  | ||||||
|  | EXTRA_KCONFIG:= \ | ||||||
|  | 	CONFIG_LEDS_APU2=m | ||||||
|  |  | ||||||
|  | EXTRA_CFLAGS:= \ | ||||||
|  | 	$(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=m,%,$(filter %=m,$(EXTRA_KCONFIG)))) \ | ||||||
|  | 	$(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG)))) \ | ||||||
|  |  | ||||||
|  | MAKE_OPTS:= \ | ||||||
|  | 	ARCH="$(LINUX_KARCH)" \ | ||||||
|  | 	CROSS_COMPILE="$(TARGET_CROSS)" \ | ||||||
|  | 	SUBDIRS="$(PKG_BUILD_DIR)" \ | ||||||
|  | 	EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ | ||||||
|  | 	$(EXTRA_KCONFIG) | ||||||
|  |  | ||||||
|  | define Build/Compile | ||||||
|  | 	 $(MAKE) -C "$(LINUX_DIR)" \ | ||||||
|  | 		$(MAKE_OPTS) \ | ||||||
|  | 		modules | ||||||
|  | endef | ||||||
|  |  | ||||||
|  | $(eval $(call KernelPackage,leds-apu2)) | ||||||
							
								
								
									
										8
									
								
								package/kernel/leds-apu2/src/Kconfig
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								package/kernel/leds-apu2/src/Kconfig
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | |||||||
|  | config LEDS_APU2 | ||||||
|  |         tristate "PC Engines APU2/APU3 LED support" | ||||||
|  |         depends on LEDS_CLASS | ||||||
|  |         depends on LEDS_GPIO | ||||||
|  |         depends on GPIOLIB | ||||||
|  |         help | ||||||
|  |           Say yes here to enable support for the CPU GPIO pins on the PC Engines | ||||||
|  |           APU2/APU3 board, which enables the front LEDs and Reset Button. | ||||||
							
								
								
									
										1
									
								
								package/kernel/leds-apu2/src/Makefile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								package/kernel/leds-apu2/src/Makefile
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1 @@ | |||||||
|  | obj-${CONFIG_LEDS_APU2}    += leds-apu2.o | ||||||
							
								
								
									
										374
									
								
								package/kernel/leds-apu2/src/leds-apu2.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										374
									
								
								package/kernel/leds-apu2/src/leds-apu2.c
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,374 @@ | |||||||
|  | /* | ||||||
|  | *  APU2 LED/GPIO Driver | ||||||
|  | *  Copyright (c) 2016 Christian Lamparter <chunkeey (at) googlemail.com> | ||||||
|  | * | ||||||
|  | *  Based on gpio-apu2.c - AMD FCH GPIO support for PC-Engines APU-2 board | ||||||
|  | * | ||||||
|  | *  Copyright (c) 2015  Carsten Spiess <fli4l at carsten-spiess.de> | ||||||
|  | * | ||||||
|  | *  This program is free software; you can redistribute it and/or modify | ||||||
|  | *  it under the terms of the GNU General Public License as published by | ||||||
|  | *  the Free Software Foundation; either version 2 of the License, or | ||||||
|  | *  (at your option) any later version. | ||||||
|  | * | ||||||
|  | *  This program is distributed in the hope that it will be useful, | ||||||
|  | *  but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||||
|  | *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | ||||||
|  | *  GNU General Public License for more details. | ||||||
|  | * | ||||||
|  | *  You should have received a copy of the GNU General Public License | ||||||
|  | *  along with this program; if not, write to the Free Software | ||||||
|  | *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||||||
|  | */ | ||||||
|  |  | ||||||
|  | #include <linux/module.h> | ||||||
|  | #include <linux/types.h> | ||||||
|  | #include <linux/miscdevice.h> | ||||||
|  | #include <linux/gpio.h> | ||||||
|  | #include <linux/init.h> | ||||||
|  | #include <linux/pci.h> | ||||||
|  | #include <linux/ioport.h> | ||||||
|  | #include <linux/platform_device.h> | ||||||
|  | #include <linux/uaccess.h> | ||||||
|  | #include <linux/io.h> | ||||||
|  | #include <linux/version.h> | ||||||
|  | #include <linux/dmi.h> | ||||||
|  | #include <linux/string.h> | ||||||
|  |  | ||||||
|  | #include <linux/leds.h> | ||||||
|  | #include <linux/input.h> | ||||||
|  | #include <linux/gpio_keys.h> | ||||||
|  |  | ||||||
|  | #define DEVNAME                 "leds-apu2" | ||||||
|  |  | ||||||
|  | #define FCH_ACPI_MMIO_BASE      0xFED80000 | ||||||
|  | #define FCH_GPIO_BASE           (FCH_ACPI_MMIO_BASE + 0x1500) | ||||||
|  | #define FCH_GPIO_SIZE           0x300 | ||||||
|  |  | ||||||
|  | #define APU_NUM_GPIO            4 | ||||||
|  |  | ||||||
|  | #define GPIO_BIT_DIR            23 | ||||||
|  | #define GPIO_BIT_WRITE          22 | ||||||
|  | #define GPIO_BIT_READ           16 | ||||||
|  |  | ||||||
|  | /* internal variables */ | ||||||
|  | static struct pci_dev *gpio_apu2_pci; | ||||||
|  | static DEFINE_SPINLOCK (gpio_lock); | ||||||
|  |  | ||||||
|  | /* the watchdog platform device */ | ||||||
|  | static struct platform_device *gpio_apu2_platform_device; | ||||||
|  | static struct platform_device *leddev; | ||||||
|  | static struct platform_device *keydev; | ||||||
|  |  | ||||||
|  | static const struct pci_device_id gpio_apu2_pci_tbl[] ={ | ||||||
|  | 	{PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_HUDSON2_SMBUS, PCI_ANY_ID, PCI_ANY_ID}, | ||||||
|  | 	{ 0, } /* End of list */ | ||||||
|  | }; | ||||||
|  | MODULE_DEVICE_TABLE (pci, gpio_apu2_pci_tbl); | ||||||
|  |  | ||||||
|  | /* EGPIO89=GPIO32, AGPIO68=GPIO57, AGPIO69=GPIO58, AGPIO70=GPIO59 */ | ||||||
|  | static u8 gpio_offset[APU_NUM_GPIO] = {89, 68, 69, 70}; | ||||||
|  |  | ||||||
|  | static void __iomem *gpio_addr[APU_NUM_GPIO] = {NULL, NULL, NULL, NULL}; | ||||||
|  |  | ||||||
|  | static int gpio_apu2_get_dir (struct gpio_chip *chip, unsigned offset) | ||||||
|  | { | ||||||
|  | 	u32 val; | ||||||
|  |  | ||||||
|  | 	val = ~ioread32 (gpio_addr[offset]); | ||||||
|  |  | ||||||
|  | 	return (val >> GPIO_BIT_DIR) & 1; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | static int gpio_apu2_dir_in (struct gpio_chip *gc, unsigned offset) | ||||||
|  | { | ||||||
|  | 	u32 val; | ||||||
|  |  | ||||||
|  | 	spin_lock_bh (&gpio_lock); | ||||||
|  |  | ||||||
|  | 	val = ioread32 (gpio_addr[offset]); | ||||||
|  | 	val &= ~BIT(GPIO_BIT_DIR); | ||||||
|  | 	iowrite32 (val, gpio_addr[offset]); | ||||||
|  |  | ||||||
|  | 	spin_unlock_bh (&gpio_lock); | ||||||
|  |  | ||||||
|  | 	return 0; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | static int gpio_apu2_dir_out (struct gpio_chip *chip, unsigned offset, | ||||||
|  | 		int value) | ||||||
|  | { | ||||||
|  | 	u32 val; | ||||||
|  |  | ||||||
|  | 	spin_lock_bh (&gpio_lock); | ||||||
|  |  | ||||||
|  | 	val = ioread32 (gpio_addr[offset]); | ||||||
|  | 	val |= BIT(GPIO_BIT_DIR); | ||||||
|  | 	iowrite32 (val, gpio_addr[offset]); | ||||||
|  |  | ||||||
|  | 	spin_unlock_bh (&gpio_lock); | ||||||
|  |  | ||||||
|  | 	return 0; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | static int gpio_apu2_get_data (struct gpio_chip *chip, unsigned offset) | ||||||
|  | { | ||||||
|  | 	u32 val; | ||||||
|  |  | ||||||
|  | 	val = ioread32 (gpio_addr[offset]); | ||||||
|  |  | ||||||
|  | 	return (val >> GPIO_BIT_READ) & 1; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | static void gpio_apu2_set_data (struct gpio_chip *chip, unsigned offset, int value) | ||||||
|  | { | ||||||
|  | 	u32 val; | ||||||
|  |  | ||||||
|  | 	spin_lock_bh (&gpio_lock); | ||||||
|  |  | ||||||
|  | 	val = ioread32 (gpio_addr[offset]); | ||||||
|  |  | ||||||
|  | 	if (value) | ||||||
|  | 		val |= BIT(GPIO_BIT_WRITE); | ||||||
|  | 	else | ||||||
|  | 		val &= ~BIT(GPIO_BIT_WRITE); | ||||||
|  |  | ||||||
|  | 	iowrite32 (val, gpio_addr[offset]); | ||||||
|  |  | ||||||
|  | 	spin_unlock_bh (&gpio_lock); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | static struct gpio_chip gpio_apu2_chip = { | ||||||
|  | 	.label = DEVNAME, | ||||||
|  | 	.owner = THIS_MODULE, | ||||||
|  | 	.base = -1, | ||||||
|  | 	.ngpio = APU_NUM_GPIO, | ||||||
|  | 	.get_direction = gpio_apu2_get_dir, | ||||||
|  | 	.direction_input = gpio_apu2_dir_in, | ||||||
|  | 	.direction_output = gpio_apu2_dir_out, | ||||||
|  | 	.get = gpio_apu2_get_data, | ||||||
|  | 	.set = gpio_apu2_set_data, | ||||||
|  | }; | ||||||
|  |  | ||||||
|  | /* | ||||||
|  |  * | ||||||
|  |  */ | ||||||
|  | static int gpio_apu2_probe (struct platform_device *dev) | ||||||
|  | { | ||||||
|  | 	int ret = 0; | ||||||
|  | 	int i; | ||||||
|  | 	struct pci_dev *pci_dev = NULL; | ||||||
|  |  | ||||||
|  | 	/* Match the PCI device */ | ||||||
|  | 	for_each_pci_dev (pci_dev) { | ||||||
|  | 		if (pci_match_id (gpio_apu2_pci_tbl, pci_dev) != NULL) { | ||||||
|  | 			gpio_apu2_pci = pci_dev; | ||||||
|  | 			break; | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	if (!gpio_apu2_pci) | ||||||
|  | 		return -ENODEV; | ||||||
|  |  | ||||||
|  | 	pr_info ("%s: PCI Revision ID: 0x%x\n", DEVNAME, gpio_apu2_pci->revision); | ||||||
|  |  | ||||||
|  | 	/* Determine type of southbridge chipset */ | ||||||
|  | 	if (gpio_apu2_pci->revision < 0x40) { | ||||||
|  | 		return -EACCES; | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	/* Request memory region for GPIO's */ | ||||||
|  | 	if (!devm_request_mem_region (&dev->dev, FCH_GPIO_BASE, | ||||||
|  | 		FCH_GPIO_SIZE, DEVNAME)){ | ||||||
|  | 		pr_err ("%s: request GPIO mem region failed\n", DEVNAME); | ||||||
|  | 		return -ENXIO; | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	/* Map IO's for GPIO's */ | ||||||
|  | 	for (i = 0; i < APU_NUM_GPIO; i++) { | ||||||
|  | 		gpio_addr[i] = devm_ioremap (&dev->dev, | ||||||
|  | 			FCH_GPIO_BASE + (gpio_offset[i] * sizeof (u32)), sizeof (u32)); | ||||||
|  | 		if (!gpio_addr[i]) { | ||||||
|  | 			pr_err ("%s: map GPIO%d address failed\n", DEVNAME, gpio_offset[i]); | ||||||
|  | 			return -ENXIO; | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	gpio_apu2_chip.dev = &dev->dev; | ||||||
|  | 	ret = gpiochip_add (&gpio_apu2_chip); | ||||||
|  | 	if (ret) { | ||||||
|  | 		pr_err ("%s: adding gpiochip failed\n", DEVNAME); | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	return ret; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | static int gpio_apu2_remove (struct platform_device *dev) | ||||||
|  | { | ||||||
|  | #if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) | ||||||
|  | 	int ret; | ||||||
|  | 	ret = gpiochip_remove (&gpio_apu2_chip); | ||||||
|  | #else /* LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) */ | ||||||
|  | 	gpiochip_remove (&gpio_apu2_chip); | ||||||
|  | #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) */ | ||||||
|  | 	return 0; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | static struct platform_driver gpio_apu2_driver = { | ||||||
|  | 	.probe = gpio_apu2_probe, | ||||||
|  | 	.remove = gpio_apu2_remove, | ||||||
|  | 	.driver = { | ||||||
|  | 		.owner = THIS_MODULE, | ||||||
|  | 		.name = DEVNAME | ||||||
|  | 	} | ||||||
|  | }; | ||||||
|  |  | ||||||
|  | static struct gpio_led apu2_leds_gpio[] = { | ||||||
|  |         { | ||||||
|  |                 .name           = "apu2:green:power", | ||||||
|  |                 .gpio           = 509, | ||||||
|  |                 .active_low     = 1, | ||||||
|  |         }, | ||||||
|  |         { | ||||||
|  |                 .name           = "apu2:green:led2", | ||||||
|  |                 .gpio           = 510, | ||||||
|  |                 .active_low     = 1, | ||||||
|  |         }, | ||||||
|  |         { | ||||||
|  |                 .name           = "apu2:green:led3", | ||||||
|  |                 .gpio           = 511, | ||||||
|  |                 .active_low     = 1, | ||||||
|  |         }, | ||||||
|  | }; | ||||||
|  |  | ||||||
|  | static struct gpio_keys_button apu2_gpio_keys[] = { | ||||||
|  | 	{ | ||||||
|  | 		.desc           = "Reset button", | ||||||
|  | 		.type           = EV_KEY, | ||||||
|  | 		.code           = KEY_RESTART, | ||||||
|  | 		.debounce_interval = 60, | ||||||
|  | 		.gpio           = 508, | ||||||
|  | 		.active_low     = 1, | ||||||
|  | 	}, | ||||||
|  | }; | ||||||
|  |  | ||||||
|  | static void register_gpio_keys_polled(int id, unsigned poll_interval, | ||||||
|  | 				      unsigned nbuttons, | ||||||
|  | 				      struct gpio_keys_button *buttons) | ||||||
|  | { | ||||||
|  | 	struct gpio_keys_platform_data pdata = { }; | ||||||
|  | 	int err; | ||||||
|  |  | ||||||
|  | 	keydev = platform_device_alloc("gpio-keys-polled", id); | ||||||
|  | 	if (!keydev) { | ||||||
|  | 		printk(KERN_ERR "Failed to allocate gpio-keys platform device\n"); | ||||||
|  | 		return; | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	pdata.poll_interval = poll_interval; | ||||||
|  | 	pdata.nbuttons = nbuttons; | ||||||
|  | 	pdata.buttons = buttons; | ||||||
|  |  | ||||||
|  | 	err = platform_device_add_data(keydev, &pdata, sizeof(pdata)); | ||||||
|  | 	if (err) { | ||||||
|  | 		dev_err(&keydev->dev, "failed to add platform data to key driver (%d)", err); | ||||||
|  | 		goto err_put_pdev; | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	err = platform_device_add(keydev); | ||||||
|  | 	if (err) { | ||||||
|  | 		dev_err(&keydev->dev, "failed to register key platform device (%d)", err); | ||||||
|  | 		goto err_put_pdev; | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	return; | ||||||
|  |  | ||||||
|  | err_put_pdev: | ||||||
|  | 	platform_device_put(keydev); | ||||||
|  | 	keydev = NULL; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | static void register_leds_gpio(int id, unsigned num_leds, struct gpio_led *leds) | ||||||
|  | { | ||||||
|  | 	struct gpio_led_platform_data pdata = { }; | ||||||
|  | 	int err; | ||||||
|  |  | ||||||
|  | 	leddev = platform_device_alloc("leds-gpio", id); | ||||||
|  | 	if (!leddev) { | ||||||
|  | 		printk(KERN_ERR "Failed to allocate leds-gpio platform device\n"); | ||||||
|  | 		return; | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	pdata.num_leds = num_leds; | ||||||
|  | 	pdata.leds = leds; | ||||||
|  |  | ||||||
|  | 	err = platform_device_add_data(leddev, &pdata, sizeof(pdata)); | ||||||
|  | 	if (err) { | ||||||
|  | 		dev_err(&leddev->dev, "failed to add platform data to key driver (%d)", err); | ||||||
|  | 		goto err_put_pdev; | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	err = platform_device_add(leddev); | ||||||
|  | 	if (err) { | ||||||
|  | 		dev_err(&leddev->dev, "failed to register key platform device (%d)", err); | ||||||
|  | 		goto err_put_pdev; | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	return; | ||||||
|  |  | ||||||
|  | err_put_pdev: | ||||||
|  | 	platform_device_put(leddev); | ||||||
|  | 	leddev = NULL; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | static int __init gpio_apu2_init (void) | ||||||
|  | { | ||||||
|  | 	int err; | ||||||
|  | 	const char *board_vendor = dmi_get_system_info(DMI_BOARD_VENDOR); | ||||||
|  | 	const char *board_name = dmi_get_system_info(DMI_BOARD_NAME); | ||||||
|  |  | ||||||
|  | 	/* Match the device name/model */ | ||||||
|  | 	if (!board_name || !board_vendor || strcasecmp(board_vendor, "PC Engines") || strcasecmp(board_name, "apu2")) { | ||||||
|  | 		err = -ENODEV; | ||||||
|  | 		goto exit; | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	pr_info ("%s: load APU2/LED GPIO driver module\n", DEVNAME); | ||||||
|  |  | ||||||
|  | 	err = platform_driver_register (&gpio_apu2_driver); | ||||||
|  | 	if (err) | ||||||
|  | 		goto exit; | ||||||
|  |  | ||||||
|  | 	gpio_apu2_platform_device = platform_device_register_simple (DEVNAME, -1, NULL, 0); | ||||||
|  | 	if (IS_ERR(gpio_apu2_platform_device)) { | ||||||
|  | 		err = PTR_ERR(gpio_apu2_platform_device); | ||||||
|  | 		goto exit_driver; | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	pr_info ("%s: APU2 GPIO/LED driver module loaded\n", DEVNAME); | ||||||
|  |  | ||||||
|  | 	register_leds_gpio(-1, ARRAY_SIZE(apu2_leds_gpio), apu2_leds_gpio); | ||||||
|  | 	register_gpio_keys_polled(-1, 20, ARRAY_SIZE(apu2_gpio_keys), apu2_gpio_keys); | ||||||
|  | 	return 0; | ||||||
|  |  | ||||||
|  | exit_driver: | ||||||
|  | 	platform_driver_unregister (&gpio_apu2_driver); | ||||||
|  | exit: | ||||||
|  | 	return err; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | static void __exit gpio_apu2_exit (void) | ||||||
|  | { | ||||||
|  | 	platform_device_unregister (gpio_apu2_platform_device); | ||||||
|  | 	platform_device_unregister (leddev); | ||||||
|  | 	platform_device_unregister (keydev); | ||||||
|  | 	platform_driver_unregister (&gpio_apu2_driver); | ||||||
|  | 	pr_info ("%s: APU2 GPIO/LED driver module unloaded\n", DEVNAME); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | MODULE_AUTHOR ("Carsten Spiess <fli4l at carsten-spiess.de>"); | ||||||
|  | MODULE_DESCRIPTION("GPIO driver for AMD FCH on PC-Engines APU-2"); | ||||||
|  | MODULE_LICENSE("GPL"); | ||||||
|  |  | ||||||
|  | module_init (gpio_apu2_init); | ||||||
|  | module_exit (gpio_apu2_exit); | ||||||
| @@ -436,7 +436,7 @@ endef | |||||||
|  |  | ||||||
| define KernelPackage/crypto-md5/octeon | define KernelPackage/crypto-md5/octeon | ||||||
|   FILES+=$(LINUX_DIR)/arch/mips/cavium-octeon/crypto/octeon-md5.ko |   FILES+=$(LINUX_DIR)/arch/mips/cavium-octeon/crypto/octeon-md5.ko | ||||||
|   AUTOLOAD:=$(call AutoLoad,09,octeon-md5) |   AUTOLOAD+=$(call AutoLoad,09,octeon-md5) | ||||||
| endef | endef | ||||||
|  |  | ||||||
| $(eval $(call KernelPackage,crypto-md5)) | $(eval $(call KernelPackage,crypto-md5)) | ||||||
| @@ -468,12 +468,12 @@ endef | |||||||
|  |  | ||||||
| define KernelPackage/crypto-sha1/octeon | define KernelPackage/crypto-sha1/octeon | ||||||
|   FILES+=$(LINUX_DIR)/arch/mips/cavium-octeon/crypto/octeon-sha1.ko |   FILES+=$(LINUX_DIR)/arch/mips/cavium-octeon/crypto/octeon-sha1.ko | ||||||
|   AUTOLOAD:=$(call AutoLoad,09,octeon-sha1) |   AUTOLOAD+=$(call AutoLoad,09,octeon-sha1) | ||||||
| endef | endef | ||||||
|  |  | ||||||
| define KernelPackage/crypto-sha1/x86/64 | define KernelPackage/crypto-sha1/x86/64 | ||||||
|   FILES+=$(LINUX_DIR)/arch/x86/crypto/sha1-ssse3.ko |   FILES+=$(LINUX_DIR)/arch/x86/crypto/sha1-ssse3.ko | ||||||
|   AUTOLOAD:=$(call AutoLoad,09,sha1-ssse3) |   AUTOLOAD+=$(call AutoLoad,09,sha1-ssse3) | ||||||
| endef | endef | ||||||
|  |  | ||||||
| $(eval $(call KernelPackage,crypto-sha1)) | $(eval $(call KernelPackage,crypto-sha1)) | ||||||
| @@ -493,12 +493,12 @@ endef | |||||||
|  |  | ||||||
| define KernelPackage/crypto-sha256/octeon | define KernelPackage/crypto-sha256/octeon | ||||||
|   FILES+=$(LINUX_DIR)/arch/mips/cavium-octeon/crypto/octeon-sha256.ko |   FILES+=$(LINUX_DIR)/arch/mips/cavium-octeon/crypto/octeon-sha256.ko | ||||||
|   AUTOLOAD:=$(call AutoLoad,09,octeon-sha256) |   AUTOLOAD+=$(call AutoLoad,09,octeon-sha256) | ||||||
| endef | endef | ||||||
|  |  | ||||||
| define KernelPackage/crypto-sha256/x86/64 | define KernelPackage/crypto-sha256/x86/64 | ||||||
|   FILES+=$(LINUX_DIR)/arch/x86/crypto/sha256-ssse3.ko |   FILES+=$(LINUX_DIR)/arch/x86/crypto/sha256-ssse3.ko | ||||||
|   AUTOLOAD:=$(call AutoLoad,09,sha256-ssse3) |   AUTOLOAD+=$(call AutoLoad,09,sha256-ssse3) | ||||||
| endef | endef | ||||||
|  |  | ||||||
| $(eval $(call KernelPackage,crypto-sha256)) | $(eval $(call KernelPackage,crypto-sha256)) | ||||||
| @@ -518,12 +518,12 @@ endef | |||||||
|  |  | ||||||
| define KernelPackage/crypto-sha512/octeon | define KernelPackage/crypto-sha512/octeon | ||||||
|   FILES+=$(LINUX_DIR)/arch/mips/cavium-octeon/crypto/octeon-sha512.ko |   FILES+=$(LINUX_DIR)/arch/mips/cavium-octeon/crypto/octeon-sha512.ko | ||||||
|   AUTOLOAD:=$(call AutoLoad,09,octeon-sha512) |   AUTOLOAD+=$(call AutoLoad,09,octeon-sha512) | ||||||
| endef | endef | ||||||
|  |  | ||||||
| define KernelPackage/crypto-sha512/x86/64 | define KernelPackage/crypto-sha512/x86/64 | ||||||
|   FILES+=$(LINUX_DIR)/arch/x86/crypto/sha512-ssse3.ko |   FILES+=$(LINUX_DIR)/arch/x86/crypto/sha512-ssse3.ko | ||||||
|   AUTOLOAD:=$(call AutoLoad,09,sha512-ssse3) |   AUTOLOAD+=$(call AutoLoad,09,sha512-ssse3) | ||||||
| endef | endef | ||||||
|  |  | ||||||
| $(eval $(call KernelPackage,crypto-sha512)) | $(eval $(call KernelPackage,crypto-sha512)) | ||||||
|   | |||||||
| @@ -495,7 +495,7 @@ $(eval $(call KernelPackage,ipt-tproxy)) | |||||||
|  |  | ||||||
| define KernelPackage/ipt-tee | define KernelPackage/ipt-tee | ||||||
|   TITLE:=TEE support |   TITLE:=TEE support | ||||||
|   DEPENDS:=+kmod-ipt-conntrack @!LINUX_4_4 |   DEPENDS:=+kmod-ipt-conntrack | ||||||
|   KCONFIG:= \ |   KCONFIG:= \ | ||||||
|   	CONFIG_NETFILTER_XT_TARGET_TEE |   	CONFIG_NETFILTER_XT_TARGET_TEE | ||||||
|   FILES:= \ |   FILES:= \ | ||||||
|   | |||||||
| @@ -736,7 +736,7 @@ $(eval $(call KernelPackage,mppe)) | |||||||
|  |  | ||||||
|  |  | ||||||
| SCHED_MODULES = $(patsubst $(LINUX_DIR)/net/sched/%.ko,%,$(wildcard $(LINUX_DIR)/net/sched/*.ko)) | SCHED_MODULES = $(patsubst $(LINUX_DIR)/net/sched/%.ko,%,$(wildcard $(LINUX_DIR)/net/sched/*.ko)) | ||||||
| SCHED_MODULES_CORE = sch_ingress sch_fq_codel sch_hfsc cls_fw cls_route cls_flow cls_tcindex cls_u32 em_u32 act_mirred act_skbedit | SCHED_MODULES_CORE = sch_ingress sch_fq_codel sch_hfsc sch_htb sch_tbf cls_fw cls_route cls_flow cls_tcindex cls_u32 em_u32 act_mirred act_skbedit | ||||||
| SCHED_MODULES_FILTER = $(SCHED_MODULES_CORE) act_connmark sch_netem | SCHED_MODULES_FILTER = $(SCHED_MODULES_CORE) act_connmark sch_netem | ||||||
| SCHED_MODULES_EXTRA = $(filter-out $(SCHED_MODULES_FILTER),$(SCHED_MODULES)) | SCHED_MODULES_EXTRA = $(filter-out $(SCHED_MODULES_FILTER),$(SCHED_MODULES)) | ||||||
| SCHED_FILES = $(patsubst %,$(LINUX_DIR)/net/sched/%.ko,$(filter $(SCHED_MODULES_CORE),$(SCHED_MODULES))) | SCHED_FILES = $(patsubst %,$(LINUX_DIR)/net/sched/%.ko,$(filter $(SCHED_MODULES_CORE),$(SCHED_MODULES))) | ||||||
| @@ -748,6 +748,8 @@ define KernelPackage/sched-core | |||||||
|   KCONFIG:= \ |   KCONFIG:= \ | ||||||
| 	CONFIG_NET_SCHED=y \ | 	CONFIG_NET_SCHED=y \ | ||||||
| 	CONFIG_NET_SCH_HFSC \ | 	CONFIG_NET_SCH_HFSC \ | ||||||
|  | 	CONFIG_NET_SCH_HTB \ | ||||||
|  | 	CONFIG_NET_SCH_TBF \ | ||||||
| 	CONFIG_NET_SCH_INGRESS \ | 	CONFIG_NET_SCH_INGRESS \ | ||||||
| 	CONFIG_NET_SCH_FQ_CODEL \ | 	CONFIG_NET_SCH_FQ_CODEL \ | ||||||
| 	CONFIG_NET_CLS=y \ | 	CONFIG_NET_CLS=y \ | ||||||
| @@ -789,12 +791,10 @@ define KernelPackage/sched | |||||||
|   KCONFIG:= \ |   KCONFIG:= \ | ||||||
| 	CONFIG_NET_SCH_CODEL \ | 	CONFIG_NET_SCH_CODEL \ | ||||||
| 	CONFIG_NET_SCH_DSMARK \ | 	CONFIG_NET_SCH_DSMARK \ | ||||||
| 	CONFIG_NET_SCH_HTB \ |  | ||||||
| 	CONFIG_NET_SCH_FIFO \ | 	CONFIG_NET_SCH_FIFO \ | ||||||
| 	CONFIG_NET_SCH_GRED \ | 	CONFIG_NET_SCH_GRED \ | ||||||
| 	CONFIG_NET_SCH_PRIO \ | 	CONFIG_NET_SCH_PRIO \ | ||||||
| 	CONFIG_NET_SCH_RED \ | 	CONFIG_NET_SCH_RED \ | ||||||
| 	CONFIG_NET_SCH_TBF \ |  | ||||||
| 	CONFIG_NET_SCH_SFQ \ | 	CONFIG_NET_SCH_SFQ \ | ||||||
| 	CONFIG_NET_SCH_TEQL \ | 	CONFIG_NET_SCH_TEQL \ | ||||||
| 	CONFIG_NET_SCH_FQ \ | 	CONFIG_NET_SCH_FQ \ | ||||||
|   | |||||||
| @@ -147,6 +147,38 @@ endef | |||||||
| $(eval $(call KernelPackage,nls-cp932)) | $(eval $(call KernelPackage,nls-cp932)) | ||||||
|  |  | ||||||
|  |  | ||||||
|  | define KernelPackage/nls-cp936 | ||||||
|  |   SUBMENU:=Native Language Support | ||||||
|  |   TITLE:=Codepage 936 (Simplified Chinese) | ||||||
|  |   KCONFIG:=CONFIG_NLS_CODEPAGE_936 | ||||||
|  |   FILES:=$(LINUX_DIR)/fs/nls/nls_cp936.ko | ||||||
|  |   AUTOLOAD:=$(call AutoLoad,25,nls_cp936) | ||||||
|  |   $(call AddDepends/nls) | ||||||
|  | endef | ||||||
|  |  | ||||||
|  | define KernelPackage/nls-cp936/description | ||||||
|  |   Kernel module for NLS Codepage 936 (Simplified Chinese) | ||||||
|  | endef | ||||||
|  |  | ||||||
|  | $(eval $(call KernelPackage,nls-cp936)) | ||||||
|  |  | ||||||
|  |  | ||||||
|  | define KernelPackage/nls-cp950 | ||||||
|  |   SUBMENU:=Native Language Support | ||||||
|  |   TITLE:=Codepage 950 (Traditional Chinese) | ||||||
|  |   KCONFIG:=CONFIG_NLS_CODEPAGE_950 | ||||||
|  |   FILES:=$(LINUX_DIR)/fs/nls/nls_cp950.ko | ||||||
|  |   AUTOLOAD:=$(call AutoLoad,25,nls_cp950) | ||||||
|  |   $(call AddDepends/nls) | ||||||
|  | endef | ||||||
|  |  | ||||||
|  | define KernelPackage/nls-cp950/description | ||||||
|  |   Kernel module for NLS Codepage 950 (Traditional Chinese) | ||||||
|  | endef | ||||||
|  |  | ||||||
|  | $(eval $(call KernelPackage,nls-cp950)) | ||||||
|  |  | ||||||
|  |  | ||||||
| define KernelPackage/nls-cp1250 | define KernelPackage/nls-cp1250 | ||||||
|   SUBMENU:=Native Language Support |   SUBMENU:=Native Language Support | ||||||
|   TITLE:=Codepage 1250 (Eastern Europe) |   TITLE:=Codepage 1250 (Eastern Europe) | ||||||
|   | |||||||
| @@ -67,7 +67,7 @@ define KernelPackage/sound-core/uml | |||||||
|   FILES:= \ |   FILES:= \ | ||||||
| 	$(LINUX_DIR)/sound/soundcore.ko \ | 	$(LINUX_DIR)/sound/soundcore.ko \ | ||||||
| 	$(LINUX_DIR)/arch/um/drivers/hostaudio.ko | 	$(LINUX_DIR)/arch/um/drivers/hostaudio.ko | ||||||
|   AUTOLOAD:=$(call AutoLoad,30,soundcore hostaudio) |   AUTOLOAD+=$(call AutoLoad,30,soundcore hostaudio) | ||||||
| endef | endef | ||||||
|  |  | ||||||
| define KernelPackage/sound-core/description | define KernelPackage/sound-core/description | ||||||
|   | |||||||
| @@ -47,7 +47,7 @@ define KernelPackage/backlight-pwm | |||||||
| 	AUTOLOAD:=$(call AutoProbe,video pwm_bl) | 	AUTOLOAD:=$(call AutoProbe,video pwm_bl) | ||||||
| endef | endef | ||||||
|  |  | ||||||
| define KernelPackage/backlight/backlight-pwm | define KernelPackage/backlight-pwm/description | ||||||
| 	Kernel module for PWM based Backlight support. | 	Kernel module for PWM based Backlight support. | ||||||
| endef | endef | ||||||
|  |  | ||||||
| @@ -72,7 +72,7 @@ endef | |||||||
|  |  | ||||||
| define KernelPackage/fb/x86 | define KernelPackage/fb/x86 | ||||||
|   FILES+=$(LINUX_DIR)/arch/x86/video/fbdev.ko |   FILES+=$(LINUX_DIR)/arch/x86/video/fbdev.ko | ||||||
|   AUTOLOAD:=$(call AutoLoad,06,fbdev fb) |   AUTOLOAD+=$(call AutoLoad,06,fbdev fb) | ||||||
| endef | endef | ||||||
|  |  | ||||||
| $(eval $(call KernelPackage,fb)) | $(eval $(call KernelPackage,fb)) | ||||||
|   | |||||||
| @@ -10,13 +10,13 @@ include $(INCLUDE_DIR)/kernel.mk | |||||||
|  |  | ||||||
| PKG_NAME:=mac80211 | PKG_NAME:=mac80211 | ||||||
|  |  | ||||||
| PKG_VERSION:=2016-10-08 | PKG_VERSION:=2017-01-31 | ||||||
| PKG_RELEASE:=1 | PKG_RELEASE:=2 | ||||||
| PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources | PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources | ||||||
| PKG_BACKPORT_VERSION:= | PKG_BACKPORT_VERSION:= | ||||||
| PKG_HASH:=4f6350e3b75815060bfdf47ef266ad613c7bfea5b7b1dc4552dee69e1bebe4fb | PKG_HASH:=75e6d39e34cf156212a2509172a4a62b673b69eb4a1d9aaa565f7fa719fa2317 | ||||||
|  |  | ||||||
| PKG_SOURCE:=compat-wireless-$(PKG_VERSION)$(PKG_BACKPORT_VERSION).tar.bz2 | PKG_SOURCE:=compat-wireless-$(PKG_VERSION)$(PKG_BACKPORT_VERSION).tar.xz | ||||||
| PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/compat-wireless-$(PKG_VERSION) | PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/compat-wireless-$(PKG_VERSION) | ||||||
| PKG_BUILD_PARALLEL:=1 | PKG_BUILD_PARALLEL:=1 | ||||||
|  |  | ||||||
| @@ -35,7 +35,7 @@ PKG_DRIVERS = \ | |||||||
| 	libertas-sdio libertas-usb libertas-spi \ | 	libertas-sdio libertas-usb libertas-spi \ | ||||||
| 	mac80211-hwsim \ | 	mac80211-hwsim \ | ||||||
| 	mt7601u \ | 	mt7601u \ | ||||||
| 	mwl8k mwifiex-pcie \ | 	mwl8k mwifiex-pcie mwifiex-sdio \ | ||||||
| 	p54-common p54-pci p54-spi p54-usb \ | 	p54-common p54-pci p54-spi p54-usb \ | ||||||
| 	rt2x00-lib rt2x00-pci rt2x00-usb \ | 	rt2x00-lib rt2x00-pci rt2x00-usb \ | ||||||
| 	rt2400-pci rt2500-pci rt2500-usb \ | 	rt2400-pci rt2500-pci rt2500-usb \ | ||||||
| @@ -68,6 +68,8 @@ PKG_CONFIG_DEPENDS:= \ | |||||||
| 	CONFIG_PACKAGE_BRCM80211_DEBUG \ | 	CONFIG_PACKAGE_BRCM80211_DEBUG \ | ||||||
| 	CONFIG_PACKAGE_IWLWIFI_DEBUG \ | 	CONFIG_PACKAGE_IWLWIFI_DEBUG \ | ||||||
| 	CONFIG_PACKAGE_IWLWIFI_DEBUGFS \ | 	CONFIG_PACKAGE_IWLWIFI_DEBUGFS \ | ||||||
|  | 	CONFIG_PACKAGE_RT2X00_LIB_DEBUGFS \ | ||||||
|  | 	CONFIG_PACKAGE_RT2X00_DEBUG \ | ||||||
| 	CONFIG_PACKAGE_RTLWIFI_DEBUG \ | 	CONFIG_PACKAGE_RTLWIFI_DEBUG \ | ||||||
| 	CONFIG_ATH9K_SUPPORT_PCOEM \ | 	CONFIG_ATH9K_SUPPORT_PCOEM \ | ||||||
| 	CONFIG_ATH9K_TX99 \ | 	CONFIG_ATH9K_TX99 \ | ||||||
| @@ -248,7 +250,7 @@ define KernelPackage/ath9k/config | |||||||
| 		depends on PACKAGE_kmod-ath9k | 		depends on PACKAGE_kmod-ath9k | ||||||
|  |  | ||||||
|        config ATH9K_TX99 |        config ATH9K_TX99 | ||||||
|                bool "Enable TX99 support" |                bool "Enable TX99 support (WARNING: testing only, breaks normal operation!)" | ||||||
|                depends on PACKAGE_kmod-ath9k |                depends on PACKAGE_kmod-ath9k | ||||||
|  |  | ||||||
| 	config ATH9K_UBNTHSR | 	config ATH9K_UBNTHSR | ||||||
| @@ -1022,7 +1024,7 @@ endef | |||||||
| define KernelPackage/mac80211-hwsim | define KernelPackage/mac80211-hwsim | ||||||
|   $(call KernelPackage/mac80211/Default) |   $(call KernelPackage/mac80211/Default) | ||||||
|   TITLE:=mac80211 HW simulation device |   TITLE:=mac80211 HW simulation device | ||||||
|   DEPENDS+= +kmod-mac80211 +@DRIVER_11N_SUPPORT |   DEPENDS+= +kmod-mac80211 +@DRIVER_11AC_SUPPORT +@DRIVER_11N_SUPPORT +@DRIVER_11W_SUPPORT | ||||||
|   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mac80211_hwsim.ko |   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mac80211_hwsim.ko | ||||||
|   AUTOLOAD:=$(call AutoProbe,mac80211_hwsim) |   AUTOLOAD:=$(call AutoProbe,mac80211_hwsim) | ||||||
| endef | endef | ||||||
| @@ -1055,7 +1057,7 @@ define KernelPackage/mwifiex-pcie | |||||||
|   $(call KernelPackage/mac80211/Default) |   $(call KernelPackage/mac80211/Default) | ||||||
|   TITLE:=Driver for Marvell 802.11n/802.11ac PCIe Wireless cards |   TITLE:=Driver for Marvell 802.11n/802.11ac PCIe Wireless cards | ||||||
|   URL:=http://wireless.kernel.org/en/users/Drivers/mwifiex |   URL:=http://wireless.kernel.org/en/users/Drivers/mwifiex | ||||||
|   DEPENDS+= @PCI_SUPPORT +kmod-mac80211 +@DRIVER_11N_SUPPORT +mwifiex-pcie-firmware |   DEPENDS+= @PCI_SUPPORT +kmod-mac80211 +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT +mwifiex-pcie-firmware | ||||||
|   FILES:= \ |   FILES:= \ | ||||||
| 	$(PKG_BUILD_DIR)/drivers/net/wireless/marvell/mwifiex/mwifiex.ko \ | 	$(PKG_BUILD_DIR)/drivers/net/wireless/marvell/mwifiex/mwifiex.ko \ | ||||||
| 	$(PKG_BUILD_DIR)/drivers/net/wireless/marvell/mwifiex/mwifiex_pcie.ko | 	$(PKG_BUILD_DIR)/drivers/net/wireless/marvell/mwifiex/mwifiex_pcie.ko | ||||||
| @@ -1066,6 +1068,21 @@ define KernelPackage/mwifiex-pcie/description | |||||||
|  Kernel modules for Marvell 802.11n/802.11ac PCIe Wireless cards |  Kernel modules for Marvell 802.11n/802.11ac PCIe Wireless cards | ||||||
| endef | endef | ||||||
|  |  | ||||||
|  | define KernelPackage/mwifiex-sdio | ||||||
|  |   $(call KernelPackage/mac80211/Default) | ||||||
|  |   TITLE:=Driver for Marvell 802.11n/802.11ac SDIO Wireless cards | ||||||
|  |   URL:=http://wireless.kernel.org/en/users/Drivers/mwifiex | ||||||
|  |   DEPENDS+= +kmod-mmc +kmod-mac80211 +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT +mwifiex-sdio-firmware | ||||||
|  |   FILES:= \ | ||||||
|  | 	$(PKG_BUILD_DIR)/drivers/net/wireless/marvell/mwifiex/mwifiex.ko \ | ||||||
|  | 	$(PKG_BUILD_DIR)/drivers/net/wireless/marvell/mwifiex/mwifiex_sdio.ko | ||||||
|  |   AUTOLOAD:=$(call AutoProbe,mwifiex_sdio) | ||||||
|  | endef | ||||||
|  |  | ||||||
|  | define KernelPackage/mwifiex-sdio/description | ||||||
|  |  Kernel modules for Marvell 802.11n/802.11ac SDIO Wireless cards | ||||||
|  | endef | ||||||
|  |  | ||||||
| define KernelPackage/p54/Default | define KernelPackage/p54/Default | ||||||
|   $(call KernelPackage/mac80211/Default) |   $(call KernelPackage/mac80211/Default) | ||||||
|   TITLE:=Prism54 Drivers |   TITLE:=Prism54 Drivers | ||||||
| @@ -1598,6 +1615,7 @@ config-$(call config_package,libertas-usb) += LIBERTAS LIBERTAS_USB | |||||||
| config-$(call config_package,libertas-spi) += LIBERTAS LIBERTAS_SPI | config-$(call config_package,libertas-spi) += LIBERTAS LIBERTAS_SPI | ||||||
| config-$(call config_package,mwl8k) += MWL8K | config-$(call config_package,mwl8k) += MWL8K | ||||||
| config-$(call config_package,mwifiex-pcie) += MWIFIEX MWIFIEX_PCIE | config-$(call config_package,mwifiex-pcie) += MWIFIEX MWIFIEX_PCIE | ||||||
|  | config-$(call config_package,mwifiex-sdio) += MWIFIEX MWIFIEX_SDIO | ||||||
| config-$(call config_package,rtl8180) += RTL8180 | config-$(call config_package,rtl8180) += RTL8180 | ||||||
| config-$(call config_package,rtl8187) += RTL8187 | config-$(call config_package,rtl8187) += RTL8187 | ||||||
| config-$(call config_package,wlcore) += WLCORE WLCORE_SDIO | config-$(call config_package,wlcore) += WLCORE WLCORE_SDIO | ||||||
| @@ -1793,6 +1811,7 @@ $(eval $(call KernelPackage,mac80211-hwsim)) | |||||||
| $(eval $(call KernelPackage,mt7601u)) | $(eval $(call KernelPackage,mt7601u)) | ||||||
| $(eval $(call KernelPackage,mwl8k)) | $(eval $(call KernelPackage,mwl8k)) | ||||||
| $(eval $(call KernelPackage,mwifiex-pcie)) | $(eval $(call KernelPackage,mwifiex-pcie)) | ||||||
|  | $(eval $(call KernelPackage,mwifiex-sdio)) | ||||||
| $(eval $(call KernelPackage,p54-common)) | $(eval $(call KernelPackage,p54-common)) | ||||||
| $(eval $(call KernelPackage,p54-pci)) | $(eval $(call KernelPackage,p54-pci)) | ||||||
| $(eval $(call KernelPackage,p54-usb)) | $(eval $(call KernelPackage,p54-usb)) | ||||||
|   | |||||||
| @@ -566,7 +566,7 @@ mac80211_setup_adhoc() { | |||||||
| 	[ -n "$mcast_rate" ] && wpa_supplicant_add_rate mcval "$mcast_rate" | 	[ -n "$mcast_rate" ] && wpa_supplicant_add_rate mcval "$mcast_rate" | ||||||
|  |  | ||||||
| 	iw dev "$ifname" ibss join "$ssid" $freq $ibss_htmode fixed-freq $bssid \ | 	iw dev "$ifname" ibss join "$ssid" $freq $ibss_htmode fixed-freq $bssid \ | ||||||
| 		${beacon_int:+beacon-interval $beacon_int} \ | 		beacon-interval $beacon_int \ | ||||||
| 		${brstr:+basic-rates $brstr} \ | 		${brstr:+basic-rates $brstr} \ | ||||||
| 		${mcval:+mcast-rate $mcval} \ | 		${mcval:+mcast-rate $mcval} \ | ||||||
| 		${keyspec:+keys $keyspec} | 		${keyspec:+keys $keyspec} | ||||||
| @@ -646,7 +646,9 @@ mac80211_setup_vif() { | |||||||
| 				esac | 				esac | ||||||
|  |  | ||||||
| 				freq="$(get_freq "$phy" "$channel")" | 				freq="$(get_freq "$phy" "$channel")" | ||||||
| 				iw dev "$ifname" mesh join "$mesh_id" freq $freq $mesh_htmode ${mcval:+mcast-rate $mcval} | 				iw dev "$ifname" mesh join "$mesh_id" freq $freq $mesh_htmode \ | ||||||
|  | 					${mcval:+mcast-rate $mcval} \ | ||||||
|  | 					beacon-interval $beacon_int | ||||||
| 			fi | 			fi | ||||||
|  |  | ||||||
| 			for var in $MP_CONFIG_INT $MP_CONFIG_BOOL $MP_CONFIG_STRING; do | 			for var in $MP_CONFIG_INT $MP_CONFIG_BOOL $MP_CONFIG_STRING; do | ||||||
| @@ -698,7 +700,7 @@ drv_mac80211_setup() { | |||||||
| 		country chanbw distance \ | 		country chanbw distance \ | ||||||
| 		txpower antenna_gain \ | 		txpower antenna_gain \ | ||||||
| 		rxantenna txantenna \ | 		rxantenna txantenna \ | ||||||
| 		frag rts beacon_int htmode | 		frag rts beacon_int:100 htmode | ||||||
| 	json_get_values basic_rate_list basic_rate | 	json_get_values basic_rate_list basic_rate | ||||||
| 	json_select .. | 	json_select .. | ||||||
|  |  | ||||||
| @@ -756,7 +758,7 @@ drv_mac80211_setup() { | |||||||
| 	for_each_interface "ap" mac80211_prepare_vif | 	for_each_interface "ap" mac80211_prepare_vif | ||||||
|  |  | ||||||
| 	[ -n "$hostapd_ctrl" ] && { | 	[ -n "$hostapd_ctrl" ] && { | ||||||
| 		/usr/sbin/hostapd -P /var/run/wifi-$phy.pid -B "$hostapd_conf_file" | 		/usr/sbin/hostapd -s -P /var/run/wifi-$phy.pid -B "$hostapd_conf_file" | ||||||
| 		ret="$?" | 		ret="$?" | ||||||
| 		wireless_add_process "$(cat /var/run/wifi-$phy.pid)" "/usr/sbin/hostapd" 1 | 		wireless_add_process "$(cat /var/run/wifi-$phy.pid)" "/usr/sbin/hostapd" 1 | ||||||
| 		[ "$ret" != 0 ] && { | 		[ "$ret" != 0 ] && { | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| --- a/kconf/conf.c | --- a/kconf/conf.c | ||||||
| +++ b/kconf/conf.c | +++ b/kconf/conf.c | ||||||
| @@ -593,40 +593,12 @@ int main(int ac, char **av) | @@ -594,40 +594,12 @@ int main(int ac, char **av) | ||||||
|  	case oldconfig: |  	case oldconfig: | ||||||
|  	case listnewconfig: |  	case listnewconfig: | ||||||
|  	case olddefconfig: |  	case olddefconfig: | ||||||
| @@ -44,7 +44,7 @@ | |||||||
|  		break; |  		break; | ||||||
| --- a/kconf/confdata.c | --- a/kconf/confdata.c | ||||||
| +++ b/kconf/confdata.c | +++ b/kconf/confdata.c | ||||||
| @@ -1169,6 +1169,8 @@ bool conf_set_all_new_symbols(enum conf_ | @@ -1170,6 +1170,8 @@ bool conf_set_all_new_symbols(enum conf_ | ||||||
|  	} |  	} | ||||||
|  	bool has_changed = false; |  	bool has_changed = false; | ||||||
|   |   | ||||||
| @@ -53,7 +53,7 @@ | |||||||
|  	for_all_symbols(i, sym) { |  	for_all_symbols(i, sym) { | ||||||
|  		if (sym_has_value(sym) || (sym->flags & SYMBOL_VALID)) |  		if (sym_has_value(sym) || (sym->flags & SYMBOL_VALID)) | ||||||
|  			continue; |  			continue; | ||||||
| @@ -1212,8 +1214,6 @@ bool conf_set_all_new_symbols(enum conf_ | @@ -1213,8 +1215,6 @@ bool conf_set_all_new_symbols(enum conf_ | ||||||
|   |   | ||||||
|  	} |  	} | ||||||
|   |   | ||||||
|   | |||||||
| @@ -1,11 +0,0 @@ | |||||||
| --- a/compat/Makefile |  | ||||||
| +++ b/compat/Makefile |  | ||||||
| @@ -35,8 +35,6 @@ compat-$(CPTCFG_KERNEL_4_6) += backport- |  | ||||||
|   |  | ||||||
|  compat-$(CPTCFG_BPAUTO_BUILD_CRYPTO_CCM) += crypto-ccm.o |  | ||||||
|  compat-$(CPTCFG_BPAUTO_CRYPTO_SKCIPHER) += crypto-skcipher.o |  | ||||||
| -skcipher-objs += crypto-skcipher.o |  | ||||||
| -obj-$(CPTCFG_BPAUTO_CRYPTO_SKCIPHER) += skcipher.o |  | ||||||
|  compat-$(CPTCFG_BPAUTO_BUILD_WANT_DEV_COREDUMP) += drivers-base-devcoredump.o |  | ||||||
|  compat-$(CPTCFG_BPAUTO_RHASHTABLE) += lib-rhashtable.o |  | ||||||
|  cordic-objs += lib-cordic.o |  | ||||||
| @@ -0,0 +1,28 @@ | |||||||
|  | --- a/backport-include/linux/kconfig.h | ||||||
|  | +++ b/backport-include/linux/kconfig.h | ||||||
|  | @@ -5,6 +5,8 @@ | ||||||
|  |  #include_next <linux/kconfig.h> | ||||||
|  |  #endif | ||||||
|  |   | ||||||
|  | +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0) | ||||||
|  | + | ||||||
|  |  #ifndef __ARG_PLACEHOLDER_1 | ||||||
|  |  #define __ARG_PLACEHOLDER_1 0, | ||||||
|  |  #define config_enabled(cfg) _config_enabled(cfg) | ||||||
|  | @@ -16,6 +18,7 @@ | ||||||
|  |   * 3.1 - 3.3 had a broken version of this, so undef | ||||||
|  |   * (they didn't have __ARG_PLACEHOLDER_1) | ||||||
|  |   */ | ||||||
|  | + | ||||||
|  |  #undef IS_ENABLED | ||||||
|  |  #define IS_ENABLED(option) \ | ||||||
|  |          (config_enabled(option) || config_enabled(option##_MODULE)) | ||||||
|  | @@ -24,6 +27,8 @@ | ||||||
|  |  #undef IS_BUILTIN | ||||||
|  |  #define IS_BUILTIN(option) config_enabled(option) | ||||||
|  |   | ||||||
|  | +#endif | ||||||
|  | + | ||||||
|  |  #ifndef IS_REACHABLE | ||||||
|  |  /* | ||||||
|  |   * IS_REACHABLE(CONFIG_FOO) evaluates to 1 if the currently compiled | ||||||
| @@ -1,22 +0,0 @@ | |||||||
| --- a/backport-include/linux/skbuff.h |  | ||||||
| +++ b/backport-include/linux/skbuff.h |  | ||||||
| @@ -305,6 +305,19 @@ static inline void skb_free_frag(void *d |  | ||||||
|  { |  | ||||||
|  	put_page(virt_to_head_page(data)); |  | ||||||
|  } |  | ||||||
| + |  | ||||||
| +#include <net/flow_keys.h> |  | ||||||
| +#include <linux/jhash.h> |  | ||||||
| + |  | ||||||
| +static inline u32 skb_get_hash_perturb(struct sk_buff *skb, u32 key) |  | ||||||
| +{ |  | ||||||
| +	struct flow_keys keys; |  | ||||||
| + |  | ||||||
| +	skb_flow_dissect(skb, &keys); |  | ||||||
| +	return jhash_3words((__force u32)keys.dst, |  | ||||||
| +			    (__force u32)keys.src ^ keys.ip_proto, |  | ||||||
| +			    (__force u32)keys.ports, key); |  | ||||||
| +} |  | ||||||
|  #endif |  | ||||||
|   |  | ||||||
|  #endif /* __BACKPORT_SKBUFF_H */ |  | ||||||
							
								
								
									
										152
									
								
								package/kernel/mac80211/patches/005-revert-devcoredump.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										152
									
								
								package/kernel/mac80211/patches/005-revert-devcoredump.patch
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,152 @@ | |||||||
|  | --- a/compat/Makefile | ||||||
|  | +++ b/compat/Makefile | ||||||
|  | @@ -35,8 +35,6 @@ compat-$(CPTCFG_KERNEL_4_6) += backport- | ||||||
|  |   | ||||||
|  |  compat-$(CPTCFG_BPAUTO_BUILD_CRYPTO_CCM) += crypto-ccm.o | ||||||
|  |  compat-$(CPTCFG_BPAUTO_CRYPTO_SKCIPHER) += crypto-skcipher.o | ||||||
|  | -skcipher-objs += crypto-skcipher.o | ||||||
|  | -obj-$(CPTCFG_BPAUTO_CRYPTO_SKCIPHER) += skcipher.o | ||||||
|  |  compat-$(CPTCFG_BPAUTO_BUILD_WANT_DEV_COREDUMP) += drivers-base-devcoredump.o | ||||||
|  |  compat-$(CPTCFG_BPAUTO_RHASHTABLE) += lib-rhashtable.o | ||||||
|  |  cordic-objs += lib-cordic.o | ||||||
|  | --- a/compat/drivers-base-devcoredump.c | ||||||
|  | +++ b/compat/drivers-base-devcoredump.c | ||||||
|  | @@ -31,6 +31,7 @@ | ||||||
|  |  #include <linux/slab.h> | ||||||
|  |  #include <linux/fs.h> | ||||||
|  |  #include <linux/workqueue.h> | ||||||
|  | +#include "backports.h" | ||||||
|  |   | ||||||
|  |  static struct class devcd_class; | ||||||
|  |   | ||||||
|  | @@ -40,6 +41,10 @@ static bool devcd_disabled; | ||||||
|  |  /* if data isn't read by userspace after 5 minutes then delete it */ | ||||||
|  |  #define DEVCD_TIMEOUT	(HZ * 60 * 5) | ||||||
|  |   | ||||||
|  | +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0) | ||||||
|  | +static struct bin_attribute devcd_attr_data; | ||||||
|  | +#endif | ||||||
|  | + | ||||||
|  |  struct devcd_entry { | ||||||
|  |  	struct device devcd_dev; | ||||||
|  |  	void *data; | ||||||
|  | @@ -69,8 +74,7 @@ static void devcd_dev_release(struct dev | ||||||
|  |  	 * a struct device to know when it goes away? | ||||||
|  |  	 */ | ||||||
|  |  	if (devcd->failing_dev->kobj.sd) | ||||||
|  | -		sysfs_delete_link(&devcd->failing_dev->kobj, &dev->kobj, | ||||||
|  | -				  "devcoredump"); | ||||||
|  | +		sysfs_remove_link(&devcd->failing_dev->kobj, "devcoredump"); | ||||||
|  |   | ||||||
|  |  	put_device(devcd->failing_dev); | ||||||
|  |  	kfree(devcd); | ||||||
|  | @@ -82,6 +86,9 @@ static void devcd_del(struct work_struct | ||||||
|  |   | ||||||
|  |  	devcd = container_of(wk, struct devcd_entry, del_wk.work); | ||||||
|  |   | ||||||
|  | +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0) | ||||||
|  | +	device_remove_bin_file(&devcd->devcd_dev, &devcd_attr_data); | ||||||
|  | +#endif | ||||||
|  |  	device_del(&devcd->devcd_dev); | ||||||
|  |  	put_device(&devcd->devcd_dev); | ||||||
|  |  } | ||||||
|  | @@ -115,6 +122,7 @@ static struct bin_attribute devcd_attr_d | ||||||
|  |  	.write = devcd_data_write, | ||||||
|  |  }; | ||||||
|  |   | ||||||
|  | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0) | ||||||
|  |  static struct bin_attribute *devcd_dev_bin_attrs[] = { | ||||||
|  |  	&devcd_attr_data, NULL, | ||||||
|  |  }; | ||||||
|  | @@ -126,6 +134,7 @@ static const struct attribute_group devc | ||||||
|  |  static const struct attribute_group *devcd_dev_groups[] = { | ||||||
|  |  	&devcd_dev_group, NULL, | ||||||
|  |  }; | ||||||
|  | +#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0) */ | ||||||
|  |   | ||||||
|  |  static int devcd_free(struct device *dev, void *data) | ||||||
|  |  { | ||||||
|  | @@ -160,18 +169,11 @@ static ssize_t disabled_store(struct cla | ||||||
|  |   | ||||||
|  |  	return count; | ||||||
|  |  } | ||||||
|  | -static CLASS_ATTR_RW(disabled); | ||||||
|  |   | ||||||
|  | -static struct attribute *devcd_class_attrs[] = { | ||||||
|  | -	&class_attr_disabled.attr, | ||||||
|  | -	NULL, | ||||||
|  | +static struct class_attribute devcd_class_attrs[] = { | ||||||
|  | +	__ATTR_RW(disabled), | ||||||
|  | +	__ATTR_NULL | ||||||
|  |  }; | ||||||
|  | -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0) | ||||||
|  | -ATTRIBUTE_GROUPS(devcd_class); | ||||||
|  | -#else | ||||||
|  | -#define BP_ATTR_GRP_STRUCT device_attribute | ||||||
|  | -ATTRIBUTE_GROUPS_BACKPORT(devcd_class); | ||||||
|  | -#endif | ||||||
|  |   | ||||||
|  |  static struct class devcd_class = { | ||||||
|  |  	.name		= "devcoredump", | ||||||
|  | @@ -179,10 +181,8 @@ static struct class devcd_class = { | ||||||
|  |  	.dev_release	= devcd_dev_release, | ||||||
|  |  #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0) | ||||||
|  |  	.dev_groups	= devcd_dev_groups, | ||||||
|  | -#else | ||||||
|  | -	.dev_attrs = devcd_class_dev_attrs, | ||||||
|  |  #endif | ||||||
|  | -	.class_groups	= devcd_class_groups, | ||||||
|  | +	.class_attrs	= devcd_class_attrs, | ||||||
|  |  }; | ||||||
|  |   | ||||||
|  |  static ssize_t devcd_readv(char *buffer, loff_t offset, size_t count, | ||||||
|  | @@ -325,6 +325,11 @@ void dev_coredumpm(struct device *dev, s | ||||||
|  |  	if (device_add(&devcd->devcd_dev)) | ||||||
|  |  		goto put_device; | ||||||
|  |   | ||||||
|  | +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0) | ||||||
|  | +	if (device_create_bin_file(&devcd->devcd_dev, &devcd_attr_data)) | ||||||
|  | +		goto put_device; | ||||||
|  | +#endif | ||||||
|  | + | ||||||
|  |  	if (sysfs_create_link(&devcd->devcd_dev.kobj, &dev->kobj, | ||||||
|  |  			      "failing_device")) | ||||||
|  |  		/* nothing - symlink will be missing */; | ||||||
|  | @@ -367,16 +372,13 @@ void dev_coredumpsg(struct device *dev, | ||||||
|  |  } | ||||||
|  |  EXPORT_SYMBOL_GPL(dev_coredumpsg); | ||||||
|  |   | ||||||
|  | -static int __init devcoredump_init(void) | ||||||
|  | +int __init devcoredump_init(void) | ||||||
|  |  { | ||||||
|  | -	init_devcd_class_attrs(); | ||||||
|  |  	return class_register(&devcd_class); | ||||||
|  |  } | ||||||
|  | -__initcall(devcoredump_init); | ||||||
|  |   | ||||||
|  | -static void __exit devcoredump_exit(void) | ||||||
|  | +void __exit devcoredump_exit(void) | ||||||
|  |  { | ||||||
|  |  	class_for_each_device(&devcd_class, NULL, NULL, devcd_free); | ||||||
|  |  	class_unregister(&devcd_class); | ||||||
|  |  } | ||||||
|  | -__exitcall(devcoredump_exit); | ||||||
|  | --- a/include/linux/backport-devcoredump.h | ||||||
|  | +++ b/include/linux/backport-devcoredump.h | ||||||
|  | @@ -66,7 +66,7 @@ static inline void _devcd_free_sgtable(s | ||||||
|  |  } | ||||||
|  |   | ||||||
|  |   | ||||||
|  | -#ifdef CONFIG_DEV_COREDUMP | ||||||
|  | +#ifdef CPTCFG_BPAUTO_WANT_DEV_COREDUMP | ||||||
|  |  void dev_coredumpv(struct device *dev, void *data, size_t datalen, | ||||||
|  |  		   gfp_t gfp); | ||||||
|  |   | ||||||
|  | @@ -100,6 +100,6 @@ static inline void dev_coredumpsg(struct | ||||||
|  |  { | ||||||
|  |  	_devcd_free_sgtable(table); | ||||||
|  |  } | ||||||
|  | -#endif /* CONFIG_DEV_COREDUMP */ | ||||||
|  | +#endif /* CPTCFG_BPAUTO_WANT_DEV_COREDUMP */ | ||||||
|  |   | ||||||
|  |  #endif /* __DEVCOREDUMP_H */ | ||||||
| @@ -0,0 +1,20 @@ | |||||||
|  | --- a/drivers/net/wireless/ralink/rt2x00/rt2800usb.c | ||||||
|  | +++ b/drivers/net/wireless/ralink/rt2x00/rt2800usb.c | ||||||
|  | @@ -177,7 +177,7 @@ static bool rt2800usb_tx_sta_fifo_read_c | ||||||
|  |  	if (rt2800usb_txstatus_pending(rt2x00dev)) { | ||||||
|  |  		/* Read register after 1 ms */ | ||||||
|  |  		hrtimer_start(&rt2x00dev->txstatus_timer, | ||||||
|  | -			      TXSTATUS_READ_INTERVAL, | ||||||
|  | +			      ktime_set(0, TXSTATUS_READ_INTERVAL), | ||||||
|  |  			      HRTIMER_MODE_REL); | ||||||
|  |  		return false; | ||||||
|  |  	} | ||||||
|  | @@ -204,7 +204,7 @@ static void rt2800usb_async_read_tx_stat | ||||||
|  |   | ||||||
|  |  	/* Read TX_STA_FIFO register after 2 ms */ | ||||||
|  |  	hrtimer_start(&rt2x00dev->txstatus_timer, | ||||||
|  | -		      2 * TXSTATUS_READ_INTERVAL, | ||||||
|  | +		      ktime_set(0, 2*TXSTATUS_READ_INTERVAL), | ||||||
|  |  		      HRTIMER_MODE_REL); | ||||||
|  |  } | ||||||
|  |   | ||||||
| @@ -0,0 +1,266 @@ | |||||||
|  | --- a/net/wireless/nl80211.c | ||||||
|  | +++ b/net/wireless/nl80211.c | ||||||
|  | @@ -32,8 +32,22 @@ static int nl80211_crypto_settings(struc | ||||||
|  |  				   struct cfg80211_crypto_settings *settings, | ||||||
|  |  				   int cipher_limit); | ||||||
|  |   | ||||||
|  | +static int nl80211_pre_doit(const struct genl_ops *ops, struct sk_buff *skb, | ||||||
|  | +			    struct genl_info *info); | ||||||
|  | +static void nl80211_post_doit(const struct genl_ops *ops, struct sk_buff *skb, | ||||||
|  | +			      struct genl_info *info); | ||||||
|  | + | ||||||
|  |  /* the netlink family */ | ||||||
|  | -static struct genl_family nl80211_fam; | ||||||
|  | +static struct genl_family nl80211_fam = { | ||||||
|  | +	.id = GENL_ID_GENERATE,		/* don't bother with a hardcoded ID */ | ||||||
|  | +	.name = NL80211_GENL_NAME,	/* have users key off the name instead */ | ||||||
|  | +	.hdrsize = 0,			/* no private header */ | ||||||
|  | +	.version = 1,			/* no particular meaning now */ | ||||||
|  | +	.maxattr = NL80211_ATTR_MAX, | ||||||
|  | +	.netnsok = true, | ||||||
|  | +	.pre_doit = nl80211_pre_doit, | ||||||
|  | +	.post_doit = nl80211_post_doit, | ||||||
|  | +}; | ||||||
|  |   | ||||||
|  |  /* multicast groups */ | ||||||
|  |  enum nl80211_multicast_groups { | ||||||
|  | @@ -549,14 +563,13 @@ static int nl80211_prepare_wdev_dump(str | ||||||
|  |   | ||||||
|  |  	if (!cb->args[0]) { | ||||||
|  |  		err = nlmsg_parse(cb->nlh, GENL_HDRLEN + nl80211_fam.hdrsize, | ||||||
|  | -				  genl_family_attrbuf(&nl80211_fam), | ||||||
|  | -				  nl80211_fam.maxattr, nl80211_policy); | ||||||
|  | +				  nl80211_fam.attrbuf, nl80211_fam.maxattr, | ||||||
|  | +				  nl80211_policy); | ||||||
|  |  		if (err) | ||||||
|  |  			goto out_unlock; | ||||||
|  |   | ||||||
|  | -		*wdev = __cfg80211_wdev_from_attrs( | ||||||
|  | -					sock_net(skb->sk), | ||||||
|  | -					genl_family_attrbuf(&nl80211_fam)); | ||||||
|  | +		*wdev = __cfg80211_wdev_from_attrs(sock_net(skb->sk), | ||||||
|  | +						   nl80211_fam.attrbuf); | ||||||
|  |  		if (IS_ERR(*wdev)) { | ||||||
|  |  			err = PTR_ERR(*wdev); | ||||||
|  |  			goto out_unlock; | ||||||
|  | @@ -1903,7 +1916,7 @@ static int nl80211_dump_wiphy_parse(stru | ||||||
|  |  				    struct netlink_callback *cb, | ||||||
|  |  				    struct nl80211_dump_wiphy_state *state) | ||||||
|  |  { | ||||||
|  | -	struct nlattr **tb = genl_family_attrbuf(&nl80211_fam); | ||||||
|  | +	struct nlattr **tb = nl80211_fam.attrbuf; | ||||||
|  |  	int ret = nlmsg_parse(cb->nlh, GENL_HDRLEN + nl80211_fam.hdrsize, | ||||||
|  |  			      tb, nl80211_fam.maxattr, nl80211_policy); | ||||||
|  |  	/* ignore parse errors for backward compatibility */ | ||||||
|  | @@ -7733,7 +7746,6 @@ static int nl80211_send_survey(struct sk | ||||||
|  |   | ||||||
|  |  static int nl80211_dump_survey(struct sk_buff *skb, struct netlink_callback *cb) | ||||||
|  |  { | ||||||
|  | -	struct nlattr **attrbuf = genl_family_attrbuf(&nl80211_fam); | ||||||
|  |  	struct survey_info survey; | ||||||
|  |  	struct cfg80211_registered_device *rdev; | ||||||
|  |  	struct wireless_dev *wdev; | ||||||
|  | @@ -7746,7 +7758,7 @@ static int nl80211_dump_survey(struct sk | ||||||
|  |  		return res; | ||||||
|  |   | ||||||
|  |  	/* prepare_wdev_dump parsed the attributes */ | ||||||
|  | -	radio_stats = attrbuf[NL80211_ATTR_SURVEY_RADIO_STATS]; | ||||||
|  | +	radio_stats = nl80211_fam.attrbuf[NL80211_ATTR_SURVEY_RADIO_STATS]; | ||||||
|  |   | ||||||
|  |  	if (!wdev->netdev) { | ||||||
|  |  		res = -EINVAL; | ||||||
|  | @@ -8594,14 +8606,14 @@ static int nl80211_testmode_dump(struct | ||||||
|  |  		 */ | ||||||
|  |  		phy_idx = cb->args[0] - 1; | ||||||
|  |  	} else { | ||||||
|  | -		struct nlattr **attrbuf = genl_family_attrbuf(&nl80211_fam); | ||||||
|  | - | ||||||
|  |  		err = nlmsg_parse(cb->nlh, GENL_HDRLEN + nl80211_fam.hdrsize, | ||||||
|  | -				  attrbuf, nl80211_fam.maxattr, nl80211_policy); | ||||||
|  | +				  nl80211_fam.attrbuf, nl80211_fam.maxattr, | ||||||
|  | +				  nl80211_policy); | ||||||
|  |  		if (err) | ||||||
|  |  			goto out_err; | ||||||
|  |   | ||||||
|  | -		rdev = __cfg80211_rdev_from_attrs(sock_net(skb->sk), attrbuf); | ||||||
|  | +		rdev = __cfg80211_rdev_from_attrs(sock_net(skb->sk), | ||||||
|  | +						  nl80211_fam.attrbuf); | ||||||
|  |  		if (IS_ERR(rdev)) { | ||||||
|  |  			err = PTR_ERR(rdev); | ||||||
|  |  			goto out_err; | ||||||
|  | @@ -8609,8 +8621,9 @@ static int nl80211_testmode_dump(struct | ||||||
|  |  		phy_idx = rdev->wiphy_idx; | ||||||
|  |  		rdev = NULL; | ||||||
|  |   | ||||||
|  | -		if (attrbuf[NL80211_ATTR_TESTDATA]) | ||||||
|  | -			cb->args[1] = (long)attrbuf[NL80211_ATTR_TESTDATA]; | ||||||
|  | +		if (nl80211_fam.attrbuf[NL80211_ATTR_TESTDATA]) | ||||||
|  | +			cb->args[1] = | ||||||
|  | +				(long)nl80211_fam.attrbuf[NL80211_ATTR_TESTDATA]; | ||||||
|  |  	} | ||||||
|  |   | ||||||
|  |  	if (cb->args[1]) { | ||||||
|  | @@ -10814,7 +10827,8 @@ static int handle_nan_filter(struct nlat | ||||||
|  |   | ||||||
|  |  	i = 0; | ||||||
|  |  	nla_for_each_nested(attr, attr_filter, rem) { | ||||||
|  | -		filter[i].filter = nla_memdup(attr, GFP_KERNEL); | ||||||
|  | +		filter[i].filter = kmemdup(nla_data(attr), nla_len(attr), | ||||||
|  | +					   GFP_KERNEL); | ||||||
|  |  		filter[i].len = nla_len(attr); | ||||||
|  |  		i++; | ||||||
|  |  	} | ||||||
|  | @@ -11450,7 +11464,6 @@ static int nl80211_prepare_vendor_dump(s | ||||||
|  |  				       struct cfg80211_registered_device **rdev, | ||||||
|  |  				       struct wireless_dev **wdev) | ||||||
|  |  { | ||||||
|  | -	struct nlattr **attrbuf = genl_family_attrbuf(&nl80211_fam); | ||||||
|  |  	u32 vid, subcmd; | ||||||
|  |  	unsigned int i; | ||||||
|  |  	int vcmd_idx = -1; | ||||||
|  | @@ -11486,28 +11499,31 @@ static int nl80211_prepare_vendor_dump(s | ||||||
|  |  	} | ||||||
|  |   | ||||||
|  |  	err = nlmsg_parse(cb->nlh, GENL_HDRLEN + nl80211_fam.hdrsize, | ||||||
|  | -			  attrbuf, nl80211_fam.maxattr, nl80211_policy); | ||||||
|  | +			  nl80211_fam.attrbuf, nl80211_fam.maxattr, | ||||||
|  | +			  nl80211_policy); | ||||||
|  |  	if (err) | ||||||
|  |  		goto out_unlock; | ||||||
|  |   | ||||||
|  | -	if (!attrbuf[NL80211_ATTR_VENDOR_ID] || | ||||||
|  | -	    !attrbuf[NL80211_ATTR_VENDOR_SUBCMD]) { | ||||||
|  | +	if (!nl80211_fam.attrbuf[NL80211_ATTR_VENDOR_ID] || | ||||||
|  | +	    !nl80211_fam.attrbuf[NL80211_ATTR_VENDOR_SUBCMD]) { | ||||||
|  |  		err = -EINVAL; | ||||||
|  |  		goto out_unlock; | ||||||
|  |  	} | ||||||
|  |   | ||||||
|  | -	*wdev = __cfg80211_wdev_from_attrs(sock_net(skb->sk), attrbuf); | ||||||
|  | +	*wdev = __cfg80211_wdev_from_attrs(sock_net(skb->sk), | ||||||
|  | +					   nl80211_fam.attrbuf); | ||||||
|  |  	if (IS_ERR(*wdev)) | ||||||
|  |  		*wdev = NULL; | ||||||
|  |   | ||||||
|  | -	*rdev = __cfg80211_rdev_from_attrs(sock_net(skb->sk), attrbuf); | ||||||
|  | +	*rdev = __cfg80211_rdev_from_attrs(sock_net(skb->sk), | ||||||
|  | +					   nl80211_fam.attrbuf); | ||||||
|  |  	if (IS_ERR(*rdev)) { | ||||||
|  |  		err = PTR_ERR(*rdev); | ||||||
|  |  		goto out_unlock; | ||||||
|  |  	} | ||||||
|  |   | ||||||
|  | -	vid = nla_get_u32(attrbuf[NL80211_ATTR_VENDOR_ID]); | ||||||
|  | -	subcmd = nla_get_u32(attrbuf[NL80211_ATTR_VENDOR_SUBCMD]); | ||||||
|  | +	vid = nla_get_u32(nl80211_fam.attrbuf[NL80211_ATTR_VENDOR_ID]); | ||||||
|  | +	subcmd = nla_get_u32(nl80211_fam.attrbuf[NL80211_ATTR_VENDOR_SUBCMD]); | ||||||
|  |   | ||||||
|  |  	for (i = 0; i < (*rdev)->wiphy.n_vendor_commands; i++) { | ||||||
|  |  		const struct wiphy_vendor_command *vcmd; | ||||||
|  | @@ -11531,9 +11547,9 @@ static int nl80211_prepare_vendor_dump(s | ||||||
|  |  		goto out_unlock; | ||||||
|  |  	} | ||||||
|  |   | ||||||
|  | -	if (attrbuf[NL80211_ATTR_VENDOR_DATA]) { | ||||||
|  | -		data = nla_data(attrbuf[NL80211_ATTR_VENDOR_DATA]); | ||||||
|  | -		data_len = nla_len(attrbuf[NL80211_ATTR_VENDOR_DATA]); | ||||||
|  | +	if (nl80211_fam.attrbuf[NL80211_ATTR_VENDOR_DATA]) { | ||||||
|  | +		data = nla_data(nl80211_fam.attrbuf[NL80211_ATTR_VENDOR_DATA]); | ||||||
|  | +		data_len = nla_len(nl80211_fam.attrbuf[NL80211_ATTR_VENDOR_DATA]); | ||||||
|  |  	} | ||||||
|  |   | ||||||
|  |  	/* 0 is the first index - add 1 to parse only once */ | ||||||
|  | @@ -12795,21 +12811,6 @@ static __genl_const struct genl_ops nl80 | ||||||
|  |  	}, | ||||||
|  |  }; | ||||||
|  |   | ||||||
|  | -static struct genl_family nl80211_fam __ro_after_init = { | ||||||
|  | -	.name = NL80211_GENL_NAME,	/* have users key off the name instead */ | ||||||
|  | -	.hdrsize = 0,			/* no private header */ | ||||||
|  | -	.version = 1,			/* no particular meaning now */ | ||||||
|  | -	.maxattr = NL80211_ATTR_MAX, | ||||||
|  | -	.netnsok = true, | ||||||
|  | -	.pre_doit = nl80211_pre_doit, | ||||||
|  | -	.post_doit = nl80211_post_doit, | ||||||
|  | -	.module = THIS_MODULE, | ||||||
|  | -	.ops = nl80211_ops, | ||||||
|  | -	.n_ops = ARRAY_SIZE(nl80211_ops), | ||||||
|  | -	.mcgrps = nl80211_mcgrps, | ||||||
|  | -	.n_mcgrps = ARRAY_SIZE(nl80211_mcgrps), | ||||||
|  | -}; | ||||||
|  | - | ||||||
|  |  /* notification functions */ | ||||||
|  |   | ||||||
|  |  void nl80211_notify_wiphy(struct cfg80211_registered_device *rdev, | ||||||
|  | @@ -14759,11 +14760,12 @@ void nl80211_send_ap_stopped(struct wire | ||||||
|  |   | ||||||
|  |  /* initialisation/exit functions */ | ||||||
|  |   | ||||||
|  | -int __init nl80211_init(void) | ||||||
|  | +int nl80211_init(void) | ||||||
|  |  { | ||||||
|  |  	int err; | ||||||
|  |   | ||||||
|  | -	err = genl_register_family(&nl80211_fam); | ||||||
|  | +	err = genl_register_family_with_ops_groups(&nl80211_fam, nl80211_ops, | ||||||
|  | +						   nl80211_mcgrps); | ||||||
|  |  	if (err) | ||||||
|  |  		return err; | ||||||
|  |   | ||||||
|  | --- a/drivers/net/wireless/mac80211_hwsim.c | ||||||
|  | +++ b/drivers/net/wireless/mac80211_hwsim.c | ||||||
|  | @@ -587,8 +587,15 @@ struct hwsim_radiotap_ack_hdr { | ||||||
|  |  	__le16 rt_chbitmask; | ||||||
|  |  } __packed; | ||||||
|  |   | ||||||
|  | -/* MAC80211_HWSIM netlink family */ | ||||||
|  | -static struct genl_family hwsim_genl_family; | ||||||
|  | +/* MAC80211_HWSIM netlinf family */ | ||||||
|  | +static struct genl_family hwsim_genl_family = { | ||||||
|  | +	.id = GENL_ID_GENERATE, | ||||||
|  | +	.hdrsize = 0, | ||||||
|  | +	.name = "MAC80211_HWSIM", | ||||||
|  | +	.version = 1, | ||||||
|  | +	.maxattr = HWSIM_ATTR_MAX, | ||||||
|  | +	.netnsok = true, | ||||||
|  | +}; | ||||||
|  |   | ||||||
|  |  enum hwsim_multicast_groups { | ||||||
|  |  	HWSIM_MCGRP_CONFIG, | ||||||
|  | @@ -3250,18 +3257,6 @@ static __genl_const struct genl_ops hwsi | ||||||
|  |  	}, | ||||||
|  |  }; | ||||||
|  |   | ||||||
|  | -static struct genl_family hwsim_genl_family __ro_after_init = { | ||||||
|  | -	.name = "MAC80211_HWSIM", | ||||||
|  | -	.version = 1, | ||||||
|  | -	.maxattr = HWSIM_ATTR_MAX, | ||||||
|  | -	.netnsok = true, | ||||||
|  | -	.module = THIS_MODULE, | ||||||
|  | -	.ops = hwsim_ops, | ||||||
|  | -	.n_ops = ARRAY_SIZE(hwsim_ops), | ||||||
|  | -	.mcgrps = hwsim_mcgrps, | ||||||
|  | -	.n_mcgrps = ARRAY_SIZE(hwsim_mcgrps), | ||||||
|  | -}; | ||||||
|  | - | ||||||
|  |  static void destroy_radio(struct work_struct *work) | ||||||
|  |  { | ||||||
|  |  	struct mac80211_hwsim_data *data = | ||||||
|  | @@ -3309,13 +3304,15 @@ static struct notifier_block hwsim_netli | ||||||
|  |  	.notifier_call = mac80211_hwsim_netlink_notify, | ||||||
|  |  }; | ||||||
|  |   | ||||||
|  | -static int __init hwsim_init_netlink(void) | ||||||
|  | +static int hwsim_init_netlink(void) | ||||||
|  |  { | ||||||
|  |  	int rc; | ||||||
|  |   | ||||||
|  |  	printk(KERN_INFO "mac80211_hwsim: initializing netlink\n"); | ||||||
|  |   | ||||||
|  | -	rc = genl_register_family(&hwsim_genl_family); | ||||||
|  | +	rc = genl_register_family_with_ops_groups(&hwsim_genl_family, | ||||||
|  | +						  hwsim_ops, | ||||||
|  | +						  hwsim_mcgrps); | ||||||
|  |  	if (rc) | ||||||
|  |  		goto failure; | ||||||
|  |   | ||||||
| @@ -0,0 +1,20 @@ | |||||||
|  | --- a/net/mac80211/iface.c | ||||||
|  | +++ b/net/mac80211/iface.c | ||||||
|  | @@ -1133,7 +1133,7 @@ static u16 ieee80211_netdev_select_queue | ||||||
|  |  	return ieee80211_select_queue(IEEE80211_DEV_TO_SUB_IF(dev), skb); | ||||||
|  |  } | ||||||
|  |   | ||||||
|  | -static void | ||||||
|  | +static struct rtnl_link_stats64 * | ||||||
|  |  ieee80211_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) | ||||||
|  |  { | ||||||
|  |  	int i; | ||||||
|  | @@ -1158,6 +1158,8 @@ ieee80211_get_stats64(struct net_device | ||||||
|  |  		stats->rx_bytes   += rx_bytes; | ||||||
|  |  		stats->tx_bytes   += tx_bytes; | ||||||
|  |  	} | ||||||
|  | + | ||||||
|  | +	return stats; | ||||||
|  |  } | ||||||
|  |   | ||||||
|  |  static const struct net_device_ops ieee80211_dataif_ops = { | ||||||
							
								
								
									
										338
									
								
								package/kernel/mac80211/patches/009-revert-mtu-changes.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										338
									
								
								package/kernel/mac80211/patches/009-revert-mtu-changes.patch
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,338 @@ | |||||||
|  | --- a/net/mac80211/iface.c | ||||||
|  | +++ b/net/mac80211/iface.c | ||||||
|  | @@ -151,6 +151,15 @@ void ieee80211_recalc_idle(struct ieee80 | ||||||
|  |  		ieee80211_hw_config(local, change); | ||||||
|  |  } | ||||||
|  |   | ||||||
|  | +static int ieee80211_change_mtu(struct net_device *dev, int new_mtu) | ||||||
|  | +{ | ||||||
|  | +	if (new_mtu < 256 || new_mtu > IEEE80211_MAX_DATA_LEN) | ||||||
|  | +		return -EINVAL; | ||||||
|  | + | ||||||
|  | +	dev->mtu = new_mtu; | ||||||
|  | +	return 0; | ||||||
|  | +} | ||||||
|  | + | ||||||
|  |  static int ieee80211_verify_mac(struct ieee80211_sub_if_data *sdata, u8 *addr, | ||||||
|  |  				bool check_dup) | ||||||
|  |  { | ||||||
|  | @@ -1168,6 +1177,7 @@ static const struct net_device_ops ieee8 | ||||||
|  |  	.ndo_uninit		= ieee80211_uninit, | ||||||
|  |  	.ndo_start_xmit		= ieee80211_subif_start_xmit, | ||||||
|  |  	.ndo_set_rx_mode	= ieee80211_set_multicast_list, | ||||||
|  | +	.ndo_change_mtu 	= ieee80211_change_mtu, | ||||||
|  |  	.ndo_set_mac_address 	= ieee80211_change_mac, | ||||||
|  |  	.ndo_select_queue	= ieee80211_netdev_select_queue, | ||||||
|  |  	.ndo_get_stats64	= ieee80211_get_stats64, | ||||||
|  | @@ -1211,6 +1221,7 @@ static const struct net_device_ops ieee8 | ||||||
|  |  	.ndo_uninit		= ieee80211_uninit, | ||||||
|  |  	.ndo_start_xmit		= ieee80211_monitor_start_xmit, | ||||||
|  |  	.ndo_set_rx_mode	= ieee80211_set_multicast_list, | ||||||
|  | +	.ndo_change_mtu 	= ieee80211_change_mtu, | ||||||
|  |  	.ndo_set_mac_address 	= ieee80211_change_mac, | ||||||
|  |  	.ndo_select_queue	= ieee80211_monitor_select_queue, | ||||||
|  |  	.ndo_get_stats64	= ieee80211_get_stats64, | ||||||
|  | @@ -1919,10 +1930,6 @@ int ieee80211_if_add(struct ieee80211_lo | ||||||
|  |   | ||||||
|  |  		netdev_set_default_ethtool_ops(ndev, &ieee80211_ethtool_ops); | ||||||
|  |   | ||||||
|  | -		/* MTU range: 256 - 2304 */ | ||||||
|  | -		ndev->min_mtu = 256; | ||||||
|  | -		ndev->max_mtu = IEEE80211_MAX_DATA_LEN; | ||||||
|  | - | ||||||
|  |  		ret = register_netdevice(ndev); | ||||||
|  |  		if (ret) { | ||||||
|  |  			ieee80211_if_free(ndev); | ||||||
|  | --- a/drivers/net/wireless/ath/wil6210/netdev.c | ||||||
|  | +++ b/drivers/net/wireless/ath/wil6210/netdev.c | ||||||
|  | @@ -42,6 +42,21 @@ static int wil_stop(struct net_device *n | ||||||
|  |  	return wil_down(wil); | ||||||
|  |  } | ||||||
|  |   | ||||||
|  | +static int wil_change_mtu(struct net_device *ndev, int new_mtu) | ||||||
|  | +{ | ||||||
|  | +	struct wil6210_priv *wil = ndev_to_wil(ndev); | ||||||
|  | + | ||||||
|  | +	if (new_mtu < 68 || new_mtu > mtu_max) { | ||||||
|  | +		wil_err(wil, "invalid MTU %d\n", new_mtu); | ||||||
|  | +		return -EINVAL; | ||||||
|  | +	} | ||||||
|  | + | ||||||
|  | +	wil_dbg_misc(wil, "change MTU %d -> %d\n", ndev->mtu, new_mtu); | ||||||
|  | +	ndev->mtu = new_mtu; | ||||||
|  | + | ||||||
|  | +	return 0; | ||||||
|  | +} | ||||||
|  | + | ||||||
|  |  static int wil_do_ioctl(struct net_device *ndev, struct ifreq *ifr, int cmd) | ||||||
|  |  { | ||||||
|  |  	struct wil6210_priv *wil = ndev_to_wil(ndev); | ||||||
|  | @@ -55,6 +70,7 @@ static const struct net_device_ops wil_n | ||||||
|  |  	.ndo_start_xmit		= wil_start_xmit, | ||||||
|  |  	.ndo_set_mac_address	= eth_mac_addr, | ||||||
|  |  	.ndo_validate_addr	= eth_validate_addr, | ||||||
|  | +	.ndo_change_mtu		= wil_change_mtu, | ||||||
|  |  	.ndo_do_ioctl		= wil_do_ioctl, | ||||||
|  |  }; | ||||||
|  |   | ||||||
|  | @@ -111,7 +127,6 @@ static int wil6210_netdev_poll_tx(struct | ||||||
|  |  static void wil_dev_setup(struct net_device *dev) | ||||||
|  |  { | ||||||
|  |  	ether_setup(dev); | ||||||
|  | -	dev->max_mtu = mtu_max; | ||||||
|  |  	dev->tx_queue_len = WIL_TX_Q_LEN_DEFAULT; | ||||||
|  |  } | ||||||
|  |   | ||||||
|  | --- a/drivers/net/wireless/atmel/atmel.c | ||||||
|  | +++ b/drivers/net/wireless/atmel/atmel.c | ||||||
|  | @@ -1295,6 +1295,14 @@ static struct iw_statistics *atmel_get_w | ||||||
|  |  	return &priv->wstats; | ||||||
|  |  } | ||||||
|  |   | ||||||
|  | +static int atmel_change_mtu(struct net_device *dev, int new_mtu) | ||||||
|  | +{ | ||||||
|  | +	if ((new_mtu < 68) || (new_mtu > 2312)) | ||||||
|  | +		return -EINVAL; | ||||||
|  | +	dev->mtu = new_mtu; | ||||||
|  | +	return 0; | ||||||
|  | +} | ||||||
|  | + | ||||||
|  |  static int atmel_set_mac_address(struct net_device *dev, void *p) | ||||||
|  |  { | ||||||
|  |  	struct sockaddr *addr = p; | ||||||
|  | @@ -1498,6 +1506,7 @@ static const struct file_operations atme | ||||||
|  |  static const struct net_device_ops atmel_netdev_ops = { | ||||||
|  |  	.ndo_open 		= atmel_open, | ||||||
|  |  	.ndo_stop		= atmel_close, | ||||||
|  | +	.ndo_change_mtu 	= atmel_change_mtu, | ||||||
|  |  	.ndo_set_mac_address 	= atmel_set_mac_address, | ||||||
|  |  	.ndo_start_xmit 	= start_tx, | ||||||
|  |  	.ndo_do_ioctl 		= atmel_ioctl, | ||||||
|  | @@ -1591,10 +1600,6 @@ struct net_device *init_atmel_card(unsig | ||||||
|  |  	dev->irq = irq; | ||||||
|  |  	dev->base_addr = port; | ||||||
|  |   | ||||||
|  | -	/* MTU range: 68 - 2312 */ | ||||||
|  | -	dev->min_mtu = 68; | ||||||
|  | -	dev->max_mtu = MAX_WIRELESS_BODY - ETH_FCS_LEN; | ||||||
|  | - | ||||||
|  |  	SET_NETDEV_DEV(dev, sys_dev); | ||||||
|  |   | ||||||
|  |  	if ((rc = request_irq(dev->irq, service_interrupt, IRQF_SHARED, dev->name, dev))) { | ||||||
|  | --- a/drivers/net/wireless/cisco/airo.c | ||||||
|  | +++ b/drivers/net/wireless/cisco/airo.c | ||||||
|  | @@ -2329,6 +2329,14 @@ static int airo_set_mac_address(struct n | ||||||
|  |  	return 0; | ||||||
|  |  } | ||||||
|  |   | ||||||
|  | +static int airo_change_mtu(struct net_device *dev, int new_mtu) | ||||||
|  | +{ | ||||||
|  | +	if ((new_mtu < 68) || (new_mtu > 2400)) | ||||||
|  | +		return -EINVAL; | ||||||
|  | +	dev->mtu = new_mtu; | ||||||
|  | +	return 0; | ||||||
|  | +} | ||||||
|  | + | ||||||
|  |  static LIST_HEAD(airo_devices); | ||||||
|  |   | ||||||
|  |  static void add_airo_dev(struct airo_info *ai) | ||||||
|  | @@ -2648,6 +2656,7 @@ static const struct net_device_ops airo1 | ||||||
|  |  	.ndo_get_stats 		= airo_get_stats, | ||||||
|  |  	.ndo_set_mac_address	= airo_set_mac_address, | ||||||
|  |  	.ndo_do_ioctl		= airo_ioctl, | ||||||
|  | +	.ndo_change_mtu		= airo_change_mtu, | ||||||
|  |  }; | ||||||
|  |   | ||||||
|  |  static void wifi_setup(struct net_device *dev) | ||||||
|  | @@ -2659,8 +2668,6 @@ static void wifi_setup(struct net_device | ||||||
|  |  	dev->type               = ARPHRD_IEEE80211; | ||||||
|  |  	dev->hard_header_len    = ETH_HLEN; | ||||||
|  |  	dev->mtu                = AIRO_DEF_MTU; | ||||||
|  | -	dev->min_mtu            = 68; | ||||||
|  | -	dev->max_mtu            = MIC_MSGLEN_MAX; | ||||||
|  |  	dev->addr_len           = ETH_ALEN; | ||||||
|  |  	dev->tx_queue_len       = 100;  | ||||||
|  |   | ||||||
|  | @@ -2747,6 +2754,7 @@ static const struct net_device_ops airo_ | ||||||
|  |  	.ndo_set_rx_mode	= airo_set_multicast_list, | ||||||
|  |  	.ndo_set_mac_address	= airo_set_mac_address, | ||||||
|  |  	.ndo_do_ioctl		= airo_ioctl, | ||||||
|  | +	.ndo_change_mtu		= airo_change_mtu, | ||||||
|  |  	.ndo_validate_addr	= eth_validate_addr, | ||||||
|  |  }; | ||||||
|  |   | ||||||
|  | @@ -2758,6 +2766,7 @@ static const struct net_device_ops mpi_n | ||||||
|  |  	.ndo_set_rx_mode	= airo_set_multicast_list, | ||||||
|  |  	.ndo_set_mac_address	= airo_set_mac_address, | ||||||
|  |  	.ndo_do_ioctl		= airo_ioctl, | ||||||
|  | +	.ndo_change_mtu		= airo_change_mtu, | ||||||
|  |  	.ndo_validate_addr	= eth_validate_addr, | ||||||
|  |  }; | ||||||
|  |   | ||||||
|  | @@ -2813,7 +2822,6 @@ static struct net_device *_init_airo_car | ||||||
|  |  	dev->irq = irq; | ||||||
|  |  	dev->base_addr = port; | ||||||
|  |  	dev->priv_flags &= ~IFF_TX_SKB_SHARING; | ||||||
|  | -	dev->max_mtu = MIC_MSGLEN_MAX; | ||||||
|  |   | ||||||
|  |  	SET_NETDEV_DEV(dev, dmdev); | ||||||
|  |   | ||||||
|  | --- a/drivers/net/wireless/intel/ipw2x00/ipw2100.c | ||||||
|  | +++ b/drivers/net/wireless/intel/ipw2x00/ipw2100.c | ||||||
|  | @@ -6039,6 +6039,7 @@ static const struct net_device_ops ipw21 | ||||||
|  |  	.ndo_open		= ipw2100_open, | ||||||
|  |  	.ndo_stop		= ipw2100_close, | ||||||
|  |  	.ndo_start_xmit		= libipw_xmit, | ||||||
|  | +	.ndo_change_mtu		= libipw_change_mtu, | ||||||
|  |  	.ndo_tx_timeout		= ipw2100_tx_timeout, | ||||||
|  |  	.ndo_set_mac_address	= ipw2100_set_address, | ||||||
|  |  	.ndo_validate_addr	= eth_validate_addr, | ||||||
|  | @@ -6074,8 +6075,6 @@ static struct net_device *ipw2100_alloc_ | ||||||
|  |  	dev->wireless_data = &priv->wireless_data; | ||||||
|  |  	dev->watchdog_timeo = 3 * HZ; | ||||||
|  |  	dev->irq = 0; | ||||||
|  | -	dev->min_mtu = 68; | ||||||
|  | -	dev->max_mtu = LIBIPW_DATA_LEN; | ||||||
|  |   | ||||||
|  |  	/* NOTE: We don't use the wireless_handlers hook | ||||||
|  |  	 * in dev as the system will start throwing WX requests | ||||||
|  | --- a/drivers/net/wireless/intel/ipw2x00/ipw2200.c | ||||||
|  | +++ b/drivers/net/wireless/intel/ipw2x00/ipw2200.c | ||||||
|  | @@ -11561,6 +11561,7 @@ static const struct net_device_ops ipw_p | ||||||
|  |  	.ndo_open 		= ipw_prom_open, | ||||||
|  |  	.ndo_stop		= ipw_prom_stop, | ||||||
|  |  	.ndo_start_xmit		= ipw_prom_hard_start_xmit, | ||||||
|  | +	.ndo_change_mtu		= libipw_change_mtu, | ||||||
|  |  	.ndo_set_mac_address 	= eth_mac_addr, | ||||||
|  |  	.ndo_validate_addr	= eth_validate_addr, | ||||||
|  |  }; | ||||||
|  | @@ -11586,9 +11587,6 @@ static int ipw_prom_alloc(struct ipw_pri | ||||||
|  |  	priv->prom_net_dev->type = ARPHRD_IEEE80211_RADIOTAP; | ||||||
|  |  	priv->prom_net_dev->netdev_ops = &ipw_prom_netdev_ops; | ||||||
|  |   | ||||||
|  | -	priv->prom_net_dev->min_mtu = 68; | ||||||
|  | -	priv->prom_net_dev->max_mtu = LIBIPW_DATA_LEN; | ||||||
|  | - | ||||||
|  |  	priv->prom_priv->ieee->iw_mode = IW_MODE_MONITOR; | ||||||
|  |  	SET_NETDEV_DEV(priv->prom_net_dev, &priv->pci_dev->dev); | ||||||
|  |   | ||||||
|  | @@ -11621,6 +11619,7 @@ static const struct net_device_ops ipw_n | ||||||
|  |  	.ndo_set_rx_mode	= ipw_net_set_multicast_list, | ||||||
|  |  	.ndo_set_mac_address	= ipw_net_set_mac_address, | ||||||
|  |  	.ndo_start_xmit		= libipw_xmit, | ||||||
|  | +	.ndo_change_mtu		= libipw_change_mtu, | ||||||
|  |  	.ndo_validate_addr	= eth_validate_addr, | ||||||
|  |  }; | ||||||
|  |   | ||||||
|  | @@ -11730,9 +11729,6 @@ static int ipw_pci_probe(struct pci_dev | ||||||
|  |  	net_dev->wireless_handlers = &ipw_wx_handler_def; | ||||||
|  |  	net_dev->ethtool_ops = &ipw_ethtool_ops; | ||||||
|  |   | ||||||
|  | -	net_dev->min_mtu = 68; | ||||||
|  | -	net_dev->max_mtu = LIBIPW_DATA_LEN; | ||||||
|  | - | ||||||
|  |  	err = sysfs_create_group(&pdev->dev.kobj, &ipw_attribute_group); | ||||||
|  |  	if (err) { | ||||||
|  |  		IPW_ERROR("failed to create sysfs device attributes\n"); | ||||||
|  | --- a/drivers/net/wireless/intel/ipw2x00/libipw.h | ||||||
|  | +++ b/drivers/net/wireless/intel/ipw2x00/libipw.h | ||||||
|  | @@ -948,6 +948,7 @@ static inline int libipw_is_cck_rate(u8 | ||||||
|  |  /* libipw.c */ | ||||||
|  |  void free_libipw(struct net_device *dev, int monitor); | ||||||
|  |  struct net_device *alloc_libipw(int sizeof_priv, int monitor); | ||||||
|  | +int libipw_change_mtu(struct net_device *dev, int new_mtu); | ||||||
|  |   | ||||||
|  |  void libipw_networks_age(struct libipw_device *ieee, unsigned long age_secs); | ||||||
|  |   | ||||||
|  | --- a/drivers/net/wireless/intel/ipw2x00/libipw_module.c | ||||||
|  | +++ b/drivers/net/wireless/intel/ipw2x00/libipw_module.c | ||||||
|  | @@ -118,6 +118,15 @@ static void libipw_networks_initialize(s | ||||||
|  |  			      &ieee->network_free_list); | ||||||
|  |  } | ||||||
|  |   | ||||||
|  | +int libipw_change_mtu(struct net_device *dev, int new_mtu) | ||||||
|  | +{ | ||||||
|  | +	if ((new_mtu < 68) || (new_mtu > LIBIPW_DATA_LEN)) | ||||||
|  | +		return -EINVAL; | ||||||
|  | +	dev->mtu = new_mtu; | ||||||
|  | +	return 0; | ||||||
|  | +} | ||||||
|  | +EXPORT_SYMBOL(libipw_change_mtu); | ||||||
|  | + | ||||||
|  |  struct net_device *alloc_libipw(int sizeof_priv, int monitor) | ||||||
|  |  { | ||||||
|  |  	struct libipw_device *ieee; | ||||||
|  | --- a/drivers/net/wireless/intersil/hostap/hostap_main.c | ||||||
|  | +++ b/drivers/net/wireless/intersil/hostap/hostap_main.c | ||||||
|  | @@ -765,6 +765,16 @@ static void hostap_set_multicast_list(st | ||||||
|  |  } | ||||||
|  |   | ||||||
|  |   | ||||||
|  | +static int prism2_change_mtu(struct net_device *dev, int new_mtu) | ||||||
|  | +{ | ||||||
|  | +	if (new_mtu < PRISM2_MIN_MTU || new_mtu > PRISM2_MAX_MTU) | ||||||
|  | +		return -EINVAL; | ||||||
|  | + | ||||||
|  | +	dev->mtu = new_mtu; | ||||||
|  | +	return 0; | ||||||
|  | +} | ||||||
|  | + | ||||||
|  | + | ||||||
|  |  static void prism2_tx_timeout(struct net_device *dev) | ||||||
|  |  { | ||||||
|  |  	struct hostap_interface *iface; | ||||||
|  | @@ -803,6 +813,7 @@ static const struct net_device_ops hosta | ||||||
|  |  	.ndo_do_ioctl		= hostap_ioctl, | ||||||
|  |  	.ndo_set_mac_address	= prism2_set_mac_address, | ||||||
|  |  	.ndo_set_rx_mode	= hostap_set_multicast_list, | ||||||
|  | +	.ndo_change_mtu 	= prism2_change_mtu, | ||||||
|  |  	.ndo_tx_timeout 	= prism2_tx_timeout, | ||||||
|  |  	.ndo_validate_addr	= eth_validate_addr, | ||||||
|  |  }; | ||||||
|  | @@ -815,6 +826,7 @@ static const struct net_device_ops hosta | ||||||
|  |  	.ndo_do_ioctl		= hostap_ioctl, | ||||||
|  |  	.ndo_set_mac_address	= prism2_set_mac_address, | ||||||
|  |  	.ndo_set_rx_mode	= hostap_set_multicast_list, | ||||||
|  | +	.ndo_change_mtu 	= prism2_change_mtu, | ||||||
|  |  	.ndo_tx_timeout 	= prism2_tx_timeout, | ||||||
|  |  	.ndo_validate_addr	= eth_validate_addr, | ||||||
|  |  }; | ||||||
|  | @@ -827,6 +839,7 @@ static const struct net_device_ops hosta | ||||||
|  |  	.ndo_do_ioctl		= hostap_ioctl, | ||||||
|  |  	.ndo_set_mac_address	= prism2_set_mac_address, | ||||||
|  |  	.ndo_set_rx_mode	= hostap_set_multicast_list, | ||||||
|  | +	.ndo_change_mtu 	= prism2_change_mtu, | ||||||
|  |  	.ndo_tx_timeout 	= prism2_tx_timeout, | ||||||
|  |  	.ndo_validate_addr	= eth_validate_addr, | ||||||
|  |  }; | ||||||
|  | @@ -838,8 +851,6 @@ void hostap_setup_dev(struct net_device | ||||||
|  |   | ||||||
|  |  	iface = netdev_priv(dev); | ||||||
|  |  	ether_setup(dev); | ||||||
|  | -	dev->min_mtu = PRISM2_MIN_MTU; | ||||||
|  | -	dev->max_mtu = PRISM2_MAX_MTU; | ||||||
|  |  	dev->priv_flags &= ~IFF_TX_SKB_SHARING; | ||||||
|  |   | ||||||
|  |  	/* kernel callbacks */ | ||||||
|  | --- a/drivers/net/wireless/intersil/orinoco/main.c | ||||||
|  | +++ b/drivers/net/wireless/intersil/orinoco/main.c | ||||||
|  | @@ -322,6 +322,9 @@ int orinoco_change_mtu(struct net_device | ||||||
|  |  { | ||||||
|  |  	struct orinoco_private *priv = ndev_priv(dev); | ||||||
|  |   | ||||||
|  | +	if ((new_mtu < ORINOCO_MIN_MTU) || (new_mtu > ORINOCO_MAX_MTU)) | ||||||
|  | +		return -EINVAL; | ||||||
|  | + | ||||||
|  |  	/* MTU + encapsulation + header length */ | ||||||
|  |  	if ((new_mtu + ENCAPS_OVERHEAD + sizeof(struct ieee80211_hdr)) > | ||||||
|  |  	     (priv->nicbuf_size - ETH_HLEN)) | ||||||
|  | @@ -2285,9 +2288,6 @@ int orinoco_if_add(struct orinoco_privat | ||||||
|  |  	dev->base_addr = base_addr; | ||||||
|  |  	dev->irq = irq; | ||||||
|  |   | ||||||
|  | -	dev->min_mtu = ORINOCO_MIN_MTU; | ||||||
|  | -	dev->max_mtu = ORINOCO_MAX_MTU; | ||||||
|  | - | ||||||
|  |  	SET_NETDEV_DEV(dev, priv->dev); | ||||||
|  |  	ret = register_netdev(dev); | ||||||
|  |  	if (ret) | ||||||
							
								
								
									
										43
									
								
								package/kernel/mac80211/patches/011-backport_strscpy.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										43
									
								
								package/kernel/mac80211/patches/011-backport_strscpy.patch
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,43 @@ | |||||||
|  | --- a/backport-include/linux/string.h | ||||||
|  | +++ b/backport-include/linux/string.h | ||||||
|  | @@ -25,4 +25,8 @@ extern void *memdup_user_nul(const void | ||||||
|  |  void memzero_explicit(void *s, size_t count); | ||||||
|  |  #endif | ||||||
|  |   | ||||||
|  | +#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,3,0)) | ||||||
|  | +ssize_t strscpy(char *dest, const char *src, size_t count); | ||||||
|  | +#endif | ||||||
|  | + | ||||||
|  |  #endif /* __BACKPORT_LINUX_STRING_H */ | ||||||
|  | --- a/compat/backport-4.3.c | ||||||
|  | +++ b/compat/backport-4.3.c | ||||||
|  | @@ -57,3 +57,29 @@ void seq_hex_dump(struct seq_file *m, co | ||||||
|  |  	} | ||||||
|  |  } | ||||||
|  |  EXPORT_SYMBOL_GPL(seq_hex_dump); | ||||||
|  | + | ||||||
|  | +ssize_t strscpy(char *dest, const char *src, size_t count) | ||||||
|  | +{ | ||||||
|  | +	long res = 0; | ||||||
|  | + | ||||||
|  | +	if (count == 0) | ||||||
|  | +		return -E2BIG; | ||||||
|  | + | ||||||
|  | +	while (count) { | ||||||
|  | +		char c; | ||||||
|  | + | ||||||
|  | +		c = src[res]; | ||||||
|  | +		dest[res] = c; | ||||||
|  | +		if (!c) | ||||||
|  | +			return res; | ||||||
|  | +		res++; | ||||||
|  | +		count--; | ||||||
|  | +	} | ||||||
|  | + | ||||||
|  | +	/* Hit buffer length without finding a NUL; force NUL-termination. */ | ||||||
|  | +	if (res) | ||||||
|  | +		dest[res-1] = '\0'; | ||||||
|  | + | ||||||
|  | +	return -E2BIG; | ||||||
|  | +} | ||||||
|  | +EXPORT_SYMBOL_GPL(strscpy); | ||||||
| @@ -0,0 +1,85 @@ | |||||||
|  | From 6232c17438ed01f43665197db5a98a4a4f77ef47 Mon Sep 17 00:00:00 2001 | ||||||
|  | From: Stanislaw Gruszka <sgruszka@redhat.com> | ||||||
|  | Date: Thu, 2 Feb 2017 10:57:40 +0100 | ||||||
|  | Subject: [PATCH 01/19] rt2x00: avoid introducing a USB dependency in the | ||||||
|  |  rt2x00lib module | ||||||
|  |  | ||||||
|  | As reported by Felix: | ||||||
|  |  | ||||||
|  | Though protected by an ifdef, introducing an usb symbol dependency in | ||||||
|  | the rt2x00lib module is a major inconvenience for distributions that | ||||||
|  | package kernel modules split into individual packages. | ||||||
|  |  | ||||||
|  | Get rid of this unnecessary dependency by calling the usb related | ||||||
|  | function from a more suitable place. | ||||||
|  |  | ||||||
|  | Cc: Vishal Thanki <vishalthanki@gmail.com> | ||||||
|  | Reported-by: Felix Fietkau <nbd@nbd.name> | ||||||
|  | Fixes: 8b4c0009313f ("rt2x00usb: Use usb anchor to manage URB") | ||||||
|  | Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> | ||||||
|  | Signed-off-by: Kalle Valo <kvalo@codeaurora.org> | ||||||
|  | --- | ||||||
|  |  drivers/net/wireless/ralink/rt2x00/rt2x00dev.c | 23 ++++++++--------------- | ||||||
|  |  drivers/net/wireless/ralink/rt2x00/rt2x00usb.c |  5 +++++ | ||||||
|  |  2 files changed, 13 insertions(+), 15 deletions(-) | ||||||
|  |  | ||||||
|  | diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c | ||||||
|  | index 8fcbc8dc94c1..4b08007f93f7 100644 | ||||||
|  | --- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c | ||||||
|  | +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c | ||||||
|  | @@ -1436,21 +1436,6 @@ void rt2x00lib_remove_dev(struct rt2x00_dev *rt2x00dev) | ||||||
|  |  	cancel_work_sync(&rt2x00dev->intf_work); | ||||||
|  |  	cancel_delayed_work_sync(&rt2x00dev->autowakeup_work); | ||||||
|  |  	cancel_work_sync(&rt2x00dev->sleep_work); | ||||||
|  | -#if IS_ENABLED(CPTCFG_RT2X00_LIB_USB) | ||||||
|  | -	if (rt2x00_is_usb(rt2x00dev)) { | ||||||
|  | -		usb_kill_anchored_urbs(rt2x00dev->anchor); | ||||||
|  | -		hrtimer_cancel(&rt2x00dev->txstatus_timer); | ||||||
|  | -		cancel_work_sync(&rt2x00dev->rxdone_work); | ||||||
|  | -		cancel_work_sync(&rt2x00dev->txdone_work); | ||||||
|  | -	} | ||||||
|  | -#endif | ||||||
|  | -	if (rt2x00dev->workqueue) | ||||||
|  | -		destroy_workqueue(rt2x00dev->workqueue); | ||||||
|  | - | ||||||
|  | -	/* | ||||||
|  | -	 * Free the tx status fifo. | ||||||
|  | -	 */ | ||||||
|  | -	kfifo_free(&rt2x00dev->txstatus_fifo); | ||||||
|  |   | ||||||
|  |  	/* | ||||||
|  |  	 * Kill the tx status tasklet. | ||||||
|  | @@ -1466,6 +1451,14 @@ void rt2x00lib_remove_dev(struct rt2x00_dev *rt2x00dev) | ||||||
|  |  	 */ | ||||||
|  |  	rt2x00lib_uninitialize(rt2x00dev); | ||||||
|  |   | ||||||
|  | +	if (rt2x00dev->workqueue) | ||||||
|  | +		destroy_workqueue(rt2x00dev->workqueue); | ||||||
|  | + | ||||||
|  | +	/* | ||||||
|  | +	 * Free the tx status fifo. | ||||||
|  | +	 */ | ||||||
|  | +	kfifo_free(&rt2x00dev->txstatus_fifo); | ||||||
|  | + | ||||||
|  |  	/* | ||||||
|  |  	 * Free extra components | ||||||
|  |  	 */ | ||||||
|  | diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c b/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c | ||||||
|  | index 838ca58d2dd6..5a2bf9f63cd7 100644 | ||||||
|  | --- a/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c | ||||||
|  | +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c | ||||||
|  | @@ -744,6 +744,11 @@ void rt2x00usb_uninitialize(struct rt2x00_dev *rt2x00dev) | ||||||
|  |  { | ||||||
|  |  	struct data_queue *queue; | ||||||
|  |   | ||||||
|  | +	usb_kill_anchored_urbs(rt2x00dev->anchor); | ||||||
|  | +	hrtimer_cancel(&rt2x00dev->txstatus_timer); | ||||||
|  | +	cancel_work_sync(&rt2x00dev->rxdone_work); | ||||||
|  | +	cancel_work_sync(&rt2x00dev->txdone_work); | ||||||
|  | + | ||||||
|  |  	queue_for_each(rt2x00dev, queue) | ||||||
|  |  		rt2x00usb_free_entries(queue); | ||||||
|  |  } | ||||||
|  | --  | ||||||
|  | 2.12.1 | ||||||
|  |  | ||||||
| @@ -0,0 +1,61 @@ | |||||||
|  | From 93c7018ec16bb83399dd4db61c361a6d6aba0d5a Mon Sep 17 00:00:00 2001 | ||||||
|  | From: Stanislaw Gruszka <sgruszka@redhat.com> | ||||||
|  | Date: Wed, 8 Feb 2017 12:18:09 +0100 | ||||||
|  | Subject: [PATCH 02/19] rt2x00usb: do not anchor rx and tx urb's | ||||||
|  |  | ||||||
|  | We might kill TX or RX urb during rt2x00usb_flush_entry(), what can | ||||||
|  | cause anchor list corruption like shown below: | ||||||
|  |  | ||||||
|  | [ 2074.035633] WARNING: CPU: 2 PID: 14480 at lib/list_debug.c:33 __list_add+0xac/0xc0 | ||||||
|  | [ 2074.035634] list_add corruption. prev->next should be next (ffff88020f362c28), but was dead000000000100. (prev=ffff8801d161bb70). | ||||||
|  | <snip> | ||||||
|  | [ 2074.035670] Call Trace: | ||||||
|  | [ 2074.035672]  [<ffffffff813bde47>] dump_stack+0x63/0x8c | ||||||
|  | [ 2074.035674]  [<ffffffff810a2231>] __warn+0xd1/0xf0 | ||||||
|  | [ 2074.035676]  [<ffffffff810a22af>] warn_slowpath_fmt+0x5f/0x80 | ||||||
|  | [ 2074.035678]  [<ffffffffa073855d>] ? rt2x00usb_register_write_lock+0x3d/0x60 [rt2800usb] | ||||||
|  | [ 2074.035679]  [<ffffffff813dbe4c>] __list_add+0xac/0xc0 | ||||||
|  | [ 2074.035681]  [<ffffffff81591c6c>] usb_anchor_urb+0x4c/0xa0 | ||||||
|  | [ 2074.035683]  [<ffffffffa07322af>] rt2x00usb_kick_rx_entry+0xaf/0x100 [rt2x00usb] | ||||||
|  | [ 2074.035684]  [<ffffffffa0732322>] rt2x00usb_clear_entry+0x22/0x30 [rt2x00usb] | ||||||
|  |  | ||||||
|  | To fix do not anchor TX and RX urb's, it is not needed as during | ||||||
|  | shutdown we kill those urbs in rt2x00usb_free_entries(). | ||||||
|  |  | ||||||
|  | Cc: Vishal Thanki <vishalthanki@gmail.com> | ||||||
|  | Fixes: 8b4c0009313f ("rt2x00usb: Use usb anchor to manage URB") | ||||||
|  | Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> | ||||||
|  | Signed-off-by: Kalle Valo <kvalo@codeaurora.org> | ||||||
|  | --- | ||||||
|  |  drivers/net/wireless/ralink/rt2x00/rt2x00usb.c | 4 ---- | ||||||
|  |  1 file changed, 4 deletions(-) | ||||||
|  |  | ||||||
|  | diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c b/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c | ||||||
|  | index 5a2bf9f63cd7..fe13dd07cc2a 100644 | ||||||
|  | --- a/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c | ||||||
|  | +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c | ||||||
|  | @@ -319,10 +319,8 @@ static bool rt2x00usb_kick_tx_entry(struct queue_entry *entry, void *data) | ||||||
|  |  			  entry->skb->data, length, | ||||||
|  |  			  rt2x00usb_interrupt_txdone, entry); | ||||||
|  |   | ||||||
|  | -	usb_anchor_urb(entry_priv->urb, rt2x00dev->anchor); | ||||||
|  |  	status = usb_submit_urb(entry_priv->urb, GFP_ATOMIC); | ||||||
|  |  	if (status) { | ||||||
|  | -		usb_unanchor_urb(entry_priv->urb); | ||||||
|  |  		if (status == -ENODEV) | ||||||
|  |  			clear_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags); | ||||||
|  |  		set_bit(ENTRY_DATA_IO_FAILED, &entry->flags); | ||||||
|  | @@ -410,10 +408,8 @@ static bool rt2x00usb_kick_rx_entry(struct queue_entry *entry, void *data) | ||||||
|  |  			  entry->skb->data, entry->skb->len, | ||||||
|  |  			  rt2x00usb_interrupt_rxdone, entry); | ||||||
|  |   | ||||||
|  | -	usb_anchor_urb(entry_priv->urb, rt2x00dev->anchor); | ||||||
|  |  	status = usb_submit_urb(entry_priv->urb, GFP_ATOMIC); | ||||||
|  |  	if (status) { | ||||||
|  | -		usb_unanchor_urb(entry_priv->urb); | ||||||
|  |  		if (status == -ENODEV) | ||||||
|  |  			clear_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags); | ||||||
|  |  		set_bit(ENTRY_DATA_IO_FAILED, &entry->flags); | ||||||
|  | --  | ||||||
|  | 2.12.1 | ||||||
|  |  | ||||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user