Compare commits

..

1 Commits

Author SHA1 Message Date
Jo-Philipp Wich
ac733df99c LEDE v17.01.0: adjust config defaults
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2017-02-20 19:00:22 +01:00
1811 changed files with 46663 additions and 43808 deletions

View File

@@ -9,16 +9,15 @@ menu "Global build settings"
config ALL_NONSHARED
bool "Select all target specific packages by default"
select ALL_KMODS
default BUILDBOT
default ALL || BUILDBOT
config ALL_KMODS
bool "Select all kernel module packages by default"
default ALL
config ALL
bool "Select all userspace packages by default"
select ALL_KMODS
select ALL_NONSHARED
default n
config BUILDBOT
bool "Set build defaults for automatic builds (e.g. via buildbot)"

View File

@@ -203,11 +203,6 @@ menu "Target Images"
default 38400 if TARGET_x86_generic
default 115200
config GRUB_FLOWCONTROL
bool "Use RTE/CTS on serial console"
depends on GRUB_SERIAL != ""
default n
config GRUB_BOOTOPTS
string "Extra kernel boot options"
depends on GRUB_IMAGES

View File

@@ -170,6 +170,10 @@ config KERNEL_AIO
bool "Compile the kernel with asynchronous IO support"
default n
config KERNEL_DIRECT_IO
bool "Compile the kernel with direct IO support"
default n
config KERNEL_FHANDLE
bool "Compile the kernel with support for fhandle syscalls"
default n

View File

@@ -1,4 +1,4 @@
src-git packages https://git.lede-project.org/feed/packages.git^545d2fadd7245783e40f235fe2c5d8c3ab1549cd
src-git luci https://git.lede-project.org/project/luci.git^71e2af4f51567061600840040508d642120a8532
src-git routing https://git.lede-project.org/feed/routing.git^af18086ba8de36e7fbc696cb39f634f6a7ea34de
src-git telephony https://git.lede-project.org/feed/telephony.git^31398a3759c99bdb2dca359b78e25c17b6dd434a
src-git packages https://git.lede-project.org/feed/packages.git^ed90827282851ad93294e370860320f1af428bb2
src-git luci https://git.lede-project.org/project/luci.git^a100738163585ae1edc24d832ca9bef1f34beef0
src-git routing https://git.lede-project.org/feed/routing.git^dd36dd47bbd75defcb3c517cafe7a19ee425f0af
src-git telephony https://git.lede-project.org/feed/telephony.git^1f0fb2538ba6fc306198fe2a9a4b976d63adb304

View File

@@ -107,7 +107,3 @@ 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

View File

@@ -6,10 +6,8 @@
# See /LICENSE for more information.
#
PROJECT_GIT = https://git.openwrt.org
OPENWRT_GIT = $(PROJECT_GIT)
LEDE_GIT = $(PROJECT_GIT)
OPENWRT_GIT = http://git.openwrt.org
LEDE_GIT = https://git.lede-project.org
ifdef PKG_SOURCE_VERSION
PKG_VERSION ?= $(if $(PKG_SOURCE_DATE),$(PKG_SOURCE_DATE)-)$(call version_abbrev,$(PKG_SOURCE_VERSION))
@@ -105,7 +103,7 @@ hash_var = $(if $(filter-out x,$(1)),MD5SUM,HASH)
endif
define DownloadMethod/unknown
echo "ERROR: No download method available"; false
@echo "ERROR: No download method available"; false
endef
define DownloadMethod/default

View File

@@ -22,7 +22,6 @@ endif
include $(INCLUDE_DIR)/host.mk
include $(INCLUDE_DIR)/unpack.mk
include $(INCLUDE_DIR)/depends.mk
include $(INCLUDE_DIR)/quilt.mk
BUILD_TYPES += host
HOST_STAMP_PREPARED=$(HOST_BUILD_DIR)/.prepared$(if $(HOST_QUILT)$(DUMP),,$(shell $(call find_md5,${CURDIR} $(PKG_FILE_DEPENDS),)))
@@ -33,6 +32,7 @@ HOST_STAMP_INSTALLED:=$(HOST_BUILD_PREFIX)/stamp/.$(PKG_NAME)_installed
override MAKEFLAGS=
include $(INCLUDE_DIR)/quilt.mk
include $(INCLUDE_DIR)/autotools.mk
Host/Patch:=$(Host/Patch/Default)
@@ -77,10 +77,6 @@ HOST_MAKE_FLAGS =
HOST_CONFIGURE_CMD = $(BASH) ./configure
ifeq ($(HOST_OS),Darwin)
HOST_CONFIG_SITE:=$(INCLUDE_DIR)/site/darwin
endif
define Host/Configure/Default
$(if $(HOST_CONFIGURE_PARALLEL),+)(cd $(HOST_BUILD_DIR)/$(3); \
if [ -x configure ]; then \
@@ -110,7 +106,7 @@ define Host/Compile
endef
define Host/Install/Default
$(call Host/Compile/Default,install)
$(_SINGLE)$(MAKE) -C $(HOST_BUILD_DIR) install
endef
define Host/Install
@@ -131,7 +127,6 @@ define Host/Exports/Default
$(1) : export PKG_CONFIG_PATH=$$(STAGING_DIR_HOST)/lib/pkgconfig:$$(HOST_BUILD_PREFIX)/lib/pkgconfig
$(1) : export PKG_CONFIG_LIBDIR=$$(HOST_BUILD_PREFIX)/lib/pkgconfig
$(1) : export CCACHE_DIR:=$(STAGING_DIR_HOST)/ccache
$(if $(HOST_CONFIG_SITE),$(1) : export CONFIG_SITE:=$(HOST_CONFIG_SITE))
$(if $(IS_PACKAGE_BUILD),$(1) : export PATH=$$(TARGET_PATH_PKG))
endef
Host/Exports=$(Host/Exports/Default)

View File

@@ -41,6 +41,11 @@ $(TMP_DIR)/.host.mk: $(TOPDIR)/include/host.mk
echo "HOST_OS:=$$HOST_OS" > $@; \
echo "HOST_ARCH:=$$HOST_ARCH" >> $@; \
echo "GNU_HOST_NAME:=$$GNU_HOST_NAME" >> $@; \
if gfind -L /dev/null || find -L /dev/null; then \
echo "FIND_L=find -L \$$(1)" >> $@; \
else \
echo "FIND_L=find \$$(1) -follow" >> $@; \
fi \
) >/dev/null 2>/dev/null
endif

View File

@@ -8,7 +8,7 @@ define Build/uImage
-O linux -T kernel \
-C $(1) -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
-n '$(if $(UIMAGE_NAME),$(UIMAGE_NAME),$(call toupper,$(LINUX_KARCH)) LEDE Linux-$(LINUX_VERSION))' -d $@ $@.new
mv $@.new $@
@mv $@.new $@
endef
define Build/netgear-chk

View File

@@ -48,7 +48,6 @@ endef
ifdef TARGET_PER_DEVICE_ROOTFS
define Image/Build/Profile/Filesystem
cp $(KDIR)/root.$(2)+pkg=$(3) $(KDIR)/root.$(2)
$(call Image/Build/$(2),$(2))
$(call Image/Build/Profile,$(1),$(2))
endef
else

View File

@@ -277,7 +277,7 @@ endif
ifdef CONFIG_TARGET_ROOTFS_CPIOGZ
define Image/Build/cpiogz
( cd $(TARGET_DIR); find . | cpio -o -H newc -R root:root | gzip -9n >$(BIN_DIR)/$(IMG_PREFIX)-rootfs.cpio.gz )
( cd $(TARGET_DIR); find . | cpio -o -H newc | gzip -9n >$(BIN_DIR)/$(IMG_PREFIX)-rootfs.cpio.gz )
endef
endif
@@ -302,9 +302,9 @@ target-dir-%: FORCE
$(opkg_target) update && \
$(opkg_target) install \
$(call opkg_package_files,$(mkfs_packages_add)))
-$(CP) -T $(mkfs_cur_target_dir).opkg/ $(mkfs_cur_target_dir)/etc/opkg/
rm -rf $(mkfs_cur_target_dir).opkg $(mkfs_cur_target_dir).conf
$(call prepare_rootfs,$(mkfs_cur_target_dir))
-mv $(mkfs_cur_target_dir).opkg $(mkfs_cur_target_dir)/etc/opkg
rm -f $(mkfs_cur_target_dir).conf
$(KDIR)/root.%: kernel_prepare
$(call Image/mkfs/$(word 1,$(target_params)),$(target_params))
@@ -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) image_prepare
$(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE): $(KDIR)/$$(KERNEL_INITRAMFS_NAME) $(CURDIR)/Makefile $$(KERNEL_DEPENDS)
@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) image_prepare
$$(KDIR_KERNEL_IMAGE): $(KDIR)/$$(KERNEL_NAME) $(CURDIR)/Makefile $$(KERNEL_DEPENDS)
@rm -f $$@
$$(call concat_cmd,$$(KERNEL))
$$(if $$(KERNEL_SIZE),$$(call Build/check-size,$$(KERNEL_SIZE)))

View File

@@ -152,7 +152,7 @@ define BuildKernel
endef
download: $(if $(LINUX_SITE),$(DL_DIR)/$(LINUX_SOURCE))
prepare: $(STAMP_PREPARED)
prepare: $(STAMP_CONFIGURED)
compile: $(LINUX_DIR)/.modules
$(MAKE) -C image compile TARGET_BUILD=

View File

@@ -165,7 +165,7 @@ endef
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
define Kernel/CompileImage/Initramfs
$(call Kernel/Configure/Initramfs)
$(CP) $(GENERIC_PLATFORM_DIR)/other-files/init $(TARGET_DIR)/init
$(CP) $(GENERIC_PLATFORM_DIR)/base-files/init $(TARGET_DIR)/init
rm -rf $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)/usr/initramfs_data.cpio*
+$(MAKE) $(KERNEL_MAKEOPTS) $(if $(KERNELNAME),$(KERNELNAME),all) modules
$(call Kernel/CopyImage,-initramfs)

