From 515a15c4d7dc5c66d3ffa4ffd78cd769b321d24d Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Tue, 4 Aug 2020 23:02:46 +0200 Subject: [PATCH] RTL8188EU: Fix build on linux 5.8 --- .../patches/fix-build-with-5.8.patch | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 packages/linux-drivers/RTL8188EU/patches/fix-build-with-5.8.patch diff --git a/packages/linux-drivers/RTL8188EU/patches/fix-build-with-5.8.patch b/packages/linux-drivers/RTL8188EU/patches/fix-build-with-5.8.patch new file mode 100644 index 0000000000..366d08f273 --- /dev/null +++ b/packages/linux-drivers/RTL8188EU/patches/fix-build-with-5.8.patch @@ -0,0 +1,82 @@ +diff --git a/hostapd-0.8/src/crypto/sha256-internal.c b/hostapd-0.8/src/crypto/sha256-internal.c +index b0613739fbc6..c51983c6d633 100644 +--- a/hostapd-0.8/src/crypto/sha256-internal.c ++++ b/hostapd-0.8/src/crypto/sha256-internal.c +@@ -18,16 +18,10 @@ + #include "sha256.h" + #include "crypto.h" + +-struct sha256_state { +- u64 length; +- u32 state[8], curlen; +- u8 buf[64]; +-}; +- +-static void sha256_init(struct sha256_state *md); +-static int sha256_process(struct sha256_state *md, const unsigned char *in, ++static void sha256_init(struct sha256_state_rtw *md); ++static int sha256_process(struct sha256_state_rtw *md, const unsigned char *in, + unsigned long inlen); +-static int sha256_done(struct sha256_state *md, unsigned char *out); ++static int sha256_done(struct sha256_state_rtw *md, unsigned char *out); + + + /** +@@ -41,7 +35,7 @@ static int sha256_done(struct sha256_state *md, unsigned char *out); + int sha256_vector(size_t num_elem, const u8 *addr[], const size_t *len, + u8 *mac) + { +- struct sha256_state ctx; ++ struct sha256_state_rtw ctx; + size_t i; + + sha256_init(&ctx); +@@ -94,7 +88,7 @@ static const unsigned long K[64] = { + #endif + + /* compress 512-bits */ +-static int sha256_compress(struct sha256_state *md, unsigned char *buf) ++static int sha256_compress(struct sha256_state_rtw *md, unsigned char *buf) + { + u32 S[8], W[64], t0, t1; + u32 t; +@@ -137,7 +131,7 @@ static int sha256_compress(struct sha256_state *md, unsigned char *buf) + + + /* Initialize the hash state */ +-static void sha256_init(struct sha256_state *md) ++static void sha256_init(struct sha256_state_rtw *md) + { + md->curlen = 0; + md->length = 0; +@@ -158,7 +152,7 @@ static void sha256_init(struct sha256_state *md) + @param inlen The length of the data (octets) + @return CRYPT_OK if successful + */ +-static int sha256_process(struct sha256_state *md, const unsigned char *in, ++static int sha256_process(struct sha256_state_rtw *md, const unsigned char *in, + unsigned long inlen) + { + unsigned long n; +@@ -199,7 +193,7 @@ static int sha256_process(struct sha256_state *md, const unsigned char *in, + @param out [out] The destination of the hash (32 bytes) + @return CRYPT_OK if successful + */ +-static int sha256_done(struct sha256_state *md, unsigned char *out) ++static int sha256_done(struct sha256_state_rtw *md, unsigned char *out) + { + int i; + +diff --git a/include/rtw_security.h b/include/rtw_security.h +index 21b9c35ce34c..374e6ca86c47 100644 +--- a/include/rtw_security.h ++++ b/include/rtw_security.h +@@ -168,7 +168,7 @@ struct security_priv { + u8 bWepDefaultKeyIdxSet; + }; + +-struct sha256_state { ++struct sha256_state_rtw { + u64 length; + u32 state[8], curlen; + u8 buf[64];