Skip to content

Commit

Permalink
RTL8821CU: initial package
Browse files Browse the repository at this point in the history
  • Loading branch information
adamg committed Jun 11, 2019
1 parent cc2deed commit a6d9454
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 0 deletions.
32 changes: 32 additions & 0 deletions packages/linux-drivers/RTL8821CU/package.mk
@@ -0,0 +1,32 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2018-present Team CoreELEC (https://coreelec.org)

PKG_NAME="RTL8821CU"
PKG_VERSION="0278eaa9937a7c60f2916b5d334e40dfb7870bb0"
PKG_SHA256="5ba1950081183e24860c87aa903fc4ee532805df39c7e729c0892bcc319e211f"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/whitebatman2/rtl8821CU"
PKG_URL="https://github.com/whitebatman2/rtl8821CU/archive/$PKG_VERSION.tar.gz"
PKG_SOURCE_DIR="rtl8821CU-$PKG_VERSION*"
PKG_DEPENDS_TARGET="toolchain linux"
PKG_NEED_UNPACK="$LINUX_DEPENDS"
PKG_SECTION="driver"
PKG_LONGDESC="Realtek RTL8821CU Linux driver"
PKG_IS_KERNEL_PKG="yes"

pre_make_target() {
unset LDFLAGS
}

make_target() {
make \
ARCH=$TARGET_KERNEL_ARCH \
KSRC=$(kernel_path) \
CROSS_COMPILE=$TARGET_KERNEL_PREFIX \
CONFIG_POWER_SAVING=n
}

makeinstall_target() {
mkdir -p $INSTALL/$(get_full_module_dir)/$PKG_NAME
cp *.ko $INSTALL/$(get_full_module_dir)/$PKG_NAME
}
@@ -0,0 +1,23 @@
--- a/Makefile
+++ b/Makefile
@@ -93,9 +93,9 @@
###################### MP HW TX MODE FOR VHT #######################
CONFIG_MP_VHT_HW_TX_MODE = n
###################### Platform Related #######################
-CONFIG_PLATFORM_I386_PC = y
+CONFIG_PLATFORM_I386_PC = n
CONFIG_PLATFORM_ARM_RPI = n
-CONFIG_PLATFORM_ARM_RPI3 = n
+CONFIG_PLATFORM_ARM_RPI3 = y
CONFIG_PLATFORM_ANDROID_X86 = n
CONFIG_PLATFORM_ANDROID_INTEL_X86 = n
CONFIG_PLATFORM_JB_X86 = n
@@ -1096,7 +1096,7 @@
ARCH ?= arm64
CROSS_COMPILE ?=
KVER ?= $(shell uname -r)
-KSRC := /lib/modules/$(KVER)/build
+KSRC ?= /lib/modules/$(KVER)/build
MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless/
INSTALL_PREFIX :=
endif
@@ -0,0 +1,24 @@
--- a/include/ieee80211.h
+++ b/include/ieee80211.h
@@ -1483,18 +1483,18 @@
(((Addr[2]) & 0xff) == 0xff) && (((Addr[3]) & 0xff) == 0xff) && (((Addr[4]) & 0xff) == 0xff) && \
(((Addr[5]) & 0xff) == 0xff))
#else
-extern __inline int is_multicast_mac_addr(const u8 *addr)
+static __inline int is_multicast_mac_addr(const u8 *addr)
{
return (addr[0] != 0xff) && (0x01 & addr[0]);
}

-extern __inline int is_broadcast_mac_addr(const u8 *addr)
+static __inline int is_broadcast_mac_addr(const u8 *addr)
{
return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \
(addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff));
}

-extern __inline int is_zero_mac_addr(const u8 *addr)
+static __inline int is_zero_mac_addr(const u8 *addr)
{
return ((addr[0] == 0x00) && (addr[1] == 0x00) && (addr[2] == 0x00) && \
(addr[3] == 0x00) && (addr[4] == 0x00) && (addr[5] == 0x00));

0 comments on commit a6d9454

Please sign in to comment.