View File

@@ -3,10 +3,10 @@
LINUX_RELEASE?=1
LINUX_VERSION-3.18 = .43
LINUX_VERSION-4.4 = .182
LINUX_VERSION-4.4 = .50
LINUX_KERNEL_HASH-3.18.43 = 1236e8123a6ce537d5029232560966feed054ae31776fe8481dd7d18cdd5492c
LINUX_KERNEL_HASH-4.4.182 = c409d88f61cd9a37cbba36d5d9c8162263eb1e5c9380efaf880a3ec10cd88527
LINUX_KERNEL_HASH-4.4.50 = e4944ca5bb0bdf63a7e97dc7fbdd38bcc820d8b3b57c4a3a7b3bf9c8a48216b7
ifdef KERNEL_PATCHVER
LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER)))

View File

@@ -95,16 +95,15 @@ define ModuleAutoLoad
$(SH_FUNC) \
export modules=; \
probe_module() { \
local mods="$$$$$$$$1"; \
local boot="$$$$$$$$2"; \
local mod; \
mods="$$$$$$$$1"; \
boot="$$$$$$$$2"; \
shift 2; \
for mod in $$$$$$$$mods; do \
for mod in $(sort $$$$$$$$mods); do \
mkdir -p $(2)/etc/modules.d; \
echo "$$$$$$$$mod" >> $(2)/etc/modules.d/$(1); \
done; \
if [ -e $(2)/etc/modules.d/$(1) ]; then \
if [ "$$$$$$$$boot" = "1" -a ! -e $(2)/etc/modules-boot.d/$(1) ]; then \
if [ "$$$$$$$$boot" = "1" ]; then \
mkdir -p $(2)/etc/modules-boot.d; \
ln -s ../modules.d/$(1) $(2)/etc/modules-boot.d/; \
fi; \
@@ -112,17 +111,16 @@ define ModuleAutoLoad
fi; \
}; \
add_module() { \
local priority="$$$$$$$$1"; \
local mods="$$$$$$$$2"; \
local boot="$$$$$$$$3"; \
local mod; \
priority="$$$$$$$$1"; \
mods="$$$$$$$$2"; \
boot="$$$$$$$$3"; \
shift 3; \
for mod in $$$$$$$$mods; do \
for mod in $(sort $$$$$$$$mods); do \
mkdir -p $(2)/etc/modules.d; \
echo "$$$$$$$$mod" >> $(2)/etc/modules.d/$$$$$$$$priority-$(1); \
done; \
if [ -e $(2)/etc/modules.d/$$$$$$$$priority-$(1) ]; then \
if [ "$$$$$$$$boot" = "1" -a ! -e $(2)/etc/modules-boot.d/$$$$$$$$priority-$(1) ]; then \
if [ "$$$$$$$$boot" = "1" ]; then \
mkdir -p $(2)/etc/modules-boot.d; \
ln -s ../modules.d/$$$$$$$$priority-$(1) $(2)/etc/modules-boot.d/; \
fi; \
@@ -131,7 +129,6 @@ define ModuleAutoLoad
}; \
$(3) \
if [ -n "$$$$$$$$modules" ]; then \
modules="$$$$$$$$(echo "$$$$$$$$modules" | tr ' ' '\n' | sort | uniq | paste -s -d' ' -)"; \
mkdir -p $(2)/etc/modules.d; \
mkdir -p $(2)/CONTROL; \
echo "#!/bin/sh" > $(2)/CONTROL/postinst-pkg; \

View File

@@ -106,8 +106,6 @@ $(eval $(call nf_add,IPT_FILTER,CONFIG_NETFILTER_XT_MATCH_STRING, $(P_XT)xt_stri
$(eval $(call nf_add,IPT_IPOPT,CONFIG_NETFILTER_XT_MATCH_DSCP, $(P_XT)xt_dscp))
$(eval $(call nf_add,IPT_IPOPT,CONFIG_NETFILTER_XT_TARGET_DSCP, $(P_XT)xt_DSCP))
$(eval $(call nf_add,IPT_HASHLIMIT,CONFIG_NETFILTER_XT_MATCH_HASHLIMIT, $(P_XT)xt_hashlimit))
$(eval $(call nf_add,IPT_RPFILTER,CONFIG_IP_NF_MATCH_RPFILTER, $(P_V4)ipt_rpfilter))
$(eval $(call nf_add,IPT_RPFILTER,CONFIG_IP6_NF_MATCH_RPFILTER, $(P_V6)ip6t_rpfilter))
$(eval $(call nf_add,IPT_IPOPT,CONFIG_NETFILTER_XT_MATCH_LENGTH, $(P_XT)xt_length))
$(eval $(call nf_add,IPT_IPOPT,CONFIG_NETFILTER_XT_MATCH_STATISTIC, $(P_XT)xt_statistic))
$(eval $(call nf_add,IPT_IPOPT,CONFIG_NETFILTER_XT_MATCH_TCPMSS, $(P_XT)xt_tcpmss))
@@ -362,6 +360,7 @@ IPT_BUILTIN += $(IPT_NAT_EXTRA-y)
IPT_BUILTIN += $(NF_NATHELPER-y)
IPT_BUILTIN += $(NF_NATHELPER_EXTRA-y)
IPT_BUILTIN += $(IPT_ULOG-y)
IPT_BUILTIN += $(IPT_DEBUG-y)
IPT_BUILTIN += $(IPT_TPROXY-y)
IPT_BUILTIN += $(NFNETLINK-y)
IPT_BUILTIN += $(NFNETLINK_LOG-y)

View File

@@ -62,7 +62,7 @@ Build/Patch:=$(Build/Patch/Default)
ifneq ($(strip $(PKG_UNPACK)),)
define Build/Prepare/Default
$(PKG_UNPACK)
[ ! -d ./src/ ] || $(CP) ./src/. $(PKG_BUILD_DIR)
[ ! -d ./src/ ] || $(CP) ./src/* $(PKG_BUILD_DIR)
$(Build/Patch)
endef
endif
@@ -92,6 +92,7 @@ CONFIGURE_ARGS = \
--mandir=$(CONFIGURE_PREFIX)/man \
--infodir=$(CONFIGURE_PREFIX)/info \
$(DISABLE_NLS) \
$(DISABLE_LARGEFILE) \
$(DISABLE_IPV6)
CONFIGURE_VARS = \

View File

@@ -196,7 +196,7 @@ $(_endef)
fi; \
done; $(Package/$(1)/extra_provides) \
) | sort -u > $(PKG_INFO_DIR)/$(1).provides
$(if $(PROVIDES),@for pkg in $(filter-out $(1),$(PROVIDES)); do cp $(PKG_INFO_DIR)/$(1).provides $(PKG_INFO_DIR)/$$$$pkg.provides; done)
$(if $(PROVIDES),@for pkg in $(PROVIDES); do cp $(PKG_INFO_DIR)/$(1).provides $(PKG_INFO_DIR)/$$$$pkg.provides; done)
$(CheckDependencies)
$(RSTRIP) $$(IDIR_$(1))

View File

@@ -40,7 +40,6 @@ include $(INCLUDE_DIR)/prereq.mk
include $(INCLUDE_DIR)/host.mk
include $(INCLUDE_DIR)/unpack.mk
include $(INCLUDE_DIR)/depends.mk
include $(INCLUDE_DIR)/quilt.mk
find_library_dependencies = $(wildcard $(patsubst %,$(STAGING_DIR)/pkginfo/%.version, \
$(filter-out $(BUILD_PACKAGES),$(foreach dep, \
@@ -90,6 +89,7 @@ endif
PKG_INSTALL_STAMP:=$(PKG_INFO_DIR)/$(PKG_DIR_NAME).$(if $(BUILD_VARIANT),$(BUILD_VARIANT),default).install
include $(INCLUDE_DIR)/quilt.mk
include $(INCLUDE_DIR)/package-defaults.mk
include $(INCLUDE_DIR)/package-dumpinfo.mk
include $(INCLUDE_DIR)/package-ipkg.mk

View File

@@ -49,15 +49,8 @@ TARGET_DIR_ORIG := $(TARGET_ROOTFS_DIR)/root.orig-$(BOARD)
ifdef CONFIG_CLEAN_IPKG
define clean_ipkg
-find $(1)/usr/lib/opkg/info -type f -and -not -name '*.control' | $(XARGS) rm -rf
-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
awk ' \
BEGIN { conffiles = 0; print "Conffiles:" } \
/^Conffiles:/ { conffiles = 1; next } \
!/^ / { conffiles = 0; next } \
conffiles == 1 { print } \
' $(1)/usr/lib/opkg/status >$(1)/usr/lib/opkg/status.new
mv $(1)/usr/lib/opkg/status.new $(1)/usr/lib/opkg/status
-find $(1)/usr/lib/opkg -empty | $(XARGS) rm -rf
endef
endif
@@ -89,6 +82,7 @@ define prepare_rootfs
@-find $(1) -name '.#*' | $(XARGS) rm -f
rm -f $(1)/usr/lib/opkg/lists/*
rm -f $(1)/usr/lib/opkg/info/*.postinst*
rm -f $(1)/usr/lib/opkg/info/*.prerm*
$(call clean_ipkg,$(1))
$(call mklibs,$(1))
endef

View File

@@ -56,7 +56,7 @@ endif
$(FILELIST): $(OVERRIDELIST)
rm -f $(TMP_DIR)/info/.files-$(SCAN_TARGET)-*
find -L $(SCAN_DIR) $(SCAN_EXTRA) -mindepth 1 $(if $(SCAN_DEPTH),-maxdepth $(SCAN_DEPTH)) -name Makefile | xargs grep -aHE 'call $(GREP_STRING)' | sed -e 's#^$(SCAN_DIR)/##' -e 's#/Makefile:.*##' | uniq | awk -v of=$(OVERRIDELIST) -f include/scan.awk > $@
$(call FIND_L, $(SCAN_DIR)) $(SCAN_EXTRA) -mindepth 1 $(if $(SCAN_DEPTH),-maxdepth $(SCAN_DEPTH)) -name Makefile | xargs grep -aHE 'call $(GREP_STRING)' | sed -e 's#^$(SCAN_DIR)/##' -e 's#/Makefile:.*##' | uniq | awk -v of=$(OVERRIDELIST) -f include/scan.awk > $@
$(TMP_DIR)/info/.files-$(SCAN_TARGET).mk: $(FILELIST)
( \

View File

@@ -1,2 +0,0 @@
ac_cv_func_futimens=no
ac_cv_func_utimensat=no

View File

@@ -218,11 +218,6 @@ ifeq ($(DUMP),1)
CPU_CFLAGS_arc700 = -marc700
CPU_CFLAGS_archs = -marchs
endif
ifneq ($(CPU_TYPE),)
ifndef CPU_CFLAGS_$(CPU_TYPE)
$(warning CPU_TYPE "$(CPU_TYPE)" doesn't correspond to a known type)
endif
endif
DEFAULT_CFLAGS=$(strip $(CPU_CFLAGS) $(CPU_CFLAGS_$(CPU_TYPE)) $(CPU_CFLAGS_$(CPU_SUBTYPE)))
ifneq ($(BOARD),)

View File

@@ -23,7 +23,6 @@ HOSTCC ?= $(CC)
export REVISION
export SOURCE_DATE_EPOCH
export GIT_CONFIG_PARAMETERS='core.autocrlf=false'
export GIT_ASKPASS:=/bin/true
export MAKE_JOBSERVER=$(filter --jobserver%,$(MAKEFLAGS))
# prevent perforce from messing with the patch utility
@@ -105,8 +104,7 @@ scripts/config/conf:
@$(_SINGLE)$(SUBMAKE) -s -C scripts/config conf CC="$(HOSTCC_WRAPPER)"
config: scripts/config/conf prepare-tmpinfo FORCE
[ -L .config ] && export KCONFIG_OVERWRITECONFIG=1; \
$< Config.in
$< Config.in
config-clean: FORCE
$(_SINGLE)$(NO_TRACE_MAKE) -C scripts/config clean
@@ -114,8 +112,7 @@ config-clean: FORCE
defconfig: scripts/config/conf prepare-tmpinfo FORCE
touch .config
@if [ ! -s .config -a -e $(HOME)/.openwrt/defconfig ]; then cp $(HOME)/.openwrt/defconfig .config; fi
[ -L .config ] && export KCONFIG_OVERWRITECONFIG=1; \
$< --defconfig=.config Config.in
$< --defconfig=.config Config.in
confdefault-y=allyes
confdefault-m=allmod
@@ -123,15 +120,13 @@ confdefault-n=allno
confdefault:=$(confdefault-$(CONFDEFAULT))
oldconfig: scripts/config/conf prepare-tmpinfo FORCE
[ -L .config ] && export KCONFIG_OVERWRITECONFIG=1; \
$< --$(if $(confdefault),$(confdefault),old)config Config.in
$< --$(if $(confdefault),$(confdefault),old)config Config.in
menuconfig: scripts/config/mconf prepare-tmpinfo FORCE
if [ \! -e .config -a -e $(HOME)/.openwrt/defconfig ]; then \
cp $(HOME)/.openwrt/defconfig .config; \
fi
[ -L .config ] && export KCONFIG_OVERWRITECONFIG=1; \
$< Config.in
$< Config.in
prepare_kernel_conf: .config FORCE
@@ -175,7 +170,7 @@ else
DOWNLOAD_DIRS = package/download
endif
download: .config FORCE $(if $(wildcard $(TOPDIR)/staging_dir/host/bin/flock),,tools/flock/compile)
download: .config FORCE
@+$(foreach dir,$(DOWNLOAD_DIRS),$(SUBMAKE) $(dir);)
clean dirclean: .config
@@ -187,9 +182,6 @@ prereq:: prepare-tmpinfo .config
check: .config FORCE
@+$(NO_TRACE_MAKE) -r -s $@ QUIET= V=s
val.%: FORCE
@+$(NO_TRACE_MAKE) -r -s $@ QUIET= V=s
WARN_PARALLEL_ERROR = $(if $(BUILD_LOG),,$(and $(filter -j,$(MAKEFLAGS)),$(findstring s,$(OPENWRT_VERBOSE))))
ifeq ($(SDK),1)

View File

@@ -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),17.01.7)
VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),17.01.0)
VERSION_CODE:=$(call qstrip_escape,$(CONFIG_VERSION_CODE))
VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r4030-6028f00df0)
VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r3205-59508e3)
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/releases/17.01.7)
VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),http://downloads.lede-project.org/releases/17.01.0)
VERSION_DIST:=$(call qstrip_escape,$(CONFIG_VERSION_DIST))
VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),LEDE)

View File

@@ -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/compile $(curdir)/merge $(if $(CONFIG_TARGET_PER_DEVICE_ROOTFS),$(curdir)/merge-index)
$(curdir)/install: $(TMP_DIR)/.build $(curdir)/system/opkg/host/install $(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

View File

@@ -11,15 +11,14 @@ include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/version.mk
PKG_NAME:=base-files
PKG_RELEASE:=173.6
PKG_RELEASE:=172
PKG_FLAGS:=nonshared
PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
PKG_BUILD_DEPENDS:=usign/host
PKG_LICENSE:=GPL-2.0
# Extend depends from version.mk
PKG_CONFIG_DEPENDS += CONFIG_SIGNED_PACKAGES CONFIG_TARGET_INIT_PATH CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE
PKG_CONFIG_DEPENDS := CONFIG_SIGNED_PACKAGES CONFIG_TARGET_INIT_PATH CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE
include $(INCLUDE_DIR)/package.mk
@@ -38,28 +37,27 @@ define Package/base-files
endef
define Package/base-files/conffiles
/etc/config/
/etc/config/network
/etc/config/system
/etc/crontabs/
/etc/dropbear/
/etc/group
/etc/hosts
/etc/inittab
/etc/iproute2/rt_protos
/etc/iproute2/rt_tables
/etc/group
/etc/passwd
/etc/profile
/etc/profile.d
/etc/protocols
/etc/rc.local
/etc/services
/etc/shadow
/etc/profile
/etc/protocols
/etc/services
/etc/shells
/etc/sysctl.conf
/etc/sysctl.d/
/etc/sysctl.d/local.conf
/etc/rc.local
/etc/sysupgrade.conf
/etc/config/
/etc/dropbear/
/etc/crontabs/
/etc/sysctl.d/local.conf
/etc/sysctl.d/
/etc/iproute2/rt_tables
/etc/iproute2/rt_protos
$(call $(TARGET)/conffiles)
endef
@@ -139,7 +137,6 @@ define Package/base-files/install
mkdir -p $(1)/CONTROL
mkdir -p $(1)/dev
mkdir -p $(1)/etc/config
mkdir -p $(1)/etc/crontabs
mkdir -p $(1)/etc/rc.d
mkdir -p $(1)/overlay

View File

@@ -119,14 +119,17 @@ generate_network() {
;;
pppoe)
# fixup IPv6 slave interface
ifname="pppoe-$1"
uci -q batch <<-EOF
set network.$1.proto='pppoe'
set network.$1.username='username'
set network.$1.password='password'
set network.$1.ipv6='1'
set network.$1.ipv6='auto'
delete network.${1}6
set network.${1}6='interface'
set network.${1}6.ifname='@${1}'
set network.${1}6.ifname='$ifname'
set network.${1}6.proto='dhcpv6'
EOF
;;

View File

@@ -8,8 +8,6 @@ after mount_root:
* /etc/config directory with config files
for more help see:
https://openwrt.org/docs/guide-user/troubleshooting/
- failsafe_and_factory_reset
- root_password_reset
http://wiki.openwrt.org/doc/howto/generic.failsafe
=======================================================

View File

@@ -3,33 +3,22 @@
START=11
apply_defaults() {
local mem="$(awk '/^MemTotal:/ {print $2}' /proc/meminfo)"
local min_free frag_low_thresh frag_high_thresh
set_vm_min_free() {
mem="$(grep MemTotal /proc/meminfo | awk '{print $2}')"
if [ "$mem" -gt 65536 ]; then # 128M
min_free=16384
val=16384
elif [ "$mem" -gt 32768 ]; then # 64M
min_free=8192
val=8192
elif [ "$mem" -gt 16384 ]; then # 32M
val=1024
else
min_free=1024
frag_low_thresh=393216
frag_high_thresh=524288
return
fi
sysctl -qw vm.min_free_kbytes="$min_free"
[ "$frag_low_thresh" ] && sysctl -qw \
net.ipv4.ipfrag_low_thresh="$frag_low_thresh" \
net.ipv4.ipfrag_high_thresh="$frag_high_thresh" \
net.ipv6.ip6frag_low_thresh="$frag_low_thresh" \
net.ipv6.ip6frag_high_thresh="$frag_high_thresh" \
net.netfilter.nf_conntrack_frag6_low_thresh="$frag_low_thresh" \
net.netfilter.nf_conntrack_frag6_high_thresh="$frag_high_thresh"
sysctl -qw vm.min_free_kbytes="$val"
}
start() {
apply_defaults
set_vm_min_free
for CONF in /etc/sysctl.conf /etc/sysctl.d/*.conf; do
[ -f "$CONF" ] && sysctl -p "$CONF" -e >&-
done

View File

@@ -1,8 +0,0 @@
# lookup table for ematch kinds
1 cmp
2 nbyte
3 u32
4 meta
7 canid
8 ipset
9 ipt

View File

@@ -1,9 +1,6 @@
#!/bin/sh
[ -e /tmp/.failsafe ] && export FAILSAFE=1
[ -f /etc/banner ] && cat /etc/banner
[ -n "$FAILSAFE" ] && cat /etc/banner.failsafe
[ -e /tmp/.failsafe ] && cat /etc/banner.failsafe
fgrep -sq '/ overlay ro,' /proc/mounts && {
echo 'Your JFFS2-partition seems full and overlayfs is mounted read-only.'
echo 'Please try to remove files from /overlay/upper/... and reboot!'

View File

@@ -20,7 +20,7 @@ released)
echo "REBOOT" > /dev/console
sync
reboot
elif [ "$SEEN" -ge 5 -a -n "$OVERLAY" ]
elif [ "$SEEN" -gt 5 -a -n "$OVERLAY" ]
then
echo "FACTORY RESET" > /dev/console
jffs2reset -y && reboot &

View File

@@ -17,13 +17,12 @@ stop() {
}
reload() {
restart
return 1
}
restart() {
trap '' TERM
stop "$@"
trap - TERM
start "$@"
}
@@ -69,7 +68,7 @@ Available commands:
start Start the service
stop Stop the service
restart Restart the service
reload Reload configuration files (or restart if service does not implement reload)
reload Reload configuration files (or restart if that fails)
enable Enable service autostart
disable Disable service autostart
$EXTRA_HELP
@@ -142,4 +141,5 @@ ${INIT_TRACE:+set -x}
ALL_COMMANDS="start stop reload restart boot shutdown enable disable enabled depends ${EXTRA_COMMANDS}"
list_contains ALL_COMMANDS "$action" || action=help
[ "$action" = "reload" ] && action='eval reload "$@" || restart "$@" && :'
$action "$@"

View File

@@ -76,8 +76,6 @@ afpovertcp 548/tcp
afpovertcp 548/udp
nntps 563/tcp snntp
nntps 563/udp snntp
submission 587/tcp
submission 587/udp
ldaps 636/tcp
ldaps 636/udp
tinc 655/tcp

View File

@@ -158,34 +158,29 @@ insert_modules() {
if [ -f /etc/modules.d/$m ]; then
sed 's/^[^#]/insmod &/' /etc/modules.d/$m | ash 2>&- || :
else
modprobe $m || :
modprobe $m
fi
done
}
default_prerm() {
local root="${IPKG_INSTROOT}"
local pkgname="$(basename ${1%.*})"
local ret=0
local name
if [ -f "$root/usr/lib/opkg/info/${pkgname}.prerm-pkg" ]; then
( . "$root/usr/lib/opkg/info/${pkgname}.prerm-pkg" )
ret=$?
fi
name=$(basename ${1%.*})
[ -f "$root/usr/lib/opkg/info/${name}.prerm-pkg" ] && . "$root/usr/lib/opkg/info/${name}.prerm-pkg"
local shell="$(which bash)"
for i in $(grep -s "^/etc/init.d/" "$root/usr/lib/opkg/info/${pkgname}.list"); do
for i in `cat "$root/usr/lib/opkg/info/${name}.list" | grep "^/etc/init.d/"`; do
if [ -n "$root" ]; then
${shell:-/bin/sh} "$root/etc/rc.common" "$root$i" disable
else
if [ "$PKG_UPGRADE" != "1" ]; then
"$i" disable
fi
"$i" stop
"$i" stop || /bin/true
fi
done
return $ret
}
add_group_and_user() {
@@ -243,9 +238,10 @@ default_postinst() {
if [ -z "$root" ] && grep -q -s "^/etc/uci-defaults/" "/usr/lib/opkg/info/${pkgname}.list"; then
. /lib/functions/system.sh
[ -d /tmp/.uci ] || mkdir -p /tmp/.uci
for i in $(grep -s "^/etc/uci-defaults/" "/usr/lib/opkg/info/${pkgname}.list"); do
( [ -f "$i" ] && cd "$(dirname $i)" && . "$i" ) && rm -f "$i"
done
for i in $(sed -ne 's!^/etc/uci-defaults/!!p' "/usr/lib/opkg/info/${pkgname}.list"); do (
cd /etc/uci-defaults
[ -f "$i" ] && . "$i" && rm -f "$i"
) done
uci commit
fi
@@ -357,8 +353,4 @@ user_exists() {
grep -qs "^${1}:" ${IPKG_INSTROOT}/etc/passwd
}
board_name() {
[ -e /tmp/sysinfo/board_name ] && cat /tmp/sysinfo/board_name || echo "generic"
}
[ -z "$IPKG_INSTROOT" -a -f /lib/config/uci.sh ] && . /lib/config/uci.sh

View File

@@ -29,9 +29,18 @@ network_get_ipaddr() {
# 1: destination variable
# 2: interface
network_get_ipaddr6() {
__network_ifstatus "$1" "$2" "['ipv6-address'][0].address" || \
__network_ifstatus "$1" "$2" "['ipv6-prefix-assignment'][0]['local-address'].address" || \
return 1
local __addr
if __network_ifstatus "__addr" "$2" "['ipv6-address','ipv6-prefix-assignment'][0].address"; then
case "$__addr" in
*:) export "$1=${__addr}1" ;;
*) export "$1=${__addr}" ;;
esac
return 0
fi
unset $1
return 1
}
# determine first IPv4 subnet of given logical interface
@@ -45,36 +54,7 @@ network_get_subnet() {
# 1: destination variable
# 2: interface
network_get_subnet6() {
local __nets __addr
if network_get_subnets6 __nets "$2"; then
# Attempt to return first non-fe80::/10, non-fc::/7 range
for __addr in $__nets; do
case "$__addr" in fe[8ab]?:*|f[cd]??:*)
continue
esac
export "$1=$__addr"
return 0
done
# Attempt to return first non-fe80::/10 range
for __addr in $__nets; do
case "$__addr" in fe[8ab]?:*)
continue
esac
export "$1=$__addr"
return 0
done
# Return first item
for __addr in $__nets; do
export "$1=$__addr"
return 0
done
fi
unset "$1"
return 1
__network_ifstatus "$1" "$2" "['ipv6-address'][0]['address','mask']" "/"
}
# determine first IPv6 prefix of given logical interface
@@ -98,19 +78,14 @@ network_get_ipaddrs6() {
local __addr
local __list=""
if __network_ifstatus "__addr" "$2" "['ipv6-address'][*].address"; then
if __network_ifstatus "__addr" "$2" "['ipv6-address','ipv6-prefix-assignment'][*].address"; then
for __addr in $__addr; do
__list="${__list:+$__list }${__addr}"
case "$__addr" in
*:) __list="${__list:+$__list }${__addr}1" ;;
*) __list="${__list:+$__list }${__addr}" ;;
esac
done
fi
if __network_ifstatus "__addr" "$2" "['ipv6-prefix-assignment'][*]['local-address'].address"; then
for __addr in $__addr; do
__list="${__list:+$__list }${__addr}"
done
fi
if [ -n "$__list" ]; then
export "$1=$__list"
return 0
fi
@@ -123,13 +98,18 @@ network_get_ipaddrs6() {
# 1: destination variable
# 2: interface
network_get_ipaddrs_all() {
local __addr __addr6
local __addr
local __list=""
network_get_ipaddrs __addr "$2"
network_get_ipaddrs6 __addr6 "$2"
if __network_ifstatus "__addr" "$2" "['ipv4-address','ipv6-address','ipv6-prefix-assignment'][*].address"; then
for __addr in $__addr; do
case "$__addr" in
*:) __list="${__list:+$__list }${__addr}1" ;;
*) __list="${__list:+$__list }${__addr}" ;;
esac
done
if [ -n "$__addr" -o -n "$__addr6" ]; then
export "$1=${__addr:+$__addr }$__addr6"
export "$1=$__list"
return 0
fi
@@ -148,24 +128,17 @@ network_get_subnets() {
# 1: destination variable
# 2: interface
network_get_subnets6() {
local __addr __mask
local __addr
local __list=""
if __network_ifstatus "__addr" "$2" "['ipv6-address'][*]['address','mask']" "/ "; then
if __network_ifstatus "__addr" "$2" "['ipv6-address','ipv6-prefix-assignment'][*]['address','mask']" "/ "; then
for __addr in $__addr; do
__list="${__list:+$__list }${__addr}"
case "$__addr" in
*:/*) __list="${__list:+$__list }${__addr%/*}1/${__addr##*/}" ;;
*) __list="${__list:+$__list }${__addr}" ;;
esac
done
fi
if __network_ifstatus "__addr" "$2" "['ipv6-prefix-assignment'][*]['local-address'].address" && \
__network_ifstatus "__mask" "$2" "['ipv6-prefix-assignment'][*].mask"; then
for __addr in $__addr; do
__list="${__list:+$__list }${__addr}/${__mask%% *}"
__mask="${__mask#* }"
done
fi
if [ -n "$__list" ]; then
export "$1=$__list"
return 0
fi

View File

@@ -35,7 +35,7 @@ _ucidef_set_interface() {
json_select_object "$name"
json_add_string ifname "$iface"
if ! json_is_a protocol string || [ -n "$proto" ]; then
if ! json_is_a protocol string; then
case "$proto" in
static|dhcp|none|pppoe) : ;;
*)
@@ -619,26 +619,6 @@ ucidef_add_gpio_switch() {
json_select ..
}
ucidef_set_hostname() {
local hostname="$1"
json_select_object system
json_add_string hostname "$hostname"
json_select ..
}
ucidef_set_ntpserver() {
local server
json_select_object system
json_select_array ntpserver
for server in "$@"; do
json_add_string "" "$server"
done
json_select ..
json_select ..
}
board_config_update() {
json_init
[ -f ${CFG} ] && json_load "$(cat ${CFG})"

View File

@@ -43,10 +43,7 @@ preinit_config_switch() {
json_select ..
if [ "$device" = "$lan_if" ]; then
if [ "$reset" -eq "1" ]; then
swconfig dev $name set reset
fi
swconfig dev $name set reset $reset
swconfig dev $name set enable_vlan $enable
swconfig dev $name vlan $role set ports "$ports"
swconfig dev $name set apply
@@ -99,8 +96,6 @@ preinit_config_board() {
}
preinit_ip() {
[ "$pi_preinit_no_failsafe" = "y" ] && return
# if the preinit interface isn't specified and ifname is set in
# preinit.arch use that interface
if [ -z "$pi_ifname" ]; then
@@ -112,8 +107,6 @@ preinit_ip() {
elif [ -d "/etc/board.d/" ]; then
preinit_config_board
fi
preinit_net_echo "Doing Lede Preinit\n"
}
preinit_ip_deconfig() {
@@ -147,7 +140,13 @@ preinit_net_echo() {
}
}
preinit_echo() {
preinit_net_echo $1
echo $1
}
pi_indicate_preinit() {
preinit_net_echo "Doing Lede Preinit\n"
set_state preinit
}

View File

@@ -208,7 +208,7 @@ get_magic_long() {
}
export_bootdevice() {
local cmdline uuid disk uevent line
local cmdline uuid disk uevent
local MAJOR MINOR DEVNAME DEVTYPE
if read cmdline < /proc/cmdline; then
@@ -241,9 +241,8 @@ export_bootdevice() {
esac
if [ -e "$uevent" ]; then
while read line; do
export -n "$line"
done < "$uevent"
. "$uevent"
export BOOTDEV_MAJOR=$MAJOR
export BOOTDEV_MINOR=$MINOR
return 0
@@ -255,12 +254,10 @@ export_bootdevice() {
export_partdevice() {
local var="$1" offset="$2"
local uevent line MAJOR MINOR DEVNAME DEVTYPE
local uevent MAJOR MINOR DEVNAME DEVTYPE
for uevent in /sys/class/block/*/uevent; do
while read line; do
export -n "$line"
done < "$uevent"
. "$uevent"
if [ $BOOTDEV_MAJOR = $MAJOR -a $(($BOOTDEV_MINOR + $offset)) = $MINOR -a -b "/dev/$DEVNAME" ]; then
export "$var=$DEVNAME"
return 0
@@ -270,14 +267,6 @@ export_partdevice() {
return 1
}
hex_le32_to_cpu() {
[ "$(echo 01 | hexdump -v -n 2 -e '/2 "%x"')" == "3031" ] && {
echo "${1:0:2}${1:8:2}${1:6:2}${1:4:2}${1:2:2}"
return
}
echo "$@"
}
get_partitions() { # <device> <filename>
local disk="$1"
local filename="$2"
@@ -285,8 +274,8 @@ get_partitions() { # <device> <filename>
if [ -b "$disk" -o -f "$disk" ]; then
v "Reading partition table from $filename..."
local magic=$(dd if="$disk" bs=2 count=1 skip=255 2>/dev/null)
if [ "$magic" != $'\x55\xAA' ]; then
local magic="$(hexdump -v -n 2 -s 0x1FE -e '1/2 "0x%04X"' "$disk")"
if [ "$magic" != 0xAA55 ]; then
v "Invalid partition table on $disk"
exit
fi
@@ -297,9 +286,9 @@ get_partitions() { # <device> <filename>
for part in 1 2 3 4; do
set -- $(hexdump -v -n 12 -s "$((0x1B2 + $part * 16))" -e '3/4 "0x%08X "' "$disk")
local type="$(( $(hex_le32_to_cpu $1) % 256))"
local lba="$(( $(hex_le32_to_cpu $2) ))"
local num="$(( $(hex_le32_to_cpu $3) ))"
local type="$(($1 % 256))"
local lba="$(($2))"
local num="$(($3))"
[ $type -gt 0 ] || continue

View File

@@ -101,31 +101,12 @@ EOF
# prevent messages from clobbering the tarball when using stdout
[ "$CONF_BACKUP" = "-" ] && export VERBOSE=0
list_conffiles() {
awk '
BEGIN { conffiles = 0 }
/^Conffiles:/ { conffiles = 1; next }
!/^ / { conffiles = 0; next }
conffiles == 1 { print }
' /usr/lib/opkg/status
}
list_changed_conffiles() {
# Cannot handle spaces in filenames - but opkg cannot either...
list_conffiles | while read file csum; do
[ -r "$file" ] || continue
echo "${csum} ${file}" | sha256sum -sc - || echo "$file"
done
}
add_uci_conffiles() {
local file="$1"
( find $(sed -ne '/^[[:space:]]*$/d; /^#/d; p' \
/etc/sysupgrade.conf /lib/upgrade/keep.d/* 2>/dev/null) \
-type f -o -type l 2>/dev/null;
list_changed_conffiles ) | sort -u > "$file"
opkg list-changed-conffiles ) | sort -u > "$file"
return 0
}

View File

@@ -6,8 +6,8 @@
usage() {
cat <<EOF
Usage: $0 [config|down|reload|status]
enables (default), disables or configures devices not yet configured.
Usage: $0 [down|detect|reload|status]
enables (default), disables or detects a wifi configuration.
EOF
exit 1
}
@@ -145,12 +145,6 @@ 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
@@ -235,7 +229,7 @@ scan_wifi
case "$1" in
down) wifi_updown "disable" "$2";;
detect) wifi_detect_notice ;;
detect) ;;
config) wifi_config ;;
status) ubus_wifi_cmd "status" "$2";;
reload) wifi_reload "$2";;

View File

@@ -1,5 +1,5 @@
#!/bin/sh
[ "$(uci -q get system.@system[0].ttylogin)" == 1 ] || exec /bin/ash --login
[ "$(uci get system.@system[0].ttylogin)" == 1 ] || exec /bin/ash --login
exec /bin/login

View File

@@ -190,7 +190,7 @@ if VERSIONOPT
config VERSION_REPO
string
prompt "Release repository"
default "http://downloads.lede-project.org/releases/17.01.7"
default "http://downloads.lede-project.org/releases/17.01.0"
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 n
default y
help
Enable this to include the revision identifier or the configured
version code into the firmware image, SDK- and Image Builder archive

View File

@@ -9,12 +9,15 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=grub
PKG_VERSION:=2.02
PKG_RELEASE:=2
PKG_VERSION:=2.02~beta3
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/grub
PKG_HASH:=810b3798d316394f94096ec2797909dbf23c858e48f7b3830826b8daa06b7b0f
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_FIXUP:=autoreconf
HOST_BUILD_PARALLEL:=1

View File

@@ -1,40 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Hector Marco-Gisbert <hecmargi@upv.es>
Date: Fri, 13 Nov 2015 16:21:09 +0100
Subject: [PATCH] Fix security issue when reading username and password
This patch fixes two integer underflows at:
* grub-core/lib/crypto.c
* grub-core/normal/auth.c
Resolves: CVE-2015-8370
Signed-off-by: Hector Marco-Gisbert <hecmargi@upv.es>
Signed-off-by: Ismael Ripoll-Ripoll <iripoll@disca.upv.es>
---
grub-core/lib/crypto.c | 2 +-
grub-core/normal/auth.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--- a/grub-core/lib/crypto.c
+++ b/grub-core/lib/crypto.c
@@ -468,7 +468,7 @@ grub_password_get (char buf[], unsigned
break;
}
- if (key == '\b')
+ if (key == '\b' && cur_len)
{
if (cur_len)
cur_len--;
--- a/grub-core/normal/auth.c
+++ b/grub-core/normal/auth.c
@@ -172,7 +172,7 @@ grub_username_get (char buf[], unsigned
break;
}
- if (key == '\b')
+ if (key == '\b' && cur_len)
{
if (cur_len)
{

View File

@@ -1,33 +0,0 @@
commit 263e45ccf27b21e9862cc538ed28978533d04e4b
Author: Baoquan He <bhe@redhat.com>
Date: Fri Mar 3 11:52:15 2017 +0800
Only print debug message when failed to serach for kernel symbol from /proc/kallsyms
Kernel symbol page_offset_base could be unavailable when mm KASLR code is
not compiled in kernel. It's inappropriate to print out error message
when failed to search for page_offset_base from /proc/kallsyms. Seems now
there is not a way to find out if mm KASLR is compiled in or not. An
alternative approach is only printing out debug message in get_kernel_sym
if failed to search a expected kernel symbol.
Do it in this patch, a simple fix.
Signed-off-by: Baoquan He <bhe@redhat.com>
Reviewed-by: Pratyush Anand <panand@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
index 88aeee3..c4cf201 100644
--- a/kexec/arch/i386/crashdump-x86.c
+++ b/kexec/arch/i386/crashdump-x86.c
@@ -127,7 +127,7 @@ static unsigned long long get_kernel_sym(const char *symbol)
}
}
- fprintf(stderr, "Cannot get kernel %s symbol address\n", symbol);
+ dbgprintf("Cannot get kernel %s symbol address\n", symbol);
return 0;
}

View File

@@ -1,178 +0,0 @@
commit f14881e87b1426d2c439e2fad9a1e03a3b35e196
Author: Philip Prindeville <philipp@redfish-solutions.com>
Date: Fri Mar 10 19:57:11 2017 -0700
Don't use %L width specifier with integer values
MUSL doesn't support %L except for floating-point arguments; therefore,
%ll must be used instead with integer arguments.
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
diff --git a/kexec/arch/arm/kexec-arm.c b/kexec/arch/arm/kexec-arm.c
index 2194b7c..49f35b1 100644
--- a/kexec/arch/arm/kexec-arm.c
+++ b/kexec/arch/arm/kexec-arm.c
@@ -47,7 +47,7 @@ int get_memory_ranges(struct memory_range **range, int *ranges,
int count;
if (memory_ranges >= MAX_MEMORY_RANGES)
break;
- count = sscanf(line, "%Lx-%Lx : %n",
+ count = sscanf(line, "%llx-%llx : %n",
&start, &end, &consumed);
if (count != 2)
continue;
diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
index c4cf201..285dea9 100644
--- a/kexec/arch/i386/crashdump-x86.c
+++ b/kexec/arch/i386/crashdump-x86.c
@@ -119,7 +119,7 @@ static unsigned long long get_kernel_sym(const char *symbol)
}
while(fgets(line, sizeof(line), fp) != NULL) {
- if (sscanf(line, "%Lx %c %s", &vaddr, &type, sym) != 3)
+ if (sscanf(line, "%llx %c %s", &vaddr, &type, sym) != 3)
continue;
if (strcmp(sym, symbol) == 0) {
dbgprintf("kernel symbol %s vaddr = %16llx\n", symbol, vaddr);
@@ -296,12 +296,12 @@ static int get_crash_memory_ranges(struct memory_range **range, int *ranges,
if (memory_ranges >= CRASH_MAX_MEMORY_RANGES)
break;
- count = sscanf(line, "%Lx-%Lx : %n",
+ count = sscanf(line, "%llx-%llx : %n",
&start, &end, &consumed);
if (count != 2)
continue;
str = line + consumed;
- dbgprintf("%016Lx-%016Lx : %s",
+ dbgprintf("%016llx-%016llx : %s",
start, end, str);
/* Only Dumping memory of type System RAM. */
if (memcmp(str, "System RAM\n", 11) == 0) {
@@ -778,7 +778,7 @@ static int get_crash_notes(int cpu, uint64_t *addr, uint64_t *len)
*addr = x86__pa(vaddr + (cpu * MAX_NOTE_BYTES));
*len = MAX_NOTE_BYTES;
- dbgprintf("crash_notes addr = %Lx\n",
+ dbgprintf("crash_notes addr = %llx\n",
(unsigned long long)*addr);
fclose(fp);
diff --git a/kexec/arch/i386/kexec-x86-common.c b/kexec/arch/i386/kexec-x86-common.c
index 3e97239..be03618 100644
--- a/kexec/arch/i386/kexec-x86-common.c
+++ b/kexec/arch/i386/kexec-x86-common.c
@@ -81,7 +81,7 @@ static int get_memory_ranges_proc_iomem(struct memory_range **range, int *ranges
int count;
if (memory_ranges >= MAX_MEMORY_RANGES)
break;
- count = sscanf(line, "%Lx-%Lx : %n",
+ count = sscanf(line, "%llx-%llx : %n",
&start, &end, &consumed);
if (count != 2)
continue;
diff --git a/kexec/arch/ia64/kexec-elf-rel-ia64.c b/kexec/arch/ia64/kexec-elf-rel-ia64.c
index 7f7c08c..500f247 100644
--- a/kexec/arch/ia64/kexec-elf-rel-ia64.c
+++ b/kexec/arch/ia64/kexec-elf-rel-ia64.c
@@ -155,6 +155,6 @@ void machine_apply_elf_rel(struct mem_ehdr *ehdr,
}
return;
overflow:
- die("overflow in relocation type %lu val %Lx\n",
+ die("overflow in relocation type %lu val %llx\n",
r_type, value);
}
diff --git a/kexec/arch/mips/crashdump-mips.c b/kexec/arch/mips/crashdump-mips.c
index 9c33599..6308ec8 100644
--- a/kexec/arch/mips/crashdump-mips.c
+++ b/kexec/arch/mips/crashdump-mips.c
@@ -173,7 +173,7 @@ static int get_crash_memory_ranges(struct memory_range **range, int *ranges)
int type, consumed, count;
if (memory_ranges >= CRASH_MAX_MEMORY_RANGES)
break;
- count = sscanf(line, "%Lx-%Lx : %n",
+ count = sscanf(line, "%llx-%llx : %n",
&start, &end, &consumed);
if (count != 2)
continue;
diff --git a/kexec/arch/mips/kexec-mips.c b/kexec/arch/mips/kexec-mips.c
index ee3cd3a..2e5b700 100644
--- a/kexec/arch/mips/kexec-mips.c
+++ b/kexec/arch/mips/kexec-mips.c
@@ -48,7 +48,7 @@ int get_memory_ranges(struct memory_range **range, int *ranges,
while (fgets(line, sizeof(line), fp) != 0) {
if (memory_ranges >= MAX_MEMORY_RANGES)
break;
- count = sscanf(line, "%Lx-%Lx : %n", &start, &end, &consumed);
+ count = sscanf(line, "%llx-%llx : %n", &start, &end, &consumed);
if (count != 2)
continue;
str = line + consumed;
diff --git a/kexec/arch/s390/kexec-s390.c b/kexec/arch/s390/kexec-s390.c
index f863483..33ba6b9 100644
--- a/kexec/arch/s390/kexec-s390.c
+++ b/kexec/arch/s390/kexec-s390.c
@@ -170,7 +170,7 @@ int get_memory_ranges_s390(struct memory_range memory_range[], int *ranges,
if (current_range == MAX_MEMORY_RANGES)
break;
- sscanf(line,"%Lx-%Lx : %n", &start, &end, &cons);
+ sscanf(line,"%llx-%llx : %n", &start, &end, &cons);
str = line+cons;
if ((memcmp(str, sys_ram, strlen(sys_ram)) == 0) ||
((memcmp(str, crash_kernel, strlen(crash_kernel)) == 0) &&
diff --git a/kexec/crashdump.c b/kexec/crashdump.c
index 15c1105..0b363c5 100644
--- a/kexec/crashdump.c
+++ b/kexec/crashdump.c
@@ -98,7 +98,7 @@ int get_crash_notes_per_cpu(int cpu, uint64_t *addr, uint64_t *len)
}
if (!fgets(line, sizeof(line), fp))
die("Cannot parse %s: %s\n", crash_notes, strerror(errno));
- count = sscanf(line, "%Lx", &temp);
+ count = sscanf(line, "%llx", &temp);
if (count != 1)
die("Cannot parse %s: %s\n", crash_notes, strerror(errno));
*addr = (uint64_t) temp;
@@ -112,7 +112,7 @@ int get_crash_notes_per_cpu(int cpu, uint64_t *addr, uint64_t *len)
if (!fgets(line, sizeof(line), fp))
die("Cannot parse %s: %s\n",
crash_notes_size, strerror(errno));
- count = sscanf(line, "%Lu", &temp);
+ count = sscanf(line, "%llu", &temp);
if (count != 1)
die("Cannot parse %s: %s\n",
crash_notes_size, strerror(errno));
@@ -120,7 +120,7 @@ int get_crash_notes_per_cpu(int cpu, uint64_t *addr, uint64_t *len)
fclose(fp);
}
- dbgprintf("%s: crash_notes addr = %Lx, size = %Lu\n", __FUNCTION__,
+ dbgprintf("%s: crash_notes addr = %llx, size = %llu\n", __FUNCTION__,
(unsigned long long)*addr, (unsigned long long)*len);
return 0;
@@ -141,7 +141,7 @@ static int get_vmcoreinfo(const char *kdump_info, uint64_t *addr, uint64_t *len)
if (!fgets(line, sizeof(line), fp))
die("Cannot parse %s: %s\n", kdump_info, strerror(errno));
- count = sscanf(line, "%Lx %Lx", &temp, &temp2);
+ count = sscanf(line, "%llx %llx", &temp, &temp2);
if (count != 2)
die("Cannot parse %s: %s\n", kdump_info, strerror(errno));
diff --git a/kexec/kexec-iomem.c b/kexec/kexec-iomem.c
index 485a2e8..7ec3853 100644
--- a/kexec/kexec-iomem.c
+++ b/kexec/kexec-iomem.c
@@ -44,7 +44,7 @@ int kexec_iomem_for_each_line(char *match,
die("Cannot open %s\n", iomem);
while(fgets(line, sizeof(line), fp) != 0) {
- count = sscanf(line, "%Lx-%Lx : %n", &start, &end, &consumed);
+ count = sscanf(line, "%llx-%llx : %n", &start, &end, &consumed);
if (count != 2)
continue;
str = line + consumed;

View File

@@ -18,7 +18,6 @@ a40|\
a60|\
alfa-ap120c|\
all0258n|\
ap121f|\
ap90q|\
cap324|\
cap4200ag|\

View File

@@ -7,10 +7,11 @@
touch /etc/config/ubootenv
. /lib/functions/lantiq.sh
. /lib/uboot-envtools.sh
. /lib/functions.sh
board=$(board_name)
board=$(lantiq_board_name)
case "$board" in
BTHOMEHUBV2B)

View File

@@ -1,65 +0,0 @@
From 183eb37e25d903ccd68cc2d8f8a37e75872c03d2 Mon Sep 17 00:00:00 2001
From: Nick Clifton <nickc@redhat.com>
Date: Tue, 6 Sep 2016 17:35:35 +0100
Subject: [PATCH 1/2] Do not pass host compiler sanitization flags on to linker
testsuite.
* Makefile.am (CFLAGS_FOR_TARGET): Define as a copy of CFLAGS but
without any sanitization options.
(CXXFLAGS_FOR_TARGET): Define as a copy of CXXFLAGS but without
any sanitization options.
(check-DEJAGNU): Pass CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET
as CFLAGS and CXXFLAGS respectively.
---
ld/Makefile.am | 8 ++++++--
ld/Makefile.in | 8 ++++++--
2 files changed, 12 insertions(+), 4 deletions(-)
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -136,6 +136,10 @@ CXX_FOR_TARGET = ` \
fi; \
fi`
+# Strip out sanitization options as we want to test building binaries without any extra paraphernalia
+CFLAGS_FOR_TARGET = `echo $(CFLAGS) | sed -e 's/-fsanitize=address//g' -e 's/-fsanitize=undefined//g'`
+CXXFLAGS_FOR_TARGET = `echo $(CXXFLAGS) | sed -e 's/-fsanitize=address//g' -e 's/-fsanitize=undefined//g'`
+
transform = s/^ld-new$$/$(installed_linker)/;@program_transform_name@
bin_PROGRAMS = ld-new
info_TEXINFOS = ld.texinfo
@@ -2075,8 +2079,8 @@ check-DEJAGNU: site.exp
runtest=$(RUNTEST); \
if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
$$runtest --tool $(DEJATOOL) --srcdir $${srcroot}/testsuite \
- CC="$(CC_FOR_TARGET)" CFLAGS="$(CFLAGS)" \
- CXX="$(CXX_FOR_TARGET)" CXXFLAGS="$(CXXFLAGS)" \
+ CC="$(CC_FOR_TARGET)" CFLAGS="$(CFLAGS_FOR_TARGET)" \
+ CXX="$(CXX_FOR_TARGET)" CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \
CC_FOR_HOST="$(CC)" CFLAGS_FOR_HOST="$(CFLAGS)" \
OFILES="$(OFILES)" BFDLIB="$(TESTBFDLIB)" \
LIBIBERTY="$(LIBIBERTY) $(LIBINTL)" LIBS="$(LIBS)" \
--- a/ld/Makefile.in
+++ b/ld/Makefile.in
@@ -507,6 +507,10 @@ CXX_FOR_TARGET = ` \
fi; \
fi`
+
+# Strip out sanitization options as they require special host libraries.
+CFLAGS_FOR_TARGET = `echo $(CFLAGS) | sed -e 's/-fsanitize=address//g' -e 's/-fsanitize=undefined//g'`
+CXXFLAGS_FOR_TARGET = `echo $(CXXFLAGS) | sed -e 's/-fsanitize=address//g' -e 's/-fsanitize=undefined//g'`
info_TEXINFOS = ld.texinfo
ld_TEXINFOS = configdoc.texi
noinst_TEXINFOS = ldint.texinfo
@@ -3644,8 +3648,8 @@ check-DEJAGNU: site.exp
runtest=$(RUNTEST); \
if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
$$runtest --tool $(DEJATOOL) --srcdir $${srcroot}/testsuite \
- CC="$(CC_FOR_TARGET)" CFLAGS="$(CFLAGS)" \
- CXX="$(CXX_FOR_TARGET)" CXXFLAGS="$(CXXFLAGS)" \
+ CC="$(CC_FOR_TARGET)" CFLAGS="$(CFLAGS_FOR_TARGET)" \
+ CXX="$(CXX_FOR_TARGET)" CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \
CC_FOR_HOST="$(CC)" CFLAGS_FOR_HOST="$(CFLAGS)" \
OFILES="$(OFILES)" BFDLIB="$(TESTBFDLIB)" \
LIBIBERTY="$(LIBIBERTY) $(LIBINTL)" LIBS="$(LIBS)" \

View File

@@ -60,6 +60,13 @@ CONFIGURE_ARGS+= \
CONFIGURE_VARS+= \
ac_cv_search_tgetent="$(TARGET_LDFLAGS) -lncurses -lreadline"
define Build/Compile
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
DESTDIR="$(PKG_INSTALL_DIR)" \
CPPFLAGS="$(TARGET_CPPFLAGS)" \
all
endef
define Build/Install
$(MAKE) -C $(PKG_BUILD_DIR) \
DESTDIR="$(PKG_INSTALL_DIR)" \

View File

@@ -26,7 +26,7 @@ include $(INCLUDE_DIR)/package.mk
define Package/perf
SECTION:=devel
CATEGORY:=Development
DEPENDS:= +libelf1 +libdw +(mips||mipsel||powerpc||i386||x86_64||arm||aarch64):libunwind +libpthread +librt +objdump @!LINUX_3_18 @!IN_SDK
DEPENDS:= +libelf1 +libdw +libpthread +librt +objdump @!LINUX_3_18 @!IN_SDK
TITLE:=Linux performance monitoring tool
VERSION:=$(LINUX_VERSION)-$(PKG_RELEASE)
URL:=http://www.kernel.org

View File

@@ -10,9 +10,9 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=strace
PKG_VERSION:=4.16
PKG_VERSION:=4.15
PKG_RELEASE:=1
PKG_HASH:=98487cb5178ec1259986cc9f6e2a844f50e5d1208c112cc22431a1e4d9adf0ef
PKG_HASH:=c0cdc094d6141fd9dbf6aaad605142d651ae10998b660fda57fc61f7ad583ca9
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@SF/$(PKG_NAME)

View File

@@ -1,6 +1,6 @@
--- a/ptrace.h
+++ b/ptrace.h
@@ -48,7 +48,14 @@
@@ -55,7 +55,14 @@ extern long ptrace(int, int, char *, lon
# define ptrace_peeksiginfo_args XXX_ptrace_peeksiginfo_args
#endif

View File

@@ -1,12 +1,15 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=trace-cmd
PKG_VERSION:=v2.6.1
PKG_VERSION:=v2.6
PKG_RELEASE=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git/snapshot/
PKG_HASH:=4eb79001778a77c0ada10265e7f4b5515a3e21a46f0a15c2e8cc614efdf3f5df
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=\
https://kernel.googlesource.com/pub/scm/linux/kernel/git/rostedt/trace-cmd \
https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git
PKG_SOURCE_VERSION:=9be5d74805830a291615f2f34a27c903f6a37b1e
PKG_MIRROR_HASH:=735b69f61a8c627037dcc01361cdb8415e5ab0ec892fbd731236c444003b0c71
PKG_INSTALL:=1
PKG_USE_MIPS16:=0
PKG_LICENSE:=GPL-2.0

View File

@@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=valgrind
PKG_VERSION:=3.13.0
PKG_VERSION:=3.12.0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://sourceware.org/pub/valgrind/
PKG_HASH:=d76680ef03f00cd5e970bbdcd4e57fb1f6df7d2e2c071635ef2be74790190c3b
PKG_SOURCE_URL:=http://valgrind.org/downloads/
PKG_HASH:=67ca4395b2527247780f36148b084f5743a68ab0c850cb43e4a5b4b012cf76a1
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_LICENSE:=GPL-2.0+

View File

@@ -1,6 +1,6 @@
--- a/configure.ac
+++ b/configure.ac
@@ -323,7 +323,7 @@ case "${host_os}" in
@@ -328,7 +328,7 @@ case "${host_os}" in
# Ok, this is linux. Check the kernel version
AC_MSG_CHECKING([for the kernel version])

View File

@@ -0,0 +1,45 @@
--- a/coregrind/vg_preloaded.c
+++ b/coregrind/vg_preloaded.c
@@ -57,7 +57,7 @@
void VG_NOTIFY_ON_LOAD(freeres)(Vg_FreeresToRun to_run);
void VG_NOTIFY_ON_LOAD(freeres)(Vg_FreeresToRun to_run)
{
-# if !defined(__UCLIBC__) \
+# if !defined(__UCLIBC__) && defined(__GLIBC__) \
&& !defined(VGPV_arm_linux_android) \
&& !defined(VGPV_x86_linux_android) \
&& !defined(VGPV_mips32_linux_android) \
--- a/include/pub_tool_redir.h
+++ b/include/pub_tool_redir.h
@@ -243,7 +243,7 @@
/* --- Soname of the standard C library. --- */
#if defined(VGO_linux) || defined(VGO_solaris)
-# define VG_Z_LIBC_SONAME libcZdsoZa // libc.so*
+# define VG_Z_LIBC_SONAME libcZdZa // libc.*
#elif defined(VGO_darwin) && (DARWIN_VERS <= DARWIN_10_6)
# define VG_Z_LIBC_SONAME libSystemZdZaZddylib // libSystem.*.dylib
@@ -275,7 +275,11 @@
/* --- Soname of the pthreads library. --- */
#if defined(VGO_linux)
+# if defined(__GLIBC__) || defined(__UCLIBC__)
# define VG_Z_LIBPTHREAD_SONAME libpthreadZdsoZd0 // libpthread.so.0
+# else
+# define VG_Z_LIBPTHREAD_SONAME libcZdZa // libc.*
+# endif
#elif defined(VGO_darwin)
# define VG_Z_LIBPTHREAD_SONAME libSystemZdZaZddylib // libSystem.*.dylib
#elif defined(VGO_solaris)
--- a/configure.ac
+++ b/configure.ac
@@ -1047,8 +1047,6 @@ case "${GLIBC_VERSION}" in
;;
2.0|2.1|*)
AC_MSG_RESULT([unsupported version ${GLIBC_VERSION}])
- AC_MSG_ERROR([Valgrind requires glibc version 2.2 or later,])
- AC_MSG_ERROR([Darwin libc, Bionic libc or Solaris libc])
;;
esac

View File

@@ -1,45 +0,0 @@
#
# Copyright (C) 2018 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=amd64-microcode
PKG_VERSION:=20180524
PKG_RELEASE:=1
PKG_SOURCE:=amd64-microcode_3.$(PKG_VERSION).$(PKG_RELEASE).tar.xz
PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/non-free/a/amd64-microcode/
PKG_HASH:=7c389c357c242e7161f6872bf4e12011a71e4c0683f06fb1bcfad650a78bf0a9
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-3.$(PKG_VERSION).$(PKG_RELEASE)
PKG_LICENSE_FILE:=LICENSE.amd-ucode
include $(INCLUDE_DIR)/package.mk
define Package/amd64-microcode
SECTION:=firmware
CATEGORY:=Firmware
URL:=$(PKG_SOURCE_URL)
DEPENDS:=@TARGET_x86
TITLE:=AMD64 CPU microcode
endef
define Build/Prepare
rm -rf $(PKG_BUILD_DIR)
mkdir -p $(PKG_BUILD_DIR)
$(TAR) -C $(BUILD_DIR) -xJf $(DL_DIR)/$(PKG_SOURCE)
endef
define Build/Compile
endef
define Package/amd64-microcode/install
$(INSTALL_DIR) $(1)/lib/firmware/amd-ucode
$(INSTALL_DATA) $(PKG_BUILD_DIR)/*.bin $(1)/lib/firmware/amd-ucode
endef
$(eval $(call BuildPackage,amd64-microcode))

View File

@@ -32,11 +32,6 @@ $(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
@@ -63,6 +58,7 @@ $(eval $(call Download,ath10k-qca9887-board))
define Package/ath10k-firmware-qca988x
$(Package/ath10k-firmware-default)
DEFAULT:=PACKAGE_kmod-ath10k
TITLE:=ath10k firmware for QCA988x devices
SECTION:=firmware
CATEGORY:=Firmware
@@ -76,20 +72,13 @@ define Download/ct-firmware
URL_FILE:=$($(1)_FIRMWARE_FILE_CT)
endef
QCA988X_FIRMWARE_FILE_CT:=firmware-2-ct-full-community.bin-19-rc3-lede
QCA988X_FIRMWARE_FILE_CT:=firmware-2-ct-full-community.bin-19.rc1-lede
define Download/ath10k-firmware-qca988x-ct
$(call Download/ct-firmware,QCA988X,)
HASH:=4112d78161a2c20e7a9490ea8d04e9f919508bafb097d88761dcce026c26f93f
HASH:=ad41b29a9eebf1066f993beb571f3bd13f14ea89336ef9d4f3b31ee57e7abe54
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)
@@ -118,13 +107,6 @@ $(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:
@@ -134,14 +116,6 @@ 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:
@@ -203,18 +177,18 @@ define Download/qca99x0-board
endef
$(eval $(call Download,qca99x0-board))
QCA9984_BOARD_REV:=719c0127e52bd70559e71b85ab0331790e1bf66c
QCA9984_BOARD_REV:=deb1832c56c706d0f6cb539113e09f0daaa52b5f
QCA9984_BOARD_FILE:=board-2.bin
QCA9984_BOARD_FILE_DL:=$(QCA9984_BOARD_FILE).$(QCA9984_BOARD_REV)
QCA9984_FIRMWARE_REV:=d43cb1188154037506e94abf3aa456cc934c6861
QCA9984_FIRMWARE_FILE:=firmware-5.bin_10.4-3.4-00072
QCA9984_FIRMWARE_REV:=deb1832c56c706d0f6cb539113e09f0daaa52b5f
QCA9984_FIRMWARE_FILE:=firmware-5.bin_10.4-3.3-00102
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:=e968b214fd76d5b7859f71841ce40fbd5f47336c3ccbaf95e23f902f5e569aef
HASH:=6a79ff0e8cc71549e771b41dbb7dad862d8e29da852f8aff25ce1e4bd5ea263e
endef
$(eval $(call Download,ath10k-qca9984-board))
@@ -222,7 +196,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:=28d5834e8c4ca8fcef9ea033cd8b9b0f9ee84ecf30dbde84c9c64bf8dd9912bc
HASH:=490ad52df76a4fa8004a3a8c21dd43bb8262dd2816df48a6408706b82491f299
endef
$(eval $(call Download,ath10k-qca9984-firmware))
@@ -250,16 +224,6 @@ 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) \
@@ -333,7 +297,6 @@ $(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))

View File

@@ -1,49 +0,0 @@
#
# Copyright (C) 2018 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=intel-microcode
PKG_VERSION:=20180703
PKG_RELEASE:=2
PKG_SOURCE:=intel-microcode_3.$(PKG_VERSION).$(PKG_RELEASE).tar.xz
PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/non-free/i/intel-microcode/
PKG_HASH:=26dfaa47100ce3d06f968edefa7539da10de7b96d5d8e26ee8174a040ee5cdae
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-3.$(PKG_VERSION).$(PKG_RELEASE)
PKG_BUILD_DEPENDS:=iucode-tool/host
ifdef CONFIG_TARGET_x86_64
MICROCODE:="intel-microcode-64"
else
MICROCODE:="intel-microcode"
endif
include $(INCLUDE_DIR)/package.mk
define Package/intel-microcode
SECTION:=firmware
CATEGORY:=Firmware
URL:=$(PKG_SOURCE_URL)
DEPENDS:=@TARGET_x86 +iucode-tool
TITLE:=Intel x86 CPU microcode
endef
define Build/Compile
IUCODE_TOOL=$(STAGING_DIR)/../host/bin/iucode_tool $(MAKE) -C $(PKG_BUILD_DIR)
mkdir $(PKG_BUILD_DIR)/intel-ucode-ipkg
$(STAGING_DIR)/../host/bin/iucode_tool -q \
--write-firmware=$(PKG_BUILD_DIR)/intel-ucode-ipkg $(PKG_BUILD_DIR)/$(MICROCODE).bin
endef
define Package/intel-microcode/install
$(INSTALL_DIR) $(1)/lib/firmware/intel-ucode
$(INSTALL_DATA) $(PKG_BUILD_DIR)/intel-ucode-ipkg/* $(1)/lib/firmware/intel-ucode
endef
$(eval $(call BuildPackage,intel-microcode))

View File

@@ -20,15 +20,6 @@ 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

View File

@@ -81,32 +81,3 @@
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);
}

View File

@@ -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-26
PKG_SOURCE_VERSION:=d2bc84ff277936c58231f0c2280242eda4199e63
PKG_MIRROR_HASH:=6b734b987db00b97b06faca686dcebc56fb23b93093afbb35d5cf534987269bf
PKG_SOURCE_DATE:=2017-01-10
PKG_SOURCE_VERSION:=f5bacb83baf95e887c50c286606f4f565ef71d86
PKG_MIRROR_HASH:=845950a177ed6dd7ad3f645df79403e9980f089a09b66e74a9b88abe58dfe5e6
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 +kmod-hwmon-core
DEPENDS:=+kmod-mac80211 +kmod-ath +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT @PCI_SUPPORT +@KERNEL_RELAY
FILES:=\
$(PKG_BUILD_DIR)/ath10k/ath10k_pci.ko \
$(PKG_BUILD_DIR)/ath10k/ath10k_core.ko

View File

@@ -1,97 +0,0 @@
--- 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);

View File

@@ -1,11 +0,0 @@
--- 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));

View File

@@ -1,6 +1,6 @@
#
# Copyright (C) 2012-2016 OpenWrt.org
# Copyright (C) 2017 LEDE project
# Copyright (C) 2016 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:=2017-03-03
PKG_RELEASE:=78c4983379de0537f49a97fb37ceaaf42632b28c
PKG_VERSION:=2016-12-04
PKG_RELEASE:=d760a4ffd378c648ff5d9854e26dc868a5e1fd09
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:=d990031baec20fe2cd5e24d9f3d6fc34891afdb128838d010d9a0249ae29ea6b
HASH:=a11bd31647c25712648757be75a19fa78c1df6f2409c7bf9bd202903f0421c0c
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:=38b69384f62bc7b64f17dcedc03c5582af6b4f8dfc25fe5904d4eb3181a3387b
HASH:=93314d9e01fb53bdf4a25422de89d103cd2e779bd5e81663c658eaecd0c8018e
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:=05c682ffcc74cd1356f1b9a32a7034763bfea94e5cb54eaaa2e69affc1cd33d7
HASH:=638671b81590bfdda5eac683d2025e50bb71c663e702f047ef299e23722f6cdd
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:=59b9d26b463a84f017fae186493bb54e642de6c7e0376b3cbe3375df6132edc0
HASH:=cd60fdce9022fa1195a27f3fdf8eba9136476649006e33b72cbdb23dc3b74e90
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:=fb9aea03eb6790062c100166444bf7d2b8a6cea605bd041f905fcacefacbbae2
HASH:=2f0cdcdaad7b9bf64f5288e206d54e007597c0c4068a5b893c02e0f4c0785ca5
endef
$(eval $(call Download,start_cd_elf))

View File

@@ -0,0 +1,92 @@
#
# 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

View File

@@ -0,0 +1,22 @@
--- 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

View File

@@ -0,0 +1,53 @@
--- 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, &timesync_isr, SA_SHIRQ, DRIVERNAME,
+ if ( request_irq(dev->irq, &timesync_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;

View File

@@ -0,0 +1,56 @@
--- 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);

View File

@@ -0,0 +1,41 @@
--- 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);
}

View File

@@ -0,0 +1,103 @@
--- 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;
}

View File

@@ -0,0 +1,60 @@
--- 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 */

View File

@@ -0,0 +1,20 @@
--- 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++);

View File

@@ -0,0 +1,20 @@
--- 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");

View File

@@ -0,0 +1,12 @@
--- 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)){

View File

@@ -0,0 +1,747 @@
--- 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, &reg_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, &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_ */

View File

@@ -0,0 +1,11 @@
--- 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.
*****************************************************************************/

View File

@@ -0,0 +1,11 @@
--- 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");

View File

@@ -0,0 +1,23 @@
--- 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

View File

@@ -0,0 +1,40 @@
--- 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);

View File

@@ -0,0 +1,59 @@
--- 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;

View File

@@ -0,0 +1,22 @@
--- 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;

View File

@@ -0,0 +1,22 @@
--- 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);

View File

@@ -0,0 +1,22 @@
--- 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 */

View File

@@ -0,0 +1,30 @@
--- 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");

View File

@@ -0,0 +1,31 @@
--- 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_ */

View File

@@ -0,0 +1,11 @@
--- 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

View File

@@ -0,0 +1,91 @@
--- 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

View File

@@ -0,0 +1,392 @@
--- 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;

View File

@@ -0,0 +1,41 @@
--- 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);

View File

@@ -0,0 +1,33 @@
--- 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;

View File

@@ -0,0 +1,31 @@
--- 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;

View File

@@ -0,0 +1,33 @@
--- 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

View File

@@ -1,52 +0,0 @@
#
# 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))

View File

@@ -1,5 +0,0 @@
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

Some files were not shown because too many files have changed in this diff Show More