1
0
mirror of https://github.com/abperiasamy/rtl8812AU_8821AU_linux.git synced 2025-04-29 15:19:40 +02:00
Ben Greear ba6fa69560 Openwrt and new compiler related fixes (#285)
* rtw-ap: Fix compiler warning.

Signed-off-by: Ben Greear <greearb@candelatech.com>

* makefile:  Add entry for compiling against openwrt tree.

Users would need to edit it to match their path, but
this should get them started.

Signed-off-by: Ben Greear <greearb@candelatech.com>

* makefile:  Allow defining KSRC outside of build.

So, you can do this:

KSRC=/tmp/my/kernel make

And not have to edit the makefile to have this function as desired.

Signed-off-by: Ben Greear <greearb@candelatech.com>

* Fix stack-too-large warning on x86-64 compile

Signed-off-by: Ben Greear <greearb@candelatech.com>

* compile:  Allow cross-compiling on cmd-line w/out editing Makefile

For instance:

KSRC=/home/greearb/git/openwrt-neo2-dev/build_dir/target-aarch64_cortex-a53_musl/linux-sunxi_cortexa53/linux-4.14.78 \
 EXT_EXTRA_CFLAGS=-DCONFIG_LITTLE_ENDIAN ARCH=arm64 CROSS_COMPILE=aarch64-openwrt-linux- MODDESTDIR=/tmp make V=1

Signed-off-by: Ben Greear <greearb@candelatech.com>

* build:  Attempt to auto-detect endian-ness.

Will make building in openwrt much easier.

Signed-off-by: Ben Greear <greearb@candelatech.com>

* Fix build against openwrt backports tree.

Like breaks builds elsewhere, can fix it up later.

Signed-off-by: Ben Greear <greearb@candelatech.com>

* Register wiphy after we probe MAC addr.

This way the phy object has a valid MAC-addr, which can be helpful
for identification.

Signed-off-by: Ben Greear <greearb@candelatech.com>

* Make sure MAC is set in wiphy_preinit

This is needed to make sure the phy registers with a proper MAC
address instead of all 00

Signed-off-by: Ben Greear <greearb@candelatech.com>

* Fix build on 4.19 kernel.

Signed-off-by: Ben Greear <greearb@candelatech.com>

* Fix compile against 4.20 kernel.

Remove some variable-length arrays (which could be security bugs,
ways to overflow the stack it seems), and remove use of
get_monotonic_boottime.

Signed-off-by: Ben Greear <greearb@candelatech.com>

* Support arm64
2019-03-08 09:22:32 -08:00

52 lines
1.7 KiB
C

/******************************************************************************
*
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
*
*
******************************************************************************/
#ifndef _RTL871X_BYTEORDER_H_
#define _RTL871X_BYTEORDER_H_
#if defined (CONFIG_LITTLE_ENDIAN) && defined (CONFIG_BIG_ENDIAN)
#error "Shall be CONFIG_LITTLE_ENDIAN or CONFIG_BIG_ENDIAN, but not both!\n"
#endif
#if !((defined CONFIG_LITTLE_ENDIAN) || (defined CONFIG_BIG_ENDIAN))
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
#define CONFIG_LITTLE_ENDIAN
//#warning "Auto-detected little-endian system...hope it is correct!"
#else
#if __BYTE_ORDER == __BIG_ENDIAN
//#warning "Auto-detected big-endian system...hope it is correct!"
#define CONFIG_BIG_ENDIAN
#endif
#endif
#endif
#if defined (CONFIG_LITTLE_ENDIAN)
#ifndef CONFIG_PLATFORM_MSTAR389
# include <byteorder/little_endian.h>
#endif
#elif defined (CONFIG_BIG_ENDIAN)
# include <byteorder/big_endian.h>
#else
# error "Must be LITTLE/BIG Endian Host"
#endif
#endif /* _RTL871X_BYTEORDER_H_ */