RTL8188EU: Fix build on linux 5.8

This commit is contained in:
Jernej Skrabec 2020-08-04 23:02:46 +02:00
parent ca749d2825
commit 515a15c4d7

View File

@ -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];