Compare commits
324 Commits
v21.02.0-r
...
v17.01.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
48461b5abc | ||
|
|
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
|
||||
bool "Select all target specific packages by default"
|
||||
default ALL
|
||||
default ALL || BUILDBOT
|
||||
|
||||
config ALL_KMODS
|
||||
bool "Select all kernel module packages by default"
|
||||
@@ -19,6 +19,16 @@ menu "Global build settings"
|
||||
bool "Select all userspace packages by default"
|
||||
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
|
||||
bool "Cryptographically signed package lists"
|
||||
default y
|
||||
@@ -61,7 +71,7 @@ menu "Global build settings"
|
||||
bool
|
||||
prompt "Collect kernel debug information"
|
||||
select KERNEL_DEBUG_INFO
|
||||
default n
|
||||
default BUILDBOT
|
||||
help
|
||||
This collects debugging symbols from the kernel and all compiled modules.
|
||||
Useful for release builds, so that kernel issues can be debugged offline
|
||||
|
||||
@@ -59,7 +59,7 @@ menuconfig DEVEL
|
||||
bool "Use ccache" if DEVEL
|
||||
default n
|
||||
help
|
||||
Compiler cache; see http://ccache.samba.org/.
|
||||
Compiler cache; see https://ccache.samba.org/
|
||||
|
||||
config EXTERNAL_KERNEL_TREE
|
||||
string "Use external kernel tree" if DEVEL
|
||||
|
||||
@@ -201,7 +201,6 @@ menu "Target Images"
|
||||
int "Serial port baud rate"
|
||||
depends on GRUB_IMAGES
|
||||
default 38400 if TARGET_x86_generic
|
||||
default 38400 if TARGET_x86_geode
|
||||
default 115200
|
||||
|
||||
config GRUB_BOOTOPTS
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
src-git packages https://git.lede-project.org/feed/packages.git
|
||||
src-git luci https://git.lede-project.org/project/luci.git
|
||||
src-git routing https://git.lede-project.org/feed/routing.git
|
||||
src-git telephony https://git.lede-project.org/feed/telephony.git
|
||||
#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
|
||||
src-git packages https://git.lede-project.org/feed/packages.git^f9e99848182fc7bc554e541ca133c22079d4041b
|
||||
src-git luci https://git.lede-project.org/project/luci.git^29fabe26399fbaecf9231e24f9ac1ee5773cafa6
|
||||
src-git routing https://git.lede-project.org/feed/routing.git^04a37ef4309c2b67c64901eb8fbf3800b4c7bb35
|
||||
src-git telephony https://git.lede-project.org/feed/telephony.git^1f0fb2538ba6fc306198fe2a9a4b976d63adb304
|
||||
|
||||
@@ -107,3 +107,7 @@ define Host/Configure/Default
|
||||
$(HOST_CMAKE_SOURCE_DIR) \
|
||||
)
|
||||
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 \
|
||||
--sbindir=$(HOST_BUILD_PREFIX)/bin
|
||||
|
||||
HOST_MAKE_VARS = \
|
||||
CFLAGS="$(HOST_CFLAGS)" \
|
||||
CPPFLAGS="$(HOST_CPPFLAGS)" \
|
||||
CXXFLAGS="$(HOST_CXXFLAGS)" \
|
||||
LDFLAGS="$(HOST_LDFLAGS)"
|
||||
|
||||
HOST_MAKE_FLAGS =
|
||||
|
||||
HOST_CONFIGURE_CMD = $(BASH) ./configure
|
||||
@@ -89,7 +95,8 @@ define Host/Configure
|
||||
endef
|
||||
|
||||
define Host/Compile/Default
|
||||
+$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \
|
||||
+$(HOST_MAKE_VARS) \
|
||||
$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \
|
||||
$(HOST_MAKE_FLAGS) \
|
||||
$(1)
|
||||
endef
|
||||
|
||||
@@ -420,7 +420,7 @@ define Device/Build/initramfs
|
||||
$(BIN_DIR)/$$(KERNEL_INITRAMFS_IMAGE): $(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE)
|
||||
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 $$@
|
||||
$$(call concat_cmd,$$(KERNEL_INITRAMFS))
|
||||
endef
|
||||
@@ -444,7 +444,7 @@ define Device/Build/kernel
|
||||
ifdef CONFIG_IB
|
||||
install: $$(KDIR_KERNEL_IMAGE)
|
||||
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 $$@
|
||||
$$(call concat_cmd,$$(KERNEL))
|
||||
$$(if $$(KERNEL_SIZE),$$(call Build/check-size,$$(KERNEL_SIZE)))
|
||||
|
||||
@@ -60,7 +60,7 @@ define Download/git-kernel
|
||||
PROTO:=git
|
||||
VERSION:=$(CONFIG_KERNEL_GIT_BRANCH)
|
||||
FILE:=$(LINUX_SOURCE)
|
||||
SUBDIR:=linux-$(KERNEL_PATCHVER)
|
||||
SUBDIR:=linux-$(LINUX_VERSION)
|
||||
OPTS:=$(KERNEL_GIT_OPTS)
|
||||
endef
|
||||
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
LINUX_RELEASE?=1
|
||||
|
||||
LINUX_VERSION-3.18 = .43
|
||||
LINUX_VERSION-4.4 = .42
|
||||
LINUX_VERSION-4.4 = .61
|
||||
|
||||
LINUX_KERNEL_HASH-3.18.43 = 1236e8123a6ce537d5029232560966feed054ae31776fe8481dd7d18cdd5492c
|
||||
LINUX_KERNEL_HASH-4.4.42 = 324747568e92f203e3ee5ec8b291a868f58b870f1ad214fa64aa3507ed42e878
|
||||
LINUX_KERNEL_HASH-4.4.61 = 30dee7164615ad8184eba4ea6f4906b3ceb2fe462a8a4a929c8e9aab8d4a31da
|
||||
|
||||
ifdef KERNEL_PATCHVER
|
||||
LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER)))
|
||||
|
||||
@@ -209,11 +209,13 @@ $(_endef)
|
||||
( \
|
||||
echo "#!/bin/sh"; \
|
||||
echo "[ \"\$$$${IPKG_NO_SCRIPT}\" = \"1\" ] && exit 0"; \
|
||||
echo "[ -x "\$$$${IPKG_INSTROOT}/lib/functions.sh" ] || exit 0"; \
|
||||
echo ". \$$$${IPKG_INSTROOT}/lib/functions.sh"; \
|
||||
echo "default_postinst \$$$$0 \$$$$@"; \
|
||||
) > postinst; \
|
||||
( \
|
||||
echo "#!/bin/sh"; \
|
||||
echo "[ -x "\$$$${IPKG_INSTROOT}/lib/functions.sh" ] || exit 0"; \
|
||||
echo ". \$$$${IPKG_INSTROOT}/lib/functions.sh"; \
|
||||
echo "default_prerm \$$$$0 \$$$$@"; \
|
||||
) > prerm; \
|
||||
|
||||
@@ -47,6 +47,14 @@ opkg = \
|
||||
|
||||
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
|
||||
@if [ -d $(TOPDIR)/files ]; then \
|
||||
$(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/info/*.postinst*
|
||||
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))
|
||||
endef
|
||||
|
||||
@@ -164,17 +164,15 @@ ifeq ($(DUMP),1)
|
||||
endif
|
||||
CPU_CFLAGS += -mno-branch-likely
|
||||
CPU_CFLAGS_mips32 = -mips32 -mtune=mips32
|
||||
CPU_CFLAGS_mips32r2 = -mips32r2 -mtune=mips32r2
|
||||
CPU_CFLAGS_mips64 = -mips64 -mtune=mips64 -mabi=64
|
||||
CPU_CFLAGS_24kc = -mips32r2 -mtune=24kc
|
||||
CPU_CFLAGS_74kc = -mips32r2 -mtune=74kc
|
||||
CPU_CFLAGS_octeon = -march=octeon -mabi=64
|
||||
endif
|
||||
ifeq ($(ARCH),i386)
|
||||
CPU_TYPE ?= i486
|
||||
CPU_CFLAGS_i486 = -march=i486
|
||||
CPU_TYPE ?= pentium
|
||||
CPU_CFLAGS_pentium = -march=pentium-mmx
|
||||
CPU_CFLAGS_pentium4 = -march=pentium4
|
||||
CPU_CFLAGS_geode = -march=geode -mmmx -m3dnow
|
||||
endif
|
||||
ifneq ($(findstring arm,$(ARCH)),)
|
||||
CPU_TYPE ?= xscale
|
||||
@@ -259,6 +257,9 @@ ifeq ($(DUMP),1)
|
||||
ifneq ($(CONFIG_VIRTIO),)
|
||||
FEATURES += virtio
|
||||
endif
|
||||
ifneq ($(CONFIG_CPU_MIPS32_R2),)
|
||||
FEATURES += mips16
|
||||
endif
|
||||
FEATURES += $(foreach v,6 7,$(if $(CONFIG_CPU_V$(v)),arm_v$(v)))
|
||||
|
||||
# remove duplicates
|
||||
|
||||
@@ -31,16 +31,16 @@ qstrip_escape=$(subst ','\'',$(call qstrip,$(1)))
|
||||
sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1))))
|
||||
|
||||
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.1)
|
||||
|
||||
VERSION_CODE:=$(call qstrip_escape,$(CONFIG_VERSION_CODE))
|
||||
VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),$(REVISION))
|
||||
VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r3316-7eb58cf109)
|
||||
|
||||
VERSION_NICK:=$(call qstrip_escape,$(CONFIG_VERSION_NICK))
|
||||
VERSION_NICK:=$(if $(VERSION_NICK),$(VERSION_NICK),$(RELEASE))
|
||||
|
||||
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.1)
|
||||
|
||||
VERSION_DIST:=$(call qstrip_escape,$(CONFIG_VERSION_DIST))
|
||||
VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),LEDE)
|
||||
|
||||
@@ -56,7 +56,7 @@ $(curdir)/merge:
|
||||
$(curdir)/merge-index: $(curdir)/merge
|
||||
(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
|
||||
rm -rf $(TARGET_DIR) $(TARGET_DIR_ORIG)
|
||||
[ -d $(TARGET_DIR)/tmp ] || mkdir -p $(TARGET_DIR)/tmp
|
||||
|
||||
@@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk
|
||||
include $(INCLUDE_DIR)/version.mk
|
||||
|
||||
PKG_NAME:=base-files
|
||||
PKG_RELEASE:=171
|
||||
PKG_RELEASE:=172
|
||||
PKG_FLAGS:=nonshared
|
||||
|
||||
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/
|
||||
/etc/iproute2/rt_tables
|
||||
/etc/iproute2/rt_protos
|
||||
$(call $(TARGET)/conffiles)
|
||||
endef
|
||||
|
||||
|
||||
@@ -226,7 +226,7 @@ generate_static_system() {
|
||||
uci -q batch <<-EOF
|
||||
delete system.@system[0]
|
||||
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].ttylogin='0'
|
||||
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
|
||||
|
||||
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%.control}"
|
||||
add_group_and_user "${file}"
|
||||
|
||||
@@ -3,7 +3,7 @@ do_sysinfo_generic() {
|
||||
mkdir -p /tmp/sysinfo
|
||||
[ -e /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
|
||||
}
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
Usage: $0 [down|detect|reload|status]
|
||||
enables (default), disables or detects a wifi configuration.
|
||||
Usage: $0 [config|down|reload|status]
|
||||
enables (default), disables or configures devices not yet configured.
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
@@ -145,6 +145,12 @@ wifi_reload() {
|
||||
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() {
|
||||
[ ! -f /etc/config/wireless ] && touch /etc/config/wireless
|
||||
|
||||
@@ -229,7 +235,7 @@ scan_wifi
|
||||
|
||||
case "$1" in
|
||||
down) wifi_updown "disable" "$2";;
|
||||
detect) ;;
|
||||
detect) wifi_detect_notice ;;
|
||||
config) wifi_config ;;
|
||||
status) ubus_wifi_cmd "status" "$2";;
|
||||
reload) wifi_reload "$2";;
|
||||
|
||||
@@ -190,7 +190,7 @@ if VERSIONOPT
|
||||
config VERSION_REPO
|
||||
string
|
||||
prompt "Release repository"
|
||||
default "http://downloads.lede-project.org/snapshots"
|
||||
default "http://downloads.lede-project.org/releases/17.01.1"
|
||||
help
|
||||
This is the repository address embedded in the image, it defaults
|
||||
to the trunk snapshot repo; the url may contain the following placeholders:
|
||||
@@ -262,7 +262,7 @@ if VERSIONOPT
|
||||
config VERSION_CODE_FILENAMES
|
||||
bool
|
||||
prompt "Revision code in filenames"
|
||||
default y
|
||||
default n
|
||||
help
|
||||
Enable this to include the revision identifier or the configured
|
||||
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
|
||||
bool "Comment out not enabled feeds"
|
||||
default y
|
||||
default !BUILDBOT
|
||||
depends on PER_FEED_REPO && PER_FEED_REPO_ADD_DISABLED
|
||||
help
|
||||
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
|
||||
|
||||
PKG_NAME:=grub
|
||||
PKG_VERSION:=2.02~beta3
|
||||
PKG_VERSION:=2.02~rc1
|
||||
PKG_RELEASE:=1
|
||||
|
||||
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://mirrors.fe.up.pt/pub/gnu-alpha/grub/ \
|
||||
http://www.nic.funet.fi/pub/gnu/alpha/gnu/grub/
|
||||
PKG_HASH:=30ec3d555e52a702c3eef449872ef874eff28b320f40b55ffc47f70db8e5ada1
|
||||
PKG_HASH:=445239e9b96d1143c194c1d37851cf4196b83701c60172e49665e9d453d80278
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
HOST_BUILD_PARALLEL:=1
|
||||
@@ -25,6 +25,8 @@ PKG_BUILD_DEPENDS:=grub2/host
|
||||
|
||||
PKG_SSP:=0
|
||||
|
||||
PKG_FLAGS:=nonshared
|
||||
|
||||
include $(INCLUDE_DIR)/host-build.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@ PKG_RELEASE:=1
|
||||
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
PKG_FLAGS:=nonshared
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/rbcfg
|
||||
|
||||
@@ -14,6 +14,8 @@ touch /etc/config/ubootenv
|
||||
board=$(ar71xx_board_name)
|
||||
|
||||
case "$board" in
|
||||
a40|\
|
||||
a60|\
|
||||
alfa-ap120c|\
|
||||
all0258n|\
|
||||
ap90q|\
|
||||
@@ -52,8 +54,10 @@ om2p|\
|
||||
om2p-hs|\
|
||||
om2p-hsv2|\
|
||||
om2p-hsv3|\
|
||||
om2p-hsv4|\
|
||||
om2p-lc|\
|
||||
om2pv2)
|
||||
om2pv2|\
|
||||
om2pv4)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x40000"
|
||||
;;
|
||||
dap-2695-a1|\
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
- "bootm 0x800000"
|
||||
+ "ubi part ubi; " \
|
||||
+ "ubi read 0x800000 kernel; " \
|
||||
+ "bootz 0x800000"
|
||||
+ "bootm 0x800000"
|
||||
|
||||
#define CONFIG_MTDPARTS \
|
||||
- "mtdparts=orion_nand:1m(uboot),6M(uImage),-(root)\0"
|
||||
|
||||
@@ -17,6 +17,8 @@ PKG_HASH:=466eca9cdad2c15e957fb9ce7d0b6927ecd17d85c4cc2dff37e97a3e6b209c67
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
PKG_FLAGS:=nonshared
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/yamonenv
|
||||
|
||||
@@ -32,6 +32,11 @@ $(Package/ath10k-firmware-default)
|
||||
TITLE:=ath10k firmware for QCA9887 devices
|
||||
endef
|
||||
|
||||
define Package/ath10k-firmware-qca9887-ct
|
||||
$(Package/ath10k-firmware-default)
|
||||
TITLE:=ath10k-CT firmware for QCA9887 devices
|
||||
endef
|
||||
|
||||
QCA9887_REV:=3cce88e245f2d685e49411c4f80998f94baf67b8
|
||||
QCA9887_FIRMWARE_FILE:=firmware-5.bin_10.2.4-1.0-00013
|
||||
QCA9887_FIRMWARE_FILE_HASH:=5966408bd41f309edb595344b8dd088c0fed212debfd91e5f3e8a55ea119c16d
|
||||
@@ -72,13 +77,20 @@ define Download/ct-firmware
|
||||
URL_FILE:=$($(1)_FIRMWARE_FILE_CT)
|
||||
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
|
||||
$(call Download/ct-firmware,QCA988X,)
|
||||
HASH:=ad41b29a9eebf1066f993beb571f3bd13f14ea89336ef9d4f3b31ee57e7abe54
|
||||
HASH:=4112d78161a2c20e7a9490ea8d04e9f919508bafb097d88761dcce026c26f93f
|
||||
endef
|
||||
$(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
|
||||
define Download/ath10k-firmware-qca99x0-ct
|
||||
$(call Download/ct-firmware,QCA99X0,ath10k-10-4)
|
||||
@@ -107,6 +119,13 @@ $(Package/ath10k-firmware-default)
|
||||
CATEGORY:=Firmware
|
||||
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
|
||||
Alternative ath10k firmware for QCA988X from Candela Technologies.
|
||||
Enables IBSS and other features. See:
|
||||
@@ -116,6 +135,14 @@ is un-selected since the driver will try to load firmware-5.bin before
|
||||
firmware-2.bin
|
||||
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
|
||||
Alternative ath10k firmware for QCA99x0 from Candela Technologies.
|
||||
Enables IBSS and other features. See:
|
||||
@@ -177,18 +204,18 @@ define Download/qca99x0-board
|
||||
endef
|
||||
$(eval $(call Download,qca99x0-board))
|
||||
|
||||
QCA9984_BOARD_REV:=deb1832c56c706d0f6cb539113e09f0daaa52b5f
|
||||
QCA9984_BOARD_REV:=719c0127e52bd70559e71b85ab0331790e1bf66c
|
||||
QCA9984_BOARD_FILE:=board-2.bin
|
||||
QCA9984_BOARD_FILE_DL:=$(QCA9984_BOARD_FILE).$(QCA9984_BOARD_REV)
|
||||
QCA9984_FIRMWARE_REV:=deb1832c56c706d0f6cb539113e09f0daaa52b5f
|
||||
QCA9984_FIRMWARE_FILE:=firmware-5.bin_10.4-3.3-00102
|
||||
QCA9984_FIRMWARE_REV:=d43cb1188154037506e94abf3aa456cc934c6861
|
||||
QCA9984_FIRMWARE_FILE:=firmware-5.bin_10.4-3.4-00072
|
||||
QCA9984_FIRMWARE_FILE_DL:=$(QCA9984_FIRMWARE_FILE).$(QCA9984_FIRMWARE_REV)
|
||||
|
||||
define Download/ath10k-qca9984-board
|
||||
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)
|
||||
FILE:=$(QCA9984_BOARD_FILE_DL)
|
||||
HASH:=6a79ff0e8cc71549e771b41dbb7dad862d8e29da852f8aff25ce1e4bd5ea263e
|
||||
HASH:=e968b214fd76d5b7859f71841ce40fbd5f47336c3ccbaf95e23f902f5e569aef
|
||||
endef
|
||||
$(eval $(call Download,ath10k-qca9984-board))
|
||||
|
||||
@@ -196,7 +223,7 @@ define Download/ath10k-qca9984-firmware
|
||||
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)
|
||||
FILE:=$(QCA9984_FIRMWARE_FILE_DL)
|
||||
HASH:=490ad52df76a4fa8004a3a8c21dd43bb8262dd2816df48a6408706b82491f299
|
||||
HASH:=28d5834e8c4ca8fcef9ea033cd8b9b0f9ee84ecf30dbde84c9c64bf8dd9912bc
|
||||
endef
|
||||
$(eval $(call Download,ath10k-qca9984-firmware))
|
||||
|
||||
@@ -224,6 +251,16 @@ define Package/ath10k-firmware-qca988x/install
|
||||
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-5.bin
|
||||
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
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA988X/hw2.0
|
||||
$(INSTALL_DATA) \
|
||||
@@ -297,6 +334,7 @@ $(eval $(call BuildPackage,ath10k-firmware-qca99x0))
|
||||
$(eval $(call BuildPackage,ath10k-firmware-qca6174))
|
||||
$(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-qca99x0-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_FILES:=Licenses/README
|
||||
|
||||
PKG_FLAGS:=nonshared
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define fman/Default
|
||||
|
||||
@@ -20,6 +20,15 @@ define Package/mwifiex-pcie-firmware/install
|
||||
endef
|
||||
$(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)
|
||||
define Package/libertas-usb-firmware/install
|
||||
$(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_FILES:=Licenses/README
|
||||
|
||||
PKG_FLAGS:=nonshared
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
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_FILES:=Licenses/README
|
||||
|
||||
PKG_FLAGS:=nonshared
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define rcw/Default
|
||||
|
||||
@@ -81,3 +81,32 @@
|
||||
|
||||
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_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2017-01-10
|
||||
PKG_SOURCE_VERSION:=f5bacb83baf95e887c50c286606f4f565ef71d86
|
||||
PKG_MIRROR_HASH:=845950a177ed6dd7ad3f645df79403e9980f089a09b66e74a9b88abe58dfe5e6
|
||||
PKG_SOURCE_DATE:=2017-01-26
|
||||
PKG_SOURCE_VERSION:=d2bc84ff277936c58231f0c2280242eda4199e63
|
||||
PKG_MIRROR_HASH:=6b734b987db00b97b06faca686dcebc56fb23b93093afbb35d5cf534987269bf
|
||||
|
||||
PKG_MAINTAINER:=Ben Greear <greearb@candelatech.com>
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
@@ -23,7 +23,7 @@ include $(INCLUDE_DIR)/package.mk
|
||||
define KernelPackage/ath10k-ct
|
||||
SUBMENU:=Wireless Drivers
|
||||
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:=\
|
||||
$(PKG_BUILD_DIR)/ath10k/ath10k_pci.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) 2016 LEDE project
|
||||
# Copyright (C) 2017 LEDE project
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
@@ -9,8 +9,8 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=brcm2708-gpu-fw
|
||||
PKG_VERSION:=2016-12-04
|
||||
PKG_RELEASE:=d760a4ffd378c648ff5d9854e26dc868a5e1fd09
|
||||
PKG_VERSION:=2017-03-03
|
||||
PKG_RELEASE:=78c4983379de0537f49a97fb37ceaaf42632b28c
|
||||
|
||||
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
|
||||
URL:=$(RPI_FIRMWARE_URL)
|
||||
URL_FILE:=bootcode.bin
|
||||
HASH:=a11bd31647c25712648757be75a19fa78c1df6f2409c7bf9bd202903f0421c0c
|
||||
HASH:=d990031baec20fe2cd5e24d9f3d6fc34891afdb128838d010d9a0249ae29ea6b
|
||||
endef
|
||||
$(eval $(call Download,bootcode_bin))
|
||||
|
||||
@@ -41,7 +41,7 @@ define Download/fixup_dat
|
||||
FILE:=$(RPI_FIRMWARE_FILE)-fixup.dat
|
||||
URL:=$(RPI_FIRMWARE_URL)
|
||||
URL_FILE:=fixup.dat
|
||||
HASH:=93314d9e01fb53bdf4a25422de89d103cd2e779bd5e81663c658eaecd0c8018e
|
||||
HASH:=38b69384f62bc7b64f17dcedc03c5582af6b4f8dfc25fe5904d4eb3181a3387b
|
||||
endef
|
||||
$(eval $(call Download,fixup_dat))
|
||||
|
||||
@@ -49,7 +49,7 @@ define Download/fixup_cd_dat
|
||||
FILE:=$(RPI_FIRMWARE_FILE)-fixup_cd.dat
|
||||
URL:=$(RPI_FIRMWARE_URL)
|
||||
URL_FILE:=fixup_cd.dat
|
||||
HASH:=638671b81590bfdda5eac683d2025e50bb71c663e702f047ef299e23722f6cdd
|
||||
HASH:=05c682ffcc74cd1356f1b9a32a7034763bfea94e5cb54eaaa2e69affc1cd33d7
|
||||
endef
|
||||
$(eval $(call Download,fixup_cd_dat))
|
||||
|
||||
@@ -57,7 +57,7 @@ define Download/start_elf
|
||||
FILE:=$(RPI_FIRMWARE_FILE)-start.elf
|
||||
URL:=$(RPI_FIRMWARE_URL)
|
||||
URL_FILE:=start.elf
|
||||
HASH:=cd60fdce9022fa1195a27f3fdf8eba9136476649006e33b72cbdb23dc3b74e90
|
||||
HASH:=59b9d26b463a84f017fae186493bb54e642de6c7e0376b3cbe3375df6132edc0
|
||||
endef
|
||||
$(eval $(call Download,start_elf))
|
||||
|
||||
@@ -65,7 +65,7 @@ define Download/start_cd_elf
|
||||
FILE:=$(RPI_FIRMWARE_FILE)-start_cd.elf
|
||||
URL:=$(RPI_FIRMWARE_URL)
|
||||
URL_FILE:=start_cd.elf
|
||||
HASH:=2f0cdcdaad7b9bf64f5288e206d54e007597c0c4068a5b893c02e0f4c0785ca5
|
||||
HASH:=fb9aea03eb6790062c100166444bf7d2b8a6cea605bd041f905fcacefacbbae2
|
||||
endef
|
||||
$(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_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/kdarbyshirebryant/sch_cake.git
|
||||
PKG_SOURCE_DATE:=2016-12-19
|
||||
PKG_SOURCE_VERSION:=70c8eb766d5afcf3cf187594b7cd776da92bee3c
|
||||
PKG_MIRROR_HASH:=16174db5dad0a5b5ba522d4cfc058cff9851ed013a3a05166b04eb127bb12a24
|
||||
PKG_SOURCE_URL:=https://github.com/dtaht/sch_cake.git
|
||||
PKG_SOURCE_DATE:=2017-01-28
|
||||
PKG_SOURCE_VERSION:=9789742cfc596d48583ba4cdbc8f38d026121fa6
|
||||
PKG_MIRROR_HASH:=2a5afc45722c28ca8778eb50452eb305306e7898b32d7d6d73d3e77edf3cce99
|
||||
PKG_MAINTAINER:=Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
|
||||
|
||||
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);
|
||||
@@ -495,7 +495,7 @@ $(eval $(call KernelPackage,ipt-tproxy))
|
||||
|
||||
define KernelPackage/ipt-tee
|
||||
TITLE:=TEE support
|
||||
DEPENDS:=+kmod-ipt-conntrack @!LINUX_4_4
|
||||
DEPENDS:=+kmod-ipt-conntrack
|
||||
KCONFIG:= \
|
||||
CONFIG_NETFILTER_XT_TARGET_TEE
|
||||
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_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_EXTRA = $(filter-out $(SCHED_MODULES_FILTER),$(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:= \
|
||||
CONFIG_NET_SCHED=y \
|
||||
CONFIG_NET_SCH_HFSC \
|
||||
CONFIG_NET_SCH_HTB \
|
||||
CONFIG_NET_SCH_TBF \
|
||||
CONFIG_NET_SCH_INGRESS \
|
||||
CONFIG_NET_SCH_FQ_CODEL \
|
||||
CONFIG_NET_CLS=y \
|
||||
@@ -789,12 +791,10 @@ define KernelPackage/sched
|
||||
KCONFIG:= \
|
||||
CONFIG_NET_SCH_CODEL \
|
||||
CONFIG_NET_SCH_DSMARK \
|
||||
CONFIG_NET_SCH_HTB \
|
||||
CONFIG_NET_SCH_FIFO \
|
||||
CONFIG_NET_SCH_GRED \
|
||||
CONFIG_NET_SCH_PRIO \
|
||||
CONFIG_NET_SCH_RED \
|
||||
CONFIG_NET_SCH_TBF \
|
||||
CONFIG_NET_SCH_SFQ \
|
||||
CONFIG_NET_SCH_TEQL \
|
||||
CONFIG_NET_SCH_FQ \
|
||||
|
||||
@@ -147,6 +147,38 @@ endef
|
||||
$(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
|
||||
SUBMENU:=Native Language Support
|
||||
TITLE:=Codepage 1250 (Eastern Europe)
|
||||
|
||||
@@ -10,13 +10,13 @@ include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=mac80211
|
||||
|
||||
PKG_VERSION:=2016-10-08
|
||||
PKG_VERSION:=2017-01-31
|
||||
PKG_RELEASE:=1
|
||||
PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources
|
||||
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_PARALLEL:=1
|
||||
|
||||
@@ -35,7 +35,7 @@ PKG_DRIVERS = \
|
||||
libertas-sdio libertas-usb libertas-spi \
|
||||
mac80211-hwsim \
|
||||
mt7601u \
|
||||
mwl8k mwifiex-pcie \
|
||||
mwl8k mwifiex-pcie mwifiex-sdio \
|
||||
p54-common p54-pci p54-spi p54-usb \
|
||||
rt2x00-lib rt2x00-pci rt2x00-usb \
|
||||
rt2400-pci rt2500-pci rt2500-usb \
|
||||
@@ -248,7 +248,7 @@ define KernelPackage/ath9k/config
|
||||
depends on PACKAGE_kmod-ath9k
|
||||
|
||||
config ATH9K_TX99
|
||||
bool "Enable TX99 support"
|
||||
bool "Enable TX99 support (WARNING: testing only, breaks normal operation!)"
|
||||
depends on PACKAGE_kmod-ath9k
|
||||
|
||||
config ATH9K_UBNTHSR
|
||||
@@ -1022,7 +1022,7 @@ endef
|
||||
define KernelPackage/mac80211-hwsim
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
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
|
||||
AUTOLOAD:=$(call AutoProbe,mac80211_hwsim)
|
||||
endef
|
||||
@@ -1055,7 +1055,7 @@ define KernelPackage/mwifiex-pcie
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Driver for Marvell 802.11n/802.11ac PCIe Wireless cards
|
||||
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:= \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/marvell/mwifiex/mwifiex.ko \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/marvell/mwifiex/mwifiex_pcie.ko
|
||||
@@ -1066,6 +1066,21 @@ define KernelPackage/mwifiex-pcie/description
|
||||
Kernel modules for Marvell 802.11n/802.11ac PCIe Wireless cards
|
||||
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
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Prism54 Drivers
|
||||
@@ -1598,6 +1613,7 @@ config-$(call config_package,libertas-usb) += LIBERTAS LIBERTAS_USB
|
||||
config-$(call config_package,libertas-spi) += LIBERTAS LIBERTAS_SPI
|
||||
config-$(call config_package,mwl8k) += MWL8K
|
||||
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,rtl8187) += RTL8187
|
||||
config-$(call config_package,wlcore) += WLCORE WLCORE_SDIO
|
||||
@@ -1793,6 +1809,7 @@ $(eval $(call KernelPackage,mac80211-hwsim))
|
||||
$(eval $(call KernelPackage,mt7601u))
|
||||
$(eval $(call KernelPackage,mwl8k))
|
||||
$(eval $(call KernelPackage,mwifiex-pcie))
|
||||
$(eval $(call KernelPackage,mwifiex-sdio))
|
||||
$(eval $(call KernelPackage,p54-common))
|
||||
$(eval $(call KernelPackage,p54-pci))
|
||||
$(eval $(call KernelPackage,p54-usb))
|
||||
|
||||
@@ -756,7 +756,7 @@ drv_mac80211_setup() {
|
||||
for_each_interface "ap" mac80211_prepare_vif
|
||||
|
||||
[ -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="$?"
|
||||
wireless_add_process "$(cat /var/run/wifi-$phy.pid)" "/usr/sbin/hostapd" 1
|
||||
[ "$ret" != 0 ] && {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/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 listnewconfig:
|
||||
case olddefconfig:
|
||||
@@ -44,7 +44,7 @@
|
||||
break;
|
||||
--- a/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;
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
for_all_symbols(i, sym) {
|
||||
if (sym_has_value(sym) || (sym->flags & SYMBOL_VALID))
|
||||
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);
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/.local-symbols
|
||||
+++ b/.local-symbols
|
||||
@@ -477,45 +477,6 @@ USB_IPHETH=
|
||||
@@ -482,45 +482,6 @@ USB_IPHETH=
|
||||
USB_SIERRA_NET=
|
||||
USB_VL600=
|
||||
USB_NET_CH9200=
|
||||
@@ -88,7 +88,7 @@
|
||||
gpiodev = bus->chipco.dev ? : pcidev;
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/Makefile
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/Makefile
|
||||
@@ -43,6 +43,6 @@ brcmsmac-y := \
|
||||
@@ -42,6 +42,6 @@ brcmsmac-y := \
|
||||
brcms_trace_events.o \
|
||||
debug.o
|
||||
|
||||
|
||||
@@ -18,12 +18,12 @@
|
||||
- aes_gcm.o \
|
||||
aes_cmac.o \
|
||||
- aes_gmac.o \
|
||||
fils_aead.o \
|
||||
cfg.o \
|
||||
ethtool.o \
|
||||
rx.o \
|
||||
--- a/net/mac80211/aes_ccm.c
|
||||
+++ b/net/mac80211/aes_ccm.c
|
||||
@@ -13,89 +13,132 @@
|
||||
@@ -13,103 +13,132 @@
|
||||
#include <linux/types.h>
|
||||
#include <linux/err.h>
|
||||
#include <crypto/aead.h>
|
||||
@@ -33,17 +33,39 @@
|
||||
#include "key.h"
|
||||
#include "aes_ccm.h"
|
||||
|
||||
-void ieee80211_aes_ccm_encrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad,
|
||||
- u8 *data, size_t data_len, u8 *mic,
|
||||
- size_t mic_len)
|
||||
-int ieee80211_aes_ccm_encrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad,
|
||||
- u8 *data, size_t data_len, u8 *mic,
|
||||
- size_t mic_len)
|
||||
+static void aes_ccm_prepare(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, u8 *s_0,
|
||||
+ u8 *a, u8 *b)
|
||||
{
|
||||
- struct scatterlist sg[3];
|
||||
- struct aead_request *aead_req;
|
||||
- int reqsize = sizeof(*aead_req) + crypto_aead_reqsize(tfm);
|
||||
- u8 *__aad;
|
||||
-
|
||||
- aead_req = kzalloc(reqsize + CCM_AAD_LEN, GFP_ATOMIC);
|
||||
- if (!aead_req)
|
||||
- return -ENOMEM;
|
||||
-
|
||||
- __aad = (u8 *)aead_req + reqsize;
|
||||
- memcpy(__aad, aad, CCM_AAD_LEN);
|
||||
-
|
||||
- sg_init_table(sg, 3);
|
||||
- sg_set_buf(&sg[0], &__aad[2], be16_to_cpup((__be16 *)__aad));
|
||||
- sg_set_buf(&sg[1], data, data_len);
|
||||
- sg_set_buf(&sg[2], mic, mic_len);
|
||||
-
|
||||
- aead_request_set_tfm(aead_req, tfm);
|
||||
- aead_request_set_crypt(aead_req, sg, sg, data_len, b_0);
|
||||
- aead_request_set_ad(aead_req, sg[0].length);
|
||||
+ int i;
|
||||
+
|
||||
|
||||
- crypto_aead_encrypt(aead_req);
|
||||
- kzfree(aead_req);
|
||||
+ crypto_cipher_encrypt_one(tfm, b, b_0);
|
||||
+
|
||||
|
||||
- return 0;
|
||||
+ /* Extra Authenticate-only data (always two AES blocks) */
|
||||
+ for (i = 0; i < AES_BLOCK_SIZE; i++)
|
||||
+ aad[i] ^= b[i];
|
||||
@@ -54,29 +76,17 @@
|
||||
+ for (i = 0; i < AES_BLOCK_SIZE; i++)
|
||||
+ aad[i] ^= b[i];
|
||||
+ crypto_cipher_encrypt_one(tfm, a, aad);
|
||||
|
||||
- char aead_req_data[sizeof(struct aead_request) +
|
||||
- crypto_aead_reqsize(tfm)]
|
||||
- __aligned(__alignof__(struct aead_request));
|
||||
- struct aead_request *aead_req = (void *) aead_req_data;
|
||||
+
|
||||
+ /* Mask out bits from auth-only-b_0 */
|
||||
+ b_0[0] &= 0x07;
|
||||
|
||||
- memset(aead_req, 0, sizeof(aead_req_data));
|
||||
+
|
||||
+ /* S_0 is used to encrypt T (= MIC) */
|
||||
+ b_0[14] = 0;
|
||||
+ b_0[15] = 0;
|
||||
+ crypto_cipher_encrypt_one(tfm, s_0, b_0);
|
||||
+}
|
||||
|
||||
- sg_init_table(sg, 3);
|
||||
- sg_set_buf(&sg[0], &aad[2], be16_to_cpup((__be16 *)aad));
|
||||
- sg_set_buf(&sg[1], data, data_len);
|
||||
- sg_set_buf(&sg[2], mic, mic_len);
|
||||
|
||||
- aead_request_set_tfm(aead_req, tfm);
|
||||
- aead_request_set_crypt(aead_req, sg, sg, data_len, b_0);
|
||||
- aead_request_set_ad(aead_req, sg[0].length);
|
||||
+
|
||||
+
|
||||
+void ieee80211_aes_ccm_encrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad,
|
||||
+ u8 *data, size_t data_len, u8 *mic,
|
||||
+ size_t mic_len)
|
||||
@@ -109,8 +119,7 @@
|
||||
+ for (i = 0; i < blen; i++)
|
||||
+ *cpos++ = *pos++ ^ e[i];
|
||||
+ }
|
||||
|
||||
- crypto_aead_encrypt(aead_req);
|
||||
+
|
||||
+ for (i = 0; i < mic_len; i++)
|
||||
+ mic[i] = b[i] ^ s_0[i];
|
||||
}
|
||||
@@ -121,18 +130,23 @@
|
||||
size_t mic_len)
|
||||
{
|
||||
- struct scatterlist sg[3];
|
||||
- char aead_req_data[sizeof(struct aead_request) +
|
||||
- crypto_aead_reqsize(tfm)]
|
||||
- __aligned(__alignof__(struct aead_request));
|
||||
- struct aead_request *aead_req = (void *) aead_req_data;
|
||||
- struct aead_request *aead_req;
|
||||
- int reqsize = sizeof(*aead_req) + crypto_aead_reqsize(tfm);
|
||||
- u8 *__aad;
|
||||
- int err;
|
||||
-
|
||||
- if (data_len == 0)
|
||||
- return -EINVAL;
|
||||
-
|
||||
- memset(aead_req, 0, sizeof(aead_req_data));
|
||||
- aead_req = kzalloc(reqsize + CCM_AAD_LEN, GFP_ATOMIC);
|
||||
- if (!aead_req)
|
||||
- return -ENOMEM;
|
||||
-
|
||||
- __aad = (u8 *)aead_req + reqsize;
|
||||
- memcpy(__aad, aad, CCM_AAD_LEN);
|
||||
-
|
||||
- sg_init_table(sg, 3);
|
||||
- sg_set_buf(&sg[0], &aad[2], be16_to_cpup((__be16 *)aad));
|
||||
- sg_set_buf(&sg[0], &__aad[2], be16_to_cpup((__be16 *)__aad));
|
||||
- sg_set_buf(&sg[1], data, data_len);
|
||||
- sg_set_buf(&sg[2], mic, mic_len);
|
||||
-
|
||||
@@ -172,7 +186,10 @@
|
||||
+ return -1;
|
||||
+ }
|
||||
|
||||
- return crypto_aead_decrypt(aead_req);
|
||||
- err = crypto_aead_decrypt(aead_req);
|
||||
- kzfree(aead_req);
|
||||
-
|
||||
- return err;
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
@@ -215,73 +232,11 @@
|
||||
- crypto_free_aead(tfm);
|
||||
+ crypto_free_cipher(tfm);
|
||||
}
|
||||
--- a/net/mac80211/aes_ccm.h
|
||||
+++ b/net/mac80211/aes_ccm.h
|
||||
@@ -12,15 +12,15 @@
|
||||
|
||||
#include <linux/crypto.h>
|
||||
|
||||
-struct crypto_aead *ieee80211_aes_key_setup_encrypt(const u8 key[],
|
||||
- size_t key_len,
|
||||
- size_t mic_len);
|
||||
-void ieee80211_aes_ccm_encrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad,
|
||||
+struct crypto_cipher *ieee80211_aes_key_setup_encrypt(const u8 key[],
|
||||
+ size_t key_len,
|
||||
+ size_t mic_len);
|
||||
+void ieee80211_aes_ccm_encrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad,
|
||||
u8 *data, size_t data_len, u8 *mic,
|
||||
size_t mic_len);
|
||||
-int ieee80211_aes_ccm_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad,
|
||||
+int ieee80211_aes_ccm_decrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad,
|
||||
u8 *data, size_t data_len, u8 *mic,
|
||||
size_t mic_len);
|
||||
-void ieee80211_aes_key_free(struct crypto_aead *tfm);
|
||||
+void ieee80211_aes_key_free(struct crypto_cipher *tfm);
|
||||
|
||||
#endif /* AES_CCM_H */
|
||||
--- a/net/mac80211/aes_gcm.h
|
||||
+++ b/net/mac80211/aes_gcm.h
|
||||
@@ -11,12 +11,28 @@
|
||||
|
||||
#include <linux/crypto.h>
|
||||
|
||||
-void ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad,
|
||||
- u8 *data, size_t data_len, u8 *mic);
|
||||
-int ieee80211_aes_gcm_decrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad,
|
||||
- u8 *data, size_t data_len, u8 *mic);
|
||||
-struct crypto_aead *ieee80211_aes_gcm_key_setup_encrypt(const u8 key[],
|
||||
- size_t key_len);
|
||||
-void ieee80211_aes_gcm_key_free(struct crypto_aead *tfm);
|
||||
+static inline void
|
||||
+ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad,
|
||||
+ u8 *data, size_t data_len, u8 *mic)
|
||||
+{
|
||||
+}
|
||||
+
|
||||
+static inline int
|
||||
+ieee80211_aes_gcm_decrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad,
|
||||
+ u8 *data, size_t data_len, u8 *mic)
|
||||
+{
|
||||
+ return -EOPNOTSUPP;
|
||||
+}
|
||||
+
|
||||
+static inline struct crypto_aead *
|
||||
+ieee80211_aes_gcm_key_setup_encrypt(const u8 key[], size_t key_len)
|
||||
+{
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+static inline void
|
||||
+ieee80211_aes_gcm_key_free(struct crypto_aead *tfm)
|
||||
+{
|
||||
+}
|
||||
|
||||
#endif /* AES_GCM_H */
|
||||
--- a/net/mac80211/aes_gmac.h
|
||||
+++ b/net/mac80211/aes_gmac.h
|
||||
@@ -11,10 +11,22 @@
|
||||
|
||||
#include <linux/crypto.h>
|
||||
@@ -15,10 +15,22 @@
|
||||
#define GMAC_MIC_LEN 16
|
||||
#define GMAC_NONCE_LEN 12
|
||||
|
||||
-struct crypto_aead *ieee80211_aes_gmac_key_setup(const u8 key[],
|
||||
- size_t key_len);
|
||||
@@ -320,7 +275,7 @@
|
||||
struct {
|
||||
--- a/net/mac80211/wpa.c
|
||||
+++ b/net/mac80211/wpa.c
|
||||
@@ -304,7 +304,8 @@ ieee80211_crypto_tkip_decrypt(struct iee
|
||||
@@ -305,7 +305,8 @@ ieee80211_crypto_tkip_decrypt(struct iee
|
||||
}
|
||||
|
||||
|
||||
@@ -330,7 +285,7 @@
|
||||
{
|
||||
__le16 mask_fc;
|
||||
int a4_included, mgmt;
|
||||
@@ -334,14 +335,8 @@ static void ccmp_special_blocks(struct s
|
||||
@@ -335,14 +336,8 @@ static void ccmp_special_blocks(struct s
|
||||
else
|
||||
qos_tid = 0;
|
||||
|
||||
@@ -347,7 +302,7 @@
|
||||
|
||||
/* Nonce: Nonce Flags | A2 | PN
|
||||
* Nonce Flags: Priority (b0..b3) | Management (b4) | Reserved (b5..b7)
|
||||
@@ -349,6 +344,8 @@ static void ccmp_special_blocks(struct s
|
||||
@@ -350,6 +345,8 @@ static void ccmp_special_blocks(struct s
|
||||
b_0[1] = qos_tid | (mgmt << 4);
|
||||
memcpy(&b_0[2], hdr->addr2, ETH_ALEN);
|
||||
memcpy(&b_0[8], pn, IEEE80211_CCMP_PN_LEN);
|
||||
@@ -356,16 +311,31 @@
|
||||
|
||||
/* AAD (extra authenticate-only data) / masked 802.11 header
|
||||
* FC | A1 | A2 | A3 | SC | [A4] | [QC] */
|
||||
@@ -460,7 +457,7 @@ static int ccmp_encrypt_skb(struct ieee8
|
||||
@@ -406,7 +403,7 @@ static int ccmp_encrypt_skb(struct ieee8
|
||||
u8 *pos;
|
||||
u8 pn[6];
|
||||
u64 pn64;
|
||||
- u8 aad[CCM_AAD_LEN];
|
||||
+ u8 aad[2 * AES_BLOCK_SIZE];
|
||||
u8 b_0[AES_BLOCK_SIZE];
|
||||
|
||||
if (info->control.hw_key &&
|
||||
@@ -461,9 +458,11 @@ static int ccmp_encrypt_skb(struct ieee8
|
||||
return 0;
|
||||
|
||||
pos += IEEE80211_CCMP_HDR_LEN;
|
||||
- ccmp_special_blocks(skb, pn, b_0, aad);
|
||||
- return ieee80211_aes_ccm_encrypt(key->u.ccmp.tfm, b_0, aad, pos, len,
|
||||
- skb_put(skb, mic_len), mic_len);
|
||||
+ ccmp_special_blocks(skb, pn, b_0, aad, len);
|
||||
ieee80211_aes_ccm_encrypt(key->u.ccmp.tfm, b_0, aad, pos, len,
|
||||
skb_put(skb, mic_len), mic_len);
|
||||
+ ieee80211_aes_ccm_encrypt(key->u.ccmp.tfm, b_0, aad, pos, len,
|
||||
+ skb_put(skb, mic_len), mic_len);
|
||||
+
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
@@ -537,7 +534,7 @@ ieee80211_crypto_ccmp_decrypt(struct iee
|
||||
|
||||
@@ -536,7 +535,7 @@ ieee80211_crypto_ccmp_decrypt(struct iee
|
||||
u8 aad[2 * AES_BLOCK_SIZE];
|
||||
u8 b_0[AES_BLOCK_SIZE];
|
||||
/* hardware didn't decrypt/verify MIC */
|
||||
@@ -374,3 +344,113 @@
|
||||
|
||||
if (ieee80211_aes_ccm_decrypt(
|
||||
key->u.ccmp.tfm, b_0, aad,
|
||||
@@ -638,7 +637,7 @@ static int gcmp_encrypt_skb(struct ieee8
|
||||
u8 *pos;
|
||||
u8 pn[6];
|
||||
u64 pn64;
|
||||
- u8 aad[GCM_AAD_LEN];
|
||||
+ u8 aad[2 * AES_BLOCK_SIZE];
|
||||
u8 j_0[AES_BLOCK_SIZE];
|
||||
|
||||
if (info->control.hw_key &&
|
||||
@@ -695,8 +694,10 @@ static int gcmp_encrypt_skb(struct ieee8
|
||||
|
||||
pos += IEEE80211_GCMP_HDR_LEN;
|
||||
gcmp_special_blocks(skb, pn, j_0, aad);
|
||||
- return ieee80211_aes_gcm_encrypt(key->u.gcmp.tfm, j_0, aad, pos, len,
|
||||
- skb_put(skb, IEEE80211_GCMP_MIC_LEN));
|
||||
+ ieee80211_aes_gcm_encrypt(key->u.gcmp.tfm, j_0, aad, pos, len,
|
||||
+ skb_put(skb, IEEE80211_GCMP_MIC_LEN));
|
||||
+
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
ieee80211_tx_result
|
||||
@@ -1120,9 +1121,9 @@ ieee80211_crypto_aes_gmac_encrypt(struct
|
||||
struct ieee80211_key *key = tx->key;
|
||||
struct ieee80211_mmie_16 *mmie;
|
||||
struct ieee80211_hdr *hdr;
|
||||
- u8 aad[GMAC_AAD_LEN];
|
||||
+ u8 aad[20];
|
||||
u64 pn64;
|
||||
- u8 nonce[GMAC_NONCE_LEN];
|
||||
+ u8 nonce[12];
|
||||
|
||||
if (WARN_ON(skb_queue_len(&tx->skbs) != 1))
|
||||
return TX_DROP;
|
||||
@@ -1168,7 +1169,7 @@ ieee80211_crypto_aes_gmac_decrypt(struct
|
||||
struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
|
||||
struct ieee80211_key *key = rx->key;
|
||||
struct ieee80211_mmie_16 *mmie;
|
||||
- u8 aad[GMAC_AAD_LEN], mic[GMAC_MIC_LEN], ipn[6], nonce[GMAC_NONCE_LEN];
|
||||
+ u8 aad[20], mic[16], ipn[6], nonce[12];
|
||||
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
|
||||
|
||||
if (!ieee80211_is_mgmt(hdr->frame_control))
|
||||
--- a/net/mac80211/aes_ccm.h
|
||||
+++ b/net/mac80211/aes_ccm.h
|
||||
@@ -12,17 +12,15 @@
|
||||
|
||||
#include <linux/crypto.h>
|
||||
|
||||
-#define CCM_AAD_LEN 32
|
||||
-
|
||||
-struct crypto_aead *ieee80211_aes_key_setup_encrypt(const u8 key[],
|
||||
- size_t key_len,
|
||||
- size_t mic_len);
|
||||
-int ieee80211_aes_ccm_encrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad,
|
||||
- u8 *data, size_t data_len, u8 *mic,
|
||||
- size_t mic_len);
|
||||
-int ieee80211_aes_ccm_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad,
|
||||
+struct crypto_cipher *ieee80211_aes_key_setup_encrypt(const u8 key[],
|
||||
+ size_t key_len,
|
||||
+ size_t mic_len);
|
||||
+void ieee80211_aes_ccm_encrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad,
|
||||
+ u8 *data, size_t data_len, u8 *mic,
|
||||
+ size_t mic_len);
|
||||
+int ieee80211_aes_ccm_decrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad,
|
||||
u8 *data, size_t data_len, u8 *mic,
|
||||
size_t mic_len);
|
||||
-void ieee80211_aes_key_free(struct crypto_aead *tfm);
|
||||
+void ieee80211_aes_key_free(struct crypto_cipher *tfm);
|
||||
|
||||
#endif /* AES_CCM_H */
|
||||
--- a/net/mac80211/aes_gcm.h
|
||||
+++ b/net/mac80211/aes_gcm.h
|
||||
@@ -11,14 +11,28 @@
|
||||
|
||||
#include <linux/crypto.h>
|
||||
|
||||
-#define GCM_AAD_LEN 32
|
||||
+static inline void
|
||||
+ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad,
|
||||
+ u8 *data, size_t data_len, u8 *mic)
|
||||
+{
|
||||
+}
|
||||
|
||||
-int ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad,
|
||||
- u8 *data, size_t data_len, u8 *mic);
|
||||
-int ieee80211_aes_gcm_decrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad,
|
||||
- u8 *data, size_t data_len, u8 *mic);
|
||||
-struct crypto_aead *ieee80211_aes_gcm_key_setup_encrypt(const u8 key[],
|
||||
- size_t key_len);
|
||||
-void ieee80211_aes_gcm_key_free(struct crypto_aead *tfm);
|
||||
+static inline int
|
||||
+ieee80211_aes_gcm_decrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad,
|
||||
+ u8 *data, size_t data_len, u8 *mic)
|
||||
+{
|
||||
+ return -EOPNOTSUPP;
|
||||
+}
|
||||
+
|
||||
+static inline struct crypto_aead *
|
||||
+ieee80211_aes_gcm_key_setup_encrypt(const u8 key[], size_t key_len)
|
||||
+{
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+static inline void
|
||||
+ieee80211_aes_gcm_key_free(struct crypto_aead *tfm)
|
||||
+{
|
||||
+}
|
||||
|
||||
#endif /* AES_GCM_H */
|
||||
|
||||
@@ -2,7 +2,7 @@ Used for AP+STA support in OpenWrt - preserve AP mode keys across STA reconnects
|
||||
|
||||
--- a/net/mac80211/cfg.c
|
||||
+++ b/net/mac80211/cfg.c
|
||||
@@ -1016,7 +1016,6 @@ static int ieee80211_stop_ap(struct wiph
|
||||
@@ -1014,7 +1014,6 @@ static int ieee80211_stop_ap(struct wiph
|
||||
sdata->u.ap.driver_smps_mode = IEEE80211_SMPS_OFF;
|
||||
|
||||
__sta_info_flush(sdata, true);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/drivers/net/wireless/mac80211_hwsim.c
|
||||
+++ b/drivers/net/wireless/mac80211_hwsim.c
|
||||
@@ -2662,7 +2662,7 @@ static int mac80211_hwsim_new_radio(stru
|
||||
@@ -2678,7 +2678,7 @@ static int mac80211_hwsim_new_radio(stru
|
||||
|
||||
tasklet_hrtimer_init(&data->beacon_timer,
|
||||
mac80211_hwsim_beacon,
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
static int ieee80211_ifa6_changed(struct notifier_block *nb,
|
||||
unsigned long data, void *arg)
|
||||
{
|
||||
@@ -1101,14 +1101,14 @@ int ieee80211_register_hw(struct ieee802
|
||||
@@ -1111,14 +1111,14 @@ int ieee80211_register_hw(struct ieee802
|
||||
if (result)
|
||||
goto fail_flows;
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
local->ifa6_notifier.notifier_call = ieee80211_ifa6_changed;
|
||||
result = register_inet6addr_notifier(&local->ifa6_notifier);
|
||||
if (result)
|
||||
@@ -1117,13 +1117,13 @@ int ieee80211_register_hw(struct ieee802
|
||||
@@ -1127,13 +1127,13 @@ int ieee80211_register_hw(struct ieee802
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
fail_ifa:
|
||||
#endif
|
||||
ieee80211_txq_teardown_flows(local);
|
||||
@@ -1153,10 +1153,10 @@ void ieee80211_unregister_hw(struct ieee
|
||||
@@ -1163,10 +1163,10 @@ void ieee80211_unregister_hw(struct ieee
|
||||
tasklet_kill(&local->tx_pending_tasklet);
|
||||
tasklet_kill(&local->tasklet);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/mac80211/cfg.c
|
||||
+++ b/net/mac80211/cfg.c
|
||||
@@ -2175,7 +2175,7 @@ static int ieee80211_scan(struct wiphy *
|
||||
@@ -2165,7 +2165,7 @@ static int ieee80211_scan(struct wiphy *
|
||||
* the frames sent while scanning on other channel will be
|
||||
* lost)
|
||||
*/
|
||||
|
||||
@@ -1,953 +0,0 @@
|
||||
From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= <toke@toke.dk>
|
||||
Date: Fri, 2 Sep 2016 16:00:30 +0200
|
||||
Subject: [PATCH] ath9k: Switch to using mac80211 intermediate software
|
||||
queues.
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This switches ath9k over to using the mac80211 intermediate software
|
||||
queueing mechanism for data packets. It removes the queueing inside the
|
||||
driver, except for the retry queue, and instead pulls from mac80211 when
|
||||
a packet is needed. The retry queue is used to store a packet that was
|
||||
pulled but can't be sent immediately.
|
||||
|
||||
The old code path in ath_tx_start that would queue packets has been
|
||||
removed completely, as has the qlen limit tunables (since there's no
|
||||
longer a queue in the driver to limit).
|
||||
|
||||
Based on Tim's original patch set, but reworked quite thoroughly.
|
||||
|
||||
Cc: Tim Shepard <shep@alum.mit.edu>
|
||||
Cc: Felix Fietkau <nbd@nbd.name>
|
||||
Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
|
||||
---
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
|
||||
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
|
||||
@@ -91,7 +91,6 @@ int ath_descdma_setup(struct ath_softc *
|
||||
#define ATH_RXBUF 512
|
||||
#define ATH_TXBUF 512
|
||||
#define ATH_TXBUF_RESERVE 5
|
||||
-#define ATH_MAX_QDEPTH (ATH_TXBUF / 4 - ATH_TXBUF_RESERVE)
|
||||
#define ATH_TXMAXTRY 13
|
||||
#define ATH_MAX_SW_RETRIES 30
|
||||
|
||||
@@ -145,7 +144,7 @@ int ath_descdma_setup(struct ath_softc *
|
||||
#define BAW_WITHIN(_start, _bawsz, _seqno) \
|
||||
((((_seqno) - (_start)) & 4095) < (_bawsz))
|
||||
|
||||
-#define ATH_AN_2_TID(_an, _tidno) (&(_an)->tid[(_tidno)])
|
||||
+#define ATH_AN_2_TID(_an, _tidno) ath_node_to_tid(_an, _tidno)
|
||||
|
||||
#define IS_HT_RATE(rate) (rate & 0x80)
|
||||
#define IS_CCK_RATE(rate) ((rate >= 0x18) && (rate <= 0x1e))
|
||||
@@ -164,7 +163,6 @@ struct ath_txq {
|
||||
spinlock_t axq_lock;
|
||||
u32 axq_depth;
|
||||
u32 axq_ampdu_depth;
|
||||
- bool stopped;
|
||||
bool axq_tx_inprogress;
|
||||
struct list_head txq_fifo[ATH_TXFIFO_DEPTH];
|
||||
u8 txq_headidx;
|
||||
@@ -232,7 +230,6 @@ struct ath_buf {
|
||||
|
||||
struct ath_atx_tid {
|
||||
struct list_head list;
|
||||
- struct sk_buff_head buf_q;
|
||||
struct sk_buff_head retry_q;
|
||||
struct ath_node *an;
|
||||
struct ath_txq *txq;
|
||||
@@ -247,13 +244,13 @@ struct ath_atx_tid {
|
||||
s8 bar_index;
|
||||
bool active;
|
||||
bool clear_ps_filter;
|
||||
+ bool has_queued;
|
||||
};
|
||||
|
||||
struct ath_node {
|
||||
struct ath_softc *sc;
|
||||
struct ieee80211_sta *sta; /* station struct we're part of */
|
||||
struct ieee80211_vif *vif; /* interface with which we're associated */
|
||||
- struct ath_atx_tid tid[IEEE80211_NUM_TIDS];
|
||||
|
||||
u16 maxampdu;
|
||||
u8 mpdudensity;
|
||||
@@ -276,7 +273,6 @@ struct ath_tx_control {
|
||||
struct ath_node *an;
|
||||
struct ieee80211_sta *sta;
|
||||
u8 paprd;
|
||||
- bool force_channel;
|
||||
};
|
||||
|
||||
|
||||
@@ -293,7 +289,6 @@ struct ath_tx {
|
||||
struct ath_descdma txdma;
|
||||
struct ath_txq *txq_map[IEEE80211_NUM_ACS];
|
||||
struct ath_txq *uapsdq;
|
||||
- u32 txq_max_pending[IEEE80211_NUM_ACS];
|
||||
u16 max_aggr_framelen[IEEE80211_NUM_ACS][4][32];
|
||||
};
|
||||
|
||||
@@ -421,6 +416,22 @@ struct ath_offchannel {
|
||||
int duration;
|
||||
};
|
||||
|
||||
+static inline struct ath_atx_tid *
|
||||
+ath_node_to_tid(struct ath_node *an, u8 tidno)
|
||||
+{
|
||||
+ struct ieee80211_sta *sta = an->sta;
|
||||
+ struct ieee80211_vif *vif = an->vif;
|
||||
+ struct ieee80211_txq *txq;
|
||||
+
|
||||
+ BUG_ON(!vif);
|
||||
+ if (sta)
|
||||
+ txq = sta->txq[tidno % ARRAY_SIZE(sta->txq)];
|
||||
+ else
|
||||
+ txq = vif->txq;
|
||||
+
|
||||
+ return (struct ath_atx_tid *) txq->drv_priv;
|
||||
+}
|
||||
+
|
||||
#define case_rtn_string(val) case val: return #val
|
||||
|
||||
#define ath_for_each_chanctx(_sc, _ctx) \
|
||||
@@ -575,7 +586,6 @@ void ath_tx_edma_tasklet(struct ath_soft
|
||||
int ath_tx_aggr_start(struct ath_softc *sc, struct ieee80211_sta *sta,
|
||||
u16 tid, u16 *ssn);
|
||||
void ath_tx_aggr_stop(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid);
|
||||
-void ath_tx_aggr_resume(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid);
|
||||
|
||||
void ath_tx_aggr_wakeup(struct ath_softc *sc, struct ath_node *an);
|
||||
void ath_tx_aggr_sleep(struct ieee80211_sta *sta, struct ath_softc *sc,
|
||||
@@ -585,6 +595,7 @@ void ath9k_release_buffered_frames(struc
|
||||
u16 tids, int nframes,
|
||||
enum ieee80211_frame_release_type reason,
|
||||
bool more_data);
|
||||
+void ath9k_wake_tx_queue(struct ieee80211_hw *hw, struct ieee80211_txq *queue);
|
||||
|
||||
/********/
|
||||
/* VIFs */
|
||||
--- a/drivers/net/wireless/ath/ath9k/channel.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/channel.c
|
||||
@@ -1010,7 +1010,6 @@ static void ath_scan_send_probe(struct a
|
||||
goto error;
|
||||
|
||||
txctl.txq = sc->tx.txq_map[IEEE80211_AC_VO];
|
||||
- txctl.force_channel = true;
|
||||
if (ath_tx_start(sc->hw, skb, &txctl))
|
||||
goto error;
|
||||
|
||||
@@ -1133,7 +1132,6 @@ ath_chanctx_send_vif_ps_frame(struct ath
|
||||
memset(&txctl, 0, sizeof(txctl));
|
||||
txctl.txq = sc->tx.txq_map[IEEE80211_AC_VO];
|
||||
txctl.sta = sta;
|
||||
- txctl.force_channel = true;
|
||||
if (ath_tx_start(sc->hw, skb, &txctl)) {
|
||||
ieee80211_free_txskb(sc->hw, skb);
|
||||
return false;
|
||||
--- a/drivers/net/wireless/ath/ath9k/debug.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/debug.c
|
||||
@@ -600,7 +600,6 @@ static int read_file_xmit(struct seq_fil
|
||||
PR("MPDUs XRetried: ", xretries);
|
||||
PR("Aggregates: ", a_aggr);
|
||||
PR("AMPDUs Queued HW:", a_queued_hw);
|
||||
- PR("AMPDUs Queued SW:", a_queued_sw);
|
||||
PR("AMPDUs Completed:", a_completed);
|
||||
PR("AMPDUs Retried: ", a_retries);
|
||||
PR("AMPDUs XRetried: ", a_xretries);
|
||||
@@ -629,8 +628,7 @@ static void print_queue(struct ath_softc
|
||||
seq_printf(file, "%s: %d ", "qnum", txq->axq_qnum);
|
||||
seq_printf(file, "%s: %2d ", "qdepth", txq->axq_depth);
|
||||
seq_printf(file, "%s: %2d ", "ampdu-depth", txq->axq_ampdu_depth);
|
||||
- seq_printf(file, "%s: %3d ", "pending", txq->pending_frames);
|
||||
- seq_printf(file, "%s: %d\n", "stopped", txq->stopped);
|
||||
+ seq_printf(file, "%s: %3d\n", "pending", txq->pending_frames);
|
||||
|
||||
ath_txq_unlock(sc, txq);
|
||||
}
|
||||
@@ -1208,7 +1206,6 @@ static const char ath9k_gstrings_stats[]
|
||||
AMKSTR(d_tx_mpdu_xretries),
|
||||
AMKSTR(d_tx_aggregates),
|
||||
AMKSTR(d_tx_ampdus_queued_hw),
|
||||
- AMKSTR(d_tx_ampdus_queued_sw),
|
||||
AMKSTR(d_tx_ampdus_completed),
|
||||
AMKSTR(d_tx_ampdu_retries),
|
||||
AMKSTR(d_tx_ampdu_xretries),
|
||||
@@ -1288,7 +1285,6 @@ void ath9k_get_et_stats(struct ieee80211
|
||||
AWDATA(xretries);
|
||||
AWDATA(a_aggr);
|
||||
AWDATA(a_queued_hw);
|
||||
- AWDATA(a_queued_sw);
|
||||
AWDATA(a_completed);
|
||||
AWDATA(a_retries);
|
||||
AWDATA(a_xretries);
|
||||
@@ -1346,14 +1342,6 @@ int ath9k_init_debug(struct ath_hw *ah)
|
||||
read_file_xmit);
|
||||
debugfs_create_devm_seqfile(sc->dev, "queues", sc->debug.debugfs_phy,
|
||||
read_file_queues);
|
||||
- debugfs_create_u32("qlen_bk", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
|
||||
- &sc->tx.txq_max_pending[IEEE80211_AC_BK]);
|
||||
- debugfs_create_u32("qlen_be", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
|
||||
- &sc->tx.txq_max_pending[IEEE80211_AC_BE]);
|
||||
- debugfs_create_u32("qlen_vi", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
|
||||
- &sc->tx.txq_max_pending[IEEE80211_AC_VI]);
|
||||
- debugfs_create_u32("qlen_vo", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
|
||||
- &sc->tx.txq_max_pending[IEEE80211_AC_VO]);
|
||||
debugfs_create_devm_seqfile(sc->dev, "misc", sc->debug.debugfs_phy,
|
||||
read_file_misc);
|
||||
debugfs_create_devm_seqfile(sc->dev, "reset", sc->debug.debugfs_phy,
|
||||
--- a/drivers/net/wireless/ath/ath9k/debug.h
|
||||
+++ b/drivers/net/wireless/ath/ath9k/debug.h
|
||||
@@ -147,7 +147,6 @@ struct ath_interrupt_stats {
|
||||
* @completed: Total MPDUs (non-aggr) completed
|
||||
* @a_aggr: Total no. of aggregates queued
|
||||
* @a_queued_hw: Total AMPDUs queued to hardware
|
||||
- * @a_queued_sw: Total AMPDUs queued to software queues
|
||||
* @a_completed: Total AMPDUs completed
|
||||
* @a_retries: No. of AMPDUs retried (SW)
|
||||
* @a_xretries: No. of AMPDUs dropped due to xretries
|
||||
@@ -174,7 +173,6 @@ struct ath_tx_stats {
|
||||
u32 xretries;
|
||||
u32 a_aggr;
|
||||
u32 a_queued_hw;
|
||||
- u32 a_queued_sw;
|
||||
u32 a_completed;
|
||||
u32 a_retries;
|
||||
u32 a_xretries;
|
||||
--- a/drivers/net/wireless/ath/ath9k/debug_sta.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/debug_sta.c
|
||||
@@ -52,8 +52,8 @@ static ssize_t read_file_node_aggr(struc
|
||||
"TID", "SEQ_START", "SEQ_NEXT", "BAW_SIZE",
|
||||
"BAW_HEAD", "BAW_TAIL", "BAR_IDX", "SCHED", "PAUSED");
|
||||
|
||||
- for (tidno = 0, tid = &an->tid[tidno];
|
||||
- tidno < IEEE80211_NUM_TIDS; tidno++, tid++) {
|
||||
+ for (tidno = 0; tidno < IEEE80211_NUM_TIDS; tidno++) {
|
||||
+ tid = ath_node_to_tid(an, tidno);
|
||||
txq = tid->txq;
|
||||
ath_txq_lock(sc, txq);
|
||||
if (tid->active) {
|
||||
--- a/drivers/net/wireless/ath/ath9k/init.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/init.c
|
||||
@@ -358,7 +358,6 @@ static int ath9k_init_queues(struct ath_
|
||||
for (i = 0; i < IEEE80211_NUM_ACS; i++) {
|
||||
sc->tx.txq_map[i] = ath_txq_setup(sc, ATH9K_TX_QUEUE_DATA, i);
|
||||
sc->tx.txq_map[i]->mac80211_qnum = i;
|
||||
- sc->tx.txq_max_pending[i] = ATH_MAX_QDEPTH;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -877,6 +876,7 @@ static void ath9k_set_hw_capab(struct at
|
||||
hw->max_rate_tries = 10;
|
||||
hw->sta_data_size = sizeof(struct ath_node);
|
||||
hw->vif_data_size = sizeof(struct ath_vif);
|
||||
+ hw->txq_data_size = sizeof(struct ath_atx_tid);
|
||||
hw->extra_tx_headroom = 4;
|
||||
|
||||
hw->wiphy->available_antennas_rx = BIT(ah->caps.max_rxchains) - 1;
|
||||
--- a/drivers/net/wireless/ath/ath9k/main.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/main.c
|
||||
@@ -1902,9 +1902,11 @@ static int ath9k_ampdu_action(struct iee
|
||||
bool flush = false;
|
||||
int ret = 0;
|
||||
struct ieee80211_sta *sta = params->sta;
|
||||
+ struct ath_node *an = (struct ath_node *)sta->drv_priv;
|
||||
enum ieee80211_ampdu_mlme_action action = params->action;
|
||||
u16 tid = params->tid;
|
||||
u16 *ssn = ¶ms->ssn;
|
||||
+ struct ath_atx_tid *atid;
|
||||
|
||||
mutex_lock(&sc->mutex);
|
||||
|
||||
@@ -1937,9 +1939,9 @@ static int ath9k_ampdu_action(struct iee
|
||||
ath9k_ps_restore(sc);
|
||||
break;
|
||||
case IEEE80211_AMPDU_TX_OPERATIONAL:
|
||||
- ath9k_ps_wakeup(sc);
|
||||
- ath_tx_aggr_resume(sc, sta, tid);
|
||||
- ath9k_ps_restore(sc);
|
||||
+ atid = ath_node_to_tid(an, tid);
|
||||
+ atid->baw_size = IEEE80211_MIN_AMPDU_BUF <<
|
||||
+ sta->ht_cap.ampdu_factor;
|
||||
break;
|
||||
default:
|
||||
ath_err(ath9k_hw_common(sc->sc_ah), "Unknown AMPDU action\n");
|
||||
@@ -2701,4 +2703,5 @@ struct ieee80211_ops ath9k_ops = {
|
||||
.sw_scan_start = ath9k_sw_scan_start,
|
||||
.sw_scan_complete = ath9k_sw_scan_complete,
|
||||
.get_txpower = ath9k_get_txpower,
|
||||
+ .wake_tx_queue = ath9k_wake_tx_queue,
|
||||
};
|
||||
--- a/drivers/net/wireless/ath/ath9k/xmit.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
|
||||
@@ -67,6 +67,8 @@ static struct ath_buf *ath_tx_setup_buff
|
||||
struct ath_txq *txq,
|
||||
struct ath_atx_tid *tid,
|
||||
struct sk_buff *skb);
|
||||
+static int ath_tx_prepare(struct ieee80211_hw *hw, struct sk_buff *skb,
|
||||
+ struct ath_tx_control *txctl);
|
||||
|
||||
enum {
|
||||
MCS_HT20,
|
||||
@@ -137,6 +139,26 @@ static void ath_tx_queue_tid(struct ath_
|
||||
list_add_tail(&tid->list, list);
|
||||
}
|
||||
|
||||
+void ath9k_wake_tx_queue(struct ieee80211_hw *hw, struct ieee80211_txq *queue)
|
||||
+{
|
||||
+ struct ath_softc *sc = hw->priv;
|
||||
+ struct ath_common *common = ath9k_hw_common(sc->sc_ah);
|
||||
+ struct ath_atx_tid *tid = (struct ath_atx_tid *) queue->drv_priv;
|
||||
+ struct ath_txq *txq = tid->txq;
|
||||
+
|
||||
+ ath_dbg(common, QUEUE, "Waking TX queue: %pM (%d)\n",
|
||||
+ queue->sta ? queue->sta->addr : queue->vif->addr,
|
||||
+ tid->tidno);
|
||||
+
|
||||
+ ath_txq_lock(sc, txq);
|
||||
+
|
||||
+ tid->has_queued = true;
|
||||
+ ath_tx_queue_tid(sc, txq, tid);
|
||||
+ ath_txq_schedule(sc, txq);
|
||||
+
|
||||
+ ath_txq_unlock(sc, txq);
|
||||
+}
|
||||
+
|
||||
static struct ath_frame_info *get_frame_info(struct sk_buff *skb)
|
||||
{
|
||||
struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
|
||||
@@ -164,7 +186,6 @@ static void ath_set_rates(struct ieee802
|
||||
static void ath_txq_skb_done(struct ath_softc *sc, struct ath_txq *txq,
|
||||
struct sk_buff *skb)
|
||||
{
|
||||
- struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
|
||||
struct ath_frame_info *fi = get_frame_info(skb);
|
||||
int q = fi->txq;
|
||||
|
||||
@@ -175,14 +196,6 @@ static void ath_txq_skb_done(struct ath_
|
||||
if (WARN_ON(--txq->pending_frames < 0))
|
||||
txq->pending_frames = 0;
|
||||
|
||||
- if (txq->stopped &&
|
||||
- txq->pending_frames < sc->tx.txq_max_pending[q]) {
|
||||
- if (ath9k_is_chanctx_enabled())
|
||||
- ieee80211_wake_queue(sc->hw, info->hw_queue);
|
||||
- else
|
||||
- ieee80211_wake_queue(sc->hw, q);
|
||||
- txq->stopped = false;
|
||||
- }
|
||||
}
|
||||
|
||||
static struct ath_atx_tid *
|
||||
@@ -192,9 +205,48 @@ ath_get_skb_tid(struct ath_softc *sc, st
|
||||
return ATH_AN_2_TID(an, tidno);
|
||||
}
|
||||
|
||||
+static struct sk_buff *
|
||||
+ath_tid_pull(struct ath_atx_tid *tid)
|
||||
+{
|
||||
+ struct ieee80211_txq *txq = container_of((void*)tid, struct ieee80211_txq, drv_priv);
|
||||
+ struct ath_softc *sc = tid->an->sc;
|
||||
+ struct ieee80211_hw *hw = sc->hw;
|
||||
+ struct ath_tx_control txctl = {
|
||||
+ .txq = tid->txq,
|
||||
+ .sta = tid->an->sta,
|
||||
+ };
|
||||
+ struct sk_buff *skb;
|
||||
+ struct ath_frame_info *fi;
|
||||
+ int q;
|
||||
+
|
||||
+ if (!tid->has_queued)
|
||||
+ return NULL;
|
||||
+
|
||||
+ skb = ieee80211_tx_dequeue(hw, txq);
|
||||
+ if (!skb) {
|
||||
+ tid->has_queued = false;
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ if (ath_tx_prepare(hw, skb, &txctl)) {
|
||||
+ ieee80211_free_txskb(hw, skb);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ q = skb_get_queue_mapping(skb);
|
||||
+ if (tid->txq == sc->tx.txq_map[q]) {
|
||||
+ fi = get_frame_info(skb);
|
||||
+ fi->txq = q;
|
||||
+ ++tid->txq->pending_frames;
|
||||
+ }
|
||||
+
|
||||
+ return skb;
|
||||
+ }
|
||||
+
|
||||
+
|
||||
static bool ath_tid_has_buffered(struct ath_atx_tid *tid)
|
||||
{
|
||||
- return !skb_queue_empty(&tid->buf_q) || !skb_queue_empty(&tid->retry_q);
|
||||
+ return !skb_queue_empty(&tid->retry_q) || tid->has_queued;
|
||||
}
|
||||
|
||||
static struct sk_buff *ath_tid_dequeue(struct ath_atx_tid *tid)
|
||||
@@ -203,46 +255,11 @@ static struct sk_buff *ath_tid_dequeue(s
|
||||
|
||||
skb = __skb_dequeue(&tid->retry_q);
|
||||
if (!skb)
|
||||
- skb = __skb_dequeue(&tid->buf_q);
|
||||
+ skb = ath_tid_pull(tid);
|
||||
|
||||
return skb;
|
||||
}
|
||||
|
||||
-/*
|
||||
- * ath_tx_tid_change_state:
|
||||
- * - clears a-mpdu flag of previous session
|
||||
- * - force sequence number allocation to fix next BlockAck Window
|
||||
- */
|
||||
-static void
|
||||
-ath_tx_tid_change_state(struct ath_softc *sc, struct ath_atx_tid *tid)
|
||||
-{
|
||||
- struct ath_txq *txq = tid->txq;
|
||||
- struct ieee80211_tx_info *tx_info;
|
||||
- struct sk_buff *skb, *tskb;
|
||||
- struct ath_buf *bf;
|
||||
- struct ath_frame_info *fi;
|
||||
-
|
||||
- skb_queue_walk_safe(&tid->buf_q, skb, tskb) {
|
||||
- fi = get_frame_info(skb);
|
||||
- bf = fi->bf;
|
||||
-
|
||||
- tx_info = IEEE80211_SKB_CB(skb);
|
||||
- tx_info->flags &= ~IEEE80211_TX_CTL_AMPDU;
|
||||
-
|
||||
- if (bf)
|
||||
- continue;
|
||||
-
|
||||
- bf = ath_tx_setup_buffer(sc, txq, tid, skb);
|
||||
- if (!bf) {
|
||||
- __skb_unlink(skb, &tid->buf_q);
|
||||
- ath_txq_skb_done(sc, txq, skb);
|
||||
- ieee80211_free_txskb(sc->hw, skb);
|
||||
- continue;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
-}
|
||||
-
|
||||
static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid)
|
||||
{
|
||||
struct ath_txq *txq = tid->txq;
|
||||
@@ -883,20 +900,16 @@ static int ath_compute_num_delims(struct
|
||||
|
||||
static struct ath_buf *
|
||||
ath_tx_get_tid_subframe(struct ath_softc *sc, struct ath_txq *txq,
|
||||
- struct ath_atx_tid *tid, struct sk_buff_head **q)
|
||||
+ struct ath_atx_tid *tid)
|
||||
{
|
||||
struct ieee80211_tx_info *tx_info;
|
||||
struct ath_frame_info *fi;
|
||||
- struct sk_buff *skb;
|
||||
+ struct sk_buff *skb, *first_skb = NULL;
|
||||
struct ath_buf *bf;
|
||||
u16 seqno;
|
||||
|
||||
while (1) {
|
||||
- *q = &tid->retry_q;
|
||||
- if (skb_queue_empty(*q))
|
||||
- *q = &tid->buf_q;
|
||||
-
|
||||
- skb = skb_peek(*q);
|
||||
+ skb = ath_tid_dequeue(tid);
|
||||
if (!skb)
|
||||
break;
|
||||
|
||||
@@ -908,7 +921,6 @@ ath_tx_get_tid_subframe(struct ath_softc
|
||||
bf->bf_state.stale = false;
|
||||
|
||||
if (!bf) {
|
||||
- __skb_unlink(skb, *q);
|
||||
ath_txq_skb_done(sc, txq, skb);
|
||||
ieee80211_free_txskb(sc->hw, skb);
|
||||
continue;
|
||||
@@ -937,8 +949,20 @@ ath_tx_get_tid_subframe(struct ath_softc
|
||||
seqno = bf->bf_state.seqno;
|
||||
|
||||
/* do not step over block-ack window */
|
||||
- if (!BAW_WITHIN(tid->seq_start, tid->baw_size, seqno))
|
||||
+ if (!BAW_WITHIN(tid->seq_start, tid->baw_size, seqno)) {
|
||||
+ __skb_queue_tail(&tid->retry_q, skb);
|
||||
+
|
||||
+ /* If there are other skbs in the retry q, they are
|
||||
+ * probably within the BAW, so loop immediately to get
|
||||
+ * one of them. Otherwise the queue can get stuck. */
|
||||
+ if (!skb_queue_is_first(&tid->retry_q, skb) &&
|
||||
+ !WARN_ON(skb == first_skb)) {
|
||||
+ if(!first_skb) /* infinite loop prevention */
|
||||
+ first_skb = skb;
|
||||
+ continue;
|
||||
+ }
|
||||
break;
|
||||
+ }
|
||||
|
||||
if (tid->bar_index > ATH_BA_INDEX(tid->seq_start, seqno)) {
|
||||
struct ath_tx_status ts = {};
|
||||
@@ -946,7 +970,6 @@ ath_tx_get_tid_subframe(struct ath_softc
|
||||
|
||||
INIT_LIST_HEAD(&bf_head);
|
||||
list_add(&bf->list, &bf_head);
|
||||
- __skb_unlink(skb, *q);
|
||||
ath_tx_update_baw(sc, tid, seqno);
|
||||
ath_tx_complete_buf(sc, bf, txq, &bf_head, NULL, &ts, 0);
|
||||
continue;
|
||||
@@ -958,11 +981,10 @@ ath_tx_get_tid_subframe(struct ath_softc
|
||||
return NULL;
|
||||
}
|
||||
|
||||
-static bool
|
||||
+static int
|
||||
ath_tx_form_aggr(struct ath_softc *sc, struct ath_txq *txq,
|
||||
struct ath_atx_tid *tid, struct list_head *bf_q,
|
||||
- struct ath_buf *bf_first, struct sk_buff_head *tid_q,
|
||||
- int *aggr_len)
|
||||
+ struct ath_buf *bf_first)
|
||||
{
|
||||
#define PADBYTES(_len) ((4 - ((_len) % 4)) % 4)
|
||||
struct ath_buf *bf = bf_first, *bf_prev = NULL;
|
||||
@@ -972,12 +994,13 @@ ath_tx_form_aggr(struct ath_softc *sc, s
|
||||
struct ieee80211_tx_info *tx_info;
|
||||
struct ath_frame_info *fi;
|
||||
struct sk_buff *skb;
|
||||
- bool closed = false;
|
||||
+
|
||||
|
||||
bf = bf_first;
|
||||
aggr_limit = ath_lookup_rate(sc, bf, tid);
|
||||
|
||||
- do {
|
||||
+ while (bf)
|
||||
+ {
|
||||
skb = bf->bf_mpdu;
|
||||
fi = get_frame_info(skb);
|
||||
|
||||
@@ -986,12 +1009,12 @@ ath_tx_form_aggr(struct ath_softc *sc, s
|
||||
if (nframes) {
|
||||
if (aggr_limit < al + bpad + al_delta ||
|
||||
ath_lookup_legacy(bf) || nframes >= h_baw)
|
||||
- break;
|
||||
+ goto stop;
|
||||
|
||||
tx_info = IEEE80211_SKB_CB(bf->bf_mpdu);
|
||||
if ((tx_info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE) ||
|
||||
!(tx_info->flags & IEEE80211_TX_CTL_AMPDU))
|
||||
- break;
|
||||
+ goto stop;
|
||||
}
|
||||
|
||||
/* add padding for previous frame to aggregation length */
|
||||
@@ -1013,20 +1036,18 @@ ath_tx_form_aggr(struct ath_softc *sc, s
|
||||
ath_tx_addto_baw(sc, tid, bf);
|
||||
bf->bf_state.ndelim = ndelim;
|
||||
|
||||
- __skb_unlink(skb, tid_q);
|
||||
list_add_tail(&bf->list, bf_q);
|
||||
if (bf_prev)
|
||||
bf_prev->bf_next = bf;
|
||||
|
||||
bf_prev = bf;
|
||||
|
||||
- bf = ath_tx_get_tid_subframe(sc, txq, tid, &tid_q);
|
||||
- if (!bf) {
|
||||
- closed = true;
|
||||
- break;
|
||||
- }
|
||||
- } while (ath_tid_has_buffered(tid));
|
||||
-
|
||||
+ bf = ath_tx_get_tid_subframe(sc, txq, tid);
|
||||
+ }
|
||||
+ goto finish;
|
||||
+stop:
|
||||
+ __skb_queue_tail(&tid->retry_q, bf->bf_mpdu);
|
||||
+finish:
|
||||
bf = bf_first;
|
||||
bf->bf_lastbf = bf_prev;
|
||||
|
||||
@@ -1037,9 +1058,7 @@ ath_tx_form_aggr(struct ath_softc *sc, s
|
||||
TX_STAT_INC(txq->axq_qnum, a_aggr);
|
||||
}
|
||||
|
||||
- *aggr_len = al;
|
||||
-
|
||||
- return closed;
|
||||
+ return al;
|
||||
#undef PADBYTES
|
||||
}
|
||||
|
||||
@@ -1416,18 +1435,15 @@ static void ath_tx_fill_desc(struct ath_
|
||||
static void
|
||||
ath_tx_form_burst(struct ath_softc *sc, struct ath_txq *txq,
|
||||
struct ath_atx_tid *tid, struct list_head *bf_q,
|
||||
- struct ath_buf *bf_first, struct sk_buff_head *tid_q)
|
||||
+ struct ath_buf *bf_first)
|
||||
{
|
||||
struct ath_buf *bf = bf_first, *bf_prev = NULL;
|
||||
- struct sk_buff *skb;
|
||||
int nframes = 0;
|
||||
|
||||
do {
|
||||
struct ieee80211_tx_info *tx_info;
|
||||
- skb = bf->bf_mpdu;
|
||||
|
||||
nframes++;
|
||||
- __skb_unlink(skb, tid_q);
|
||||
list_add_tail(&bf->list, bf_q);
|
||||
if (bf_prev)
|
||||
bf_prev->bf_next = bf;
|
||||
@@ -1436,13 +1452,15 @@ ath_tx_form_burst(struct ath_softc *sc,
|
||||
if (nframes >= 2)
|
||||
break;
|
||||
|
||||
- bf = ath_tx_get_tid_subframe(sc, txq, tid, &tid_q);
|
||||
+ bf = ath_tx_get_tid_subframe(sc, txq, tid);
|
||||
if (!bf)
|
||||
break;
|
||||
|
||||
tx_info = IEEE80211_SKB_CB(bf->bf_mpdu);
|
||||
- if (tx_info->flags & IEEE80211_TX_CTL_AMPDU)
|
||||
+ if (tx_info->flags & IEEE80211_TX_CTL_AMPDU) {
|
||||
+ __skb_queue_tail(&tid->retry_q, bf->bf_mpdu);
|
||||
break;
|
||||
+ }
|
||||
|
||||
ath_set_rates(tid->an->vif, tid->an->sta, bf);
|
||||
} while (1);
|
||||
@@ -1453,34 +1471,33 @@ static bool ath_tx_sched_aggr(struct ath
|
||||
{
|
||||
struct ath_buf *bf;
|
||||
struct ieee80211_tx_info *tx_info;
|
||||
- struct sk_buff_head *tid_q;
|
||||
struct list_head bf_q;
|
||||
int aggr_len = 0;
|
||||
- bool aggr, last = true;
|
||||
+ bool aggr;
|
||||
|
||||
if (!ath_tid_has_buffered(tid))
|
||||
return false;
|
||||
|
||||
INIT_LIST_HEAD(&bf_q);
|
||||
|
||||
- bf = ath_tx_get_tid_subframe(sc, txq, tid, &tid_q);
|
||||
+ bf = ath_tx_get_tid_subframe(sc, txq, tid);
|
||||
if (!bf)
|
||||
return false;
|
||||
|
||||
tx_info = IEEE80211_SKB_CB(bf->bf_mpdu);
|
||||
aggr = !!(tx_info->flags & IEEE80211_TX_CTL_AMPDU);
|
||||
if ((aggr && txq->axq_ampdu_depth >= ATH_AGGR_MIN_QDEPTH) ||
|
||||
- (!aggr && txq->axq_depth >= ATH_NON_AGGR_MIN_QDEPTH)) {
|
||||
+ (!aggr && txq->axq_depth >= ATH_NON_AGGR_MIN_QDEPTH)) {
|
||||
+ __skb_queue_tail(&tid->retry_q, bf->bf_mpdu);
|
||||
*stop = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
ath_set_rates(tid->an->vif, tid->an->sta, bf);
|
||||
if (aggr)
|
||||
- last = ath_tx_form_aggr(sc, txq, tid, &bf_q, bf,
|
||||
- tid_q, &aggr_len);
|
||||
+ aggr_len = ath_tx_form_aggr(sc, txq, tid, &bf_q, bf);
|
||||
else
|
||||
- ath_tx_form_burst(sc, txq, tid, &bf_q, bf, tid_q);
|
||||
+ ath_tx_form_burst(sc, txq, tid, &bf_q, bf);
|
||||
|
||||
if (list_empty(&bf_q))
|
||||
return false;
|
||||
@@ -1523,9 +1540,6 @@ int ath_tx_aggr_start(struct ath_softc *
|
||||
an->mpdudensity = density;
|
||||
}
|
||||
|
||||
- /* force sequence number allocation for pending frames */
|
||||
- ath_tx_tid_change_state(sc, txtid);
|
||||
-
|
||||
txtid->active = true;
|
||||
*ssn = txtid->seq_start = txtid->seq_next;
|
||||
txtid->bar_index = -1;
|
||||
@@ -1550,7 +1564,6 @@ void ath_tx_aggr_stop(struct ath_softc *
|
||||
ath_txq_lock(sc, txq);
|
||||
txtid->active = false;
|
||||
ath_tx_flush_tid(sc, txtid);
|
||||
- ath_tx_tid_change_state(sc, txtid);
|
||||
ath_txq_unlock_complete(sc, txq);
|
||||
}
|
||||
|
||||
@@ -1560,14 +1573,12 @@ void ath_tx_aggr_sleep(struct ieee80211_
|
||||
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
|
||||
struct ath_atx_tid *tid;
|
||||
struct ath_txq *txq;
|
||||
- bool buffered;
|
||||
int tidno;
|
||||
|
||||
ath_dbg(common, XMIT, "%s called\n", __func__);
|
||||
|
||||
- for (tidno = 0, tid = &an->tid[tidno];
|
||||
- tidno < IEEE80211_NUM_TIDS; tidno++, tid++) {
|
||||
-
|
||||
+ for (tidno = 0; tidno < IEEE80211_NUM_TIDS; tidno++) {
|
||||
+ tid = ath_node_to_tid(an, tidno);
|
||||
txq = tid->txq;
|
||||
|
||||
ath_txq_lock(sc, txq);
|
||||
@@ -1577,13 +1588,12 @@ void ath_tx_aggr_sleep(struct ieee80211_
|
||||
continue;
|
||||
}
|
||||
|
||||
- buffered = ath_tid_has_buffered(tid);
|
||||
+ if (!skb_queue_empty(&tid->retry_q))
|
||||
+ ieee80211_sta_set_buffered(sta, tid->tidno, true);
|
||||
|
||||
list_del_init(&tid->list);
|
||||
|
||||
ath_txq_unlock(sc, txq);
|
||||
-
|
||||
- ieee80211_sta_set_buffered(sta, tidno, buffered);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1596,49 +1606,20 @@ void ath_tx_aggr_wakeup(struct ath_softc
|
||||
|
||||
ath_dbg(common, XMIT, "%s called\n", __func__);
|
||||
|
||||
- for (tidno = 0, tid = &an->tid[tidno];
|
||||
- tidno < IEEE80211_NUM_TIDS; tidno++, tid++) {
|
||||
-
|
||||
+ for (tidno = 0; tidno < IEEE80211_NUM_TIDS; tidno++) {
|
||||
+ tid = ath_node_to_tid(an, tidno);
|
||||
txq = tid->txq;
|
||||
|
||||
ath_txq_lock(sc, txq);
|
||||
tid->clear_ps_filter = true;
|
||||
-
|
||||
if (ath_tid_has_buffered(tid)) {
|
||||
ath_tx_queue_tid(sc, txq, tid);
|
||||
ath_txq_schedule(sc, txq);
|
||||
}
|
||||
-
|
||||
ath_txq_unlock_complete(sc, txq);
|
||||
}
|
||||
}
|
||||
|
||||
-void ath_tx_aggr_resume(struct ath_softc *sc, struct ieee80211_sta *sta,
|
||||
- u16 tidno)
|
||||
-{
|
||||
- struct ath_common *common = ath9k_hw_common(sc->sc_ah);
|
||||
- struct ath_atx_tid *tid;
|
||||
- struct ath_node *an;
|
||||
- struct ath_txq *txq;
|
||||
-
|
||||
- ath_dbg(common, XMIT, "%s called\n", __func__);
|
||||
-
|
||||
- an = (struct ath_node *)sta->drv_priv;
|
||||
- tid = ATH_AN_2_TID(an, tidno);
|
||||
- txq = tid->txq;
|
||||
-
|
||||
- ath_txq_lock(sc, txq);
|
||||
-
|
||||
- tid->baw_size = IEEE80211_MIN_AMPDU_BUF << sta->ht_cap.ampdu_factor;
|
||||
-
|
||||
- if (ath_tid_has_buffered(tid)) {
|
||||
- ath_tx_queue_tid(sc, txq, tid);
|
||||
- ath_txq_schedule(sc, txq);
|
||||
- }
|
||||
-
|
||||
- ath_txq_unlock_complete(sc, txq);
|
||||
-}
|
||||
-
|
||||
void ath9k_release_buffered_frames(struct ieee80211_hw *hw,
|
||||
struct ieee80211_sta *sta,
|
||||
u16 tids, int nframes,
|
||||
@@ -1651,7 +1632,6 @@ void ath9k_release_buffered_frames(struc
|
||||
struct ieee80211_tx_info *info;
|
||||
struct list_head bf_q;
|
||||
struct ath_buf *bf_tail = NULL, *bf;
|
||||
- struct sk_buff_head *tid_q;
|
||||
int sent = 0;
|
||||
int i;
|
||||
|
||||
@@ -1666,11 +1646,10 @@ void ath9k_release_buffered_frames(struc
|
||||
|
||||
ath_txq_lock(sc, tid->txq);
|
||||
while (nframes > 0) {
|
||||
- bf = ath_tx_get_tid_subframe(sc, sc->tx.uapsdq, tid, &tid_q);
|
||||
+ bf = ath_tx_get_tid_subframe(sc, sc->tx.uapsdq, tid);
|
||||
if (!bf)
|
||||
break;
|
||||
|
||||
- __skb_unlink(bf->bf_mpdu, tid_q);
|
||||
list_add_tail(&bf->list, &bf_q);
|
||||
ath_set_rates(tid->an->vif, tid->an->sta, bf);
|
||||
if (bf_isampdu(bf)) {
|
||||
@@ -1685,7 +1664,7 @@ void ath9k_release_buffered_frames(struc
|
||||
sent++;
|
||||
TX_STAT_INC(txq->axq_qnum, a_queued_hw);
|
||||
|
||||
- if (an->sta && !ath_tid_has_buffered(tid))
|
||||
+ if (an->sta && skb_queue_empty(&tid->retry_q))
|
||||
ieee80211_sta_set_buffered(an->sta, i, false);
|
||||
}
|
||||
ath_txq_unlock_complete(sc, tid->txq);
|
||||
@@ -1914,13 +1893,7 @@ bool ath_drain_all_txq(struct ath_softc
|
||||
if (!ATH_TXQ_SETUP(sc, i))
|
||||
continue;
|
||||
|
||||
- /*
|
||||
- * The caller will resume queues with ieee80211_wake_queues.
|
||||
- * Mark the queue as not stopped to prevent ath_tx_complete
|
||||
- * from waking the queue too early.
|
||||
- */
|
||||
txq = &sc->tx.txq[i];
|
||||
- txq->stopped = false;
|
||||
ath_draintxq(sc, txq);
|
||||
}
|
||||
|
||||
@@ -2319,16 +2292,14 @@ int ath_tx_start(struct ieee80211_hw *hw
|
||||
struct ath_softc *sc = hw->priv;
|
||||
struct ath_txq *txq = txctl->txq;
|
||||
struct ath_atx_tid *tid = NULL;
|
||||
+ struct ath_node *an = NULL;
|
||||
struct ath_buf *bf;
|
||||
- bool queue, skip_uapsd = false, ps_resp;
|
||||
+ bool ps_resp;
|
||||
int q, ret;
|
||||
|
||||
if (vif)
|
||||
avp = (void *)vif->drv_priv;
|
||||
|
||||
- if (info->flags & IEEE80211_TX_CTL_TX_OFFCHAN)
|
||||
- txctl->force_channel = true;
|
||||
-
|
||||
ps_resp = !!(info->control.flags & IEEE80211_TX_CTRL_PS_RESPONSE);
|
||||
|
||||
ret = ath_tx_prepare(hw, skb, txctl);
|
||||
@@ -2343,63 +2314,18 @@ int ath_tx_start(struct ieee80211_hw *hw
|
||||
|
||||
q = skb_get_queue_mapping(skb);
|
||||
|
||||
- ath_txq_lock(sc, txq);
|
||||
- if (txq == sc->tx.txq_map[q]) {
|
||||
- fi->txq = q;
|
||||
- if (++txq->pending_frames > sc->tx.txq_max_pending[q] &&
|
||||
- !txq->stopped) {
|
||||
- if (ath9k_is_chanctx_enabled())
|
||||
- ieee80211_stop_queue(sc->hw, info->hw_queue);
|
||||
- else
|
||||
- ieee80211_stop_queue(sc->hw, q);
|
||||
- txq->stopped = true;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- queue = ieee80211_is_data_present(hdr->frame_control);
|
||||
-
|
||||
- /* If chanctx, queue all null frames while NOA could be there */
|
||||
- if (ath9k_is_chanctx_enabled() &&
|
||||
- ieee80211_is_nullfunc(hdr->frame_control) &&
|
||||
- !txctl->force_channel)
|
||||
- queue = true;
|
||||
-
|
||||
- /* Force queueing of all frames that belong to a virtual interface on
|
||||
- * a different channel context, to ensure that they are sent on the
|
||||
- * correct channel.
|
||||
- */
|
||||
- if (((avp && avp->chanctx != sc->cur_chan) ||
|
||||
- sc->cur_chan->stopped) && !txctl->force_channel) {
|
||||
- if (!txctl->an)
|
||||
- txctl->an = &avp->mcast_node;
|
||||
- queue = true;
|
||||
- skip_uapsd = true;
|
||||
- }
|
||||
-
|
||||
- if (txctl->an && queue)
|
||||
- tid = ath_get_skb_tid(sc, txctl->an, skb);
|
||||
-
|
||||
- if (!skip_uapsd && ps_resp) {
|
||||
- ath_txq_unlock(sc, txq);
|
||||
+ if (ps_resp)
|
||||
txq = sc->tx.uapsdq;
|
||||
- ath_txq_lock(sc, txq);
|
||||
- } else if (txctl->an && queue) {
|
||||
- WARN_ON(tid->txq != txctl->txq);
|
||||
|
||||
- if (info->flags & IEEE80211_TX_CTL_CLEAR_PS_FILT)
|
||||
- tid->clear_ps_filter = true;
|
||||
-
|
||||
- /*
|
||||
- * Add this frame to software queue for scheduling later
|
||||
- * for aggregation.
|
||||
- */
|
||||
- TX_STAT_INC(txq->axq_qnum, a_queued_sw);
|
||||
- __skb_queue_tail(&tid->buf_q, skb);
|
||||
- if (!txctl->an->sleeping)
|
||||
- ath_tx_queue_tid(sc, txq, tid);
|
||||
+ if (txctl->sta) {
|
||||
+ an = (struct ath_node *) sta->drv_priv;
|
||||
+ tid = ath_get_skb_tid(sc, an, skb);
|
||||
+ }
|
||||
|
||||
- ath_txq_schedule(sc, txq);
|
||||
- goto out;
|
||||
+ ath_txq_lock(sc, txq);
|
||||
+ if (txq == sc->tx.txq_map[q]) {
|
||||
+ fi->txq = q;
|
||||
+ ++txq->pending_frames;
|
||||
}
|
||||
|
||||
bf = ath_tx_setup_buffer(sc, txq, tid, skb);
|
||||
@@ -2892,9 +2818,8 @@ void ath_tx_node_init(struct ath_softc *
|
||||
struct ath_atx_tid *tid;
|
||||
int tidno, acno;
|
||||
|
||||
- for (tidno = 0, tid = &an->tid[tidno];
|
||||
- tidno < IEEE80211_NUM_TIDS;
|
||||
- tidno++, tid++) {
|
||||
+ for (tidno = 0; tidno < IEEE80211_NUM_TIDS; tidno++) {
|
||||
+ tid = ath_node_to_tid(an, tidno);
|
||||
tid->an = an;
|
||||
tid->tidno = tidno;
|
||||
tid->seq_start = tid->seq_next = 0;
|
||||
@@ -2902,11 +2827,14 @@ void ath_tx_node_init(struct ath_softc *
|
||||
tid->baw_head = tid->baw_tail = 0;
|
||||
tid->active = false;
|
||||
tid->clear_ps_filter = true;
|
||||
- __skb_queue_head_init(&tid->buf_q);
|
||||
+ tid->has_queued = false;
|
||||
__skb_queue_head_init(&tid->retry_q);
|
||||
INIT_LIST_HEAD(&tid->list);
|
||||
acno = TID_TO_WME_AC(tidno);
|
||||
tid->txq = sc->tx.txq_map[acno];
|
||||
+
|
||||
+ if (!an->sta)
|
||||
+ break; /* just one multicast ath_atx_tid */
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2916,9 +2844,8 @@ void ath_tx_node_cleanup(struct ath_soft
|
||||
struct ath_txq *txq;
|
||||
int tidno;
|
||||
|
||||
- for (tidno = 0, tid = &an->tid[tidno];
|
||||
- tidno < IEEE80211_NUM_TIDS; tidno++, tid++) {
|
||||
-
|
||||
+ for (tidno = 0; tidno < IEEE80211_NUM_TIDS; tidno++) {
|
||||
+ tid = ath_node_to_tid(an, tidno);
|
||||
txq = tid->txq;
|
||||
|
||||
ath_txq_lock(sc, txq);
|
||||
@@ -2930,6 +2857,9 @@ void ath_tx_node_cleanup(struct ath_soft
|
||||
tid->active = false;
|
||||
|
||||
ath_txq_unlock(sc, txq);
|
||||
+
|
||||
+ if (!an->sta)
|
||||
+ break; /* just one multicast ath_atx_tid */
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Tue, 27 Dec 2016 23:16:23 +0100
|
||||
Subject: [PATCH] ath9k: don't run periodic and nf calibation at the same time
|
||||
Subject: [PATCH] ath9k: don't run periodic and nf calibation at the same
|
||||
time
|
||||
|
||||
The checks already prevents periodic cal from being started while noise
|
||||
floor calibration runs. It is missing checks for the other way around.
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user