rtl8188eu: Fix build errors with later kernels

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2020-10-26 11:35:16 -05:00
parent 8a85ada630
commit 8118ea20d7
3 changed files with 27 additions and 32 deletions

View file

@ -2000,7 +2000,7 @@ BIP_exit:
#endif /* CONFIG_IEEE80211W */ #endif /* CONFIG_IEEE80211W */
/* compress 512-bits */ /* compress 512-bits */
static int sha256_compress(struct sha256_state *md, unsigned char *buf) static int sha256_compress(struct rtl_sha256_state *md, unsigned char *buf)
{ {
u32 S[8], W[64], t0, t1; u32 S[8], W[64], t0, t1;
u32 t; u32 t;
@ -2042,7 +2042,7 @@ static int sha256_compress(struct sha256_state *md, unsigned char *buf)
} }
/* Initialize the hash state */ /* Initialize the hash state */
static void sha256_init(struct sha256_state *md) static void rtl_sha256_init(struct rtl_sha256_state *md)
{ {
md->curlen = 0; md->curlen = 0;
md->length = 0; md->length = 0;
@ -2063,7 +2063,7 @@ static void sha256_init(struct sha256_state *md)
@param inlen The length of the data (octets) @param inlen The length of the data (octets)
@return CRYPT_OK if successful @return CRYPT_OK if successful
*/ */
static int sha256_process(struct sha256_state *md, unsigned char *in, static int sha256_process(struct rtl_sha256_state *md, unsigned char *in,
unsigned long inlen) unsigned long inlen)
{ {
unsigned long n; unsigned long n;
@ -2103,7 +2103,7 @@ static int sha256_process(struct sha256_state *md, unsigned char *in,
@param out [out] The destination of the hash (32 bytes) @param out [out] The destination of the hash (32 bytes)
@return CRYPT_OK if successful @return CRYPT_OK if successful
*/ */
static int sha256_done(struct sha256_state *md, unsigned char *out) static int sha256_done(struct rtl_sha256_state *md, unsigned char *out)
{ {
int i; int i;
@ -2155,10 +2155,10 @@ static int sha256_done(struct sha256_state *md, unsigned char *out)
static int sha256_vector(size_t num_elem, u8 *addr[], size_t *len, static int sha256_vector(size_t num_elem, u8 *addr[], size_t *len,
u8 *mac) u8 *mac)
{ {
struct sha256_state ctx; struct rtl_sha256_state ctx;
size_t i; size_t i;
sha256_init(&ctx); rtl_sha256_init(&ctx);
for (i = 0; i < num_elem; i++) for (i = 0; i < num_elem; i++)
if (sha256_process(&ctx, addr[i], len[i])) if (sha256_process(&ctx, addr[i], len[i]))
return -1; return -1;

View file

@ -193,7 +193,7 @@ struct security_priv
u8 bWepDefaultKeyIdxSet; u8 bWepDefaultKeyIdxSet;
}; };
struct sha256_state { struct rtl_sha256_state {
u64 length; u64 length;
u32 state[8], curlen; u32 state[8], curlen;
u8 buf[64]; u8 buf[64];

View file

@ -335,19 +335,15 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(struct adapter *padapter, struct wl
u8 *notify_ie; u8 *notify_ie;
size_t notify_ielen; size_t notify_ielen;
s32 notify_signal; s32 notify_signal;
u8 buf[MAX_BSSINFO_LEN], *pbuf; u8 *buf, *pbuf;
size_t len,bssinf_len=0; size_t len,bssinf_len=0;
struct rtw_ieee80211_hdr *pwlanhdr; struct rtw_ieee80211_hdr *pwlanhdr;
__le16 *fctrl; __le16 *fctrl;
u8 bc_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; u8 bc_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
struct wireless_dev *wdev = padapter->rtw_wdev; struct wireless_dev *wdev = padapter->rtw_wdev;
struct wiphy *wiphy = wdev->wiphy; struct wiphy *wiphy = wdev->wiphy;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
/* DBG_8192C("%s\n", __func__); */
bssinf_len = pnetwork->network.IELength+sizeof (struct rtw_ieee80211_hdr_3addr); bssinf_len = pnetwork->network.IELength+sizeof (struct rtw_ieee80211_hdr_3addr);
if (bssinf_len > MAX_BSSINFO_LEN) { if (bssinf_len > MAX_BSSINFO_LEN) {
DBG_88E("%s IE Length too long > %d byte\n",__FUNCTION__,MAX_BSSINFO_LEN); DBG_88E("%s IE Length too long > %d byte\n",__FUNCTION__,MAX_BSSINFO_LEN);
@ -416,6 +412,9 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(struct adapter *padapter, struct wl
} else { } else {
notify_signal = 100*translate_percentage_to_dbm(pnetwork->network.PhyInfo.SignalStrength);/* dbm */ notify_signal = 100*translate_percentage_to_dbm(pnetwork->network.PhyInfo.SignalStrength);/* dbm */
} }
buf = kzalloc(MAX_BSSINFO_LEN, GFP_KERNEL);
if (!buf)
goto exit;
pbuf = buf; pbuf = buf;
pwlanhdr = (struct rtw_ieee80211_hdr *)pbuf; pwlanhdr = (struct rtw_ieee80211_hdr *)pbuf;
@ -455,7 +454,7 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(struct adapter *padapter, struct wl
len, notify_signal, GFP_ATOMIC); len, notify_signal, GFP_ATOMIC);
if (unlikely(!bss)) { if (unlikely(!bss)) {
DBG_8192C(FUNC_ADPT_FMT" bss NULL\n", FUNC_ADPT_ARG(padapter)); DBG_8192C(FUNC_ADPT_FMT" bss NULL\n", FUNC_ADPT_ARG(padapter));
goto exit; goto free_buf;
} }
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)) #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38))
@ -472,30 +471,13 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(struct adapter *padapter, struct wl
#endif /* COMPAT_KERNEL_RELEASE */ #endif /* COMPAT_KERNEL_RELEASE */
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) */ #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) */
/*
{
if ( bss->information_elements == bss->proberesp_ies)
{
if ( bss->len_information_elements != bss->len_proberesp_ies)
{
DBG_8192C("error!, len_information_elements != bss->len_proberesp_ies\n");
}
}
else if (bss->len_information_elements < bss->len_beacon_ies)
{
bss->information_elements = bss->beacon_ies;
bss->len_information_elements = bss->len_beacon_ies;
}
}
*/
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0)
cfg80211_put_bss(wiphy, bss); cfg80211_put_bss(wiphy, bss);
#else #else
cfg80211_put_bss(bss); cfg80211_put_bss(bss);
#endif #endif
free_buf:
kfree(buf);
exit: exit:
return bss; return bss;
@ -4427,9 +4409,17 @@ static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy,
#else #else
struct net_device *ndev, struct net_device *ndev,
#endif #endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
struct mgmt_frame_regs *upd)
#else
u16 frame_type, bool reg) u16 frame_type, bool reg)
#endif
{ {
struct adapter *adapter = wiphy_to_adapter(wiphy); struct adapter *adapter = wiphy_to_adapter(wiphy);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
u16 frame_type = BIT(upd->global_stypes << 4);
bool reg = false;
#endif
#ifdef CONFIG_DEBUG_CFG80211 #ifdef CONFIG_DEBUG_CFG80211
DBG_88E(FUNC_ADPT_FMT" frame_type:%x, reg:%d\n", FUNC_ADPT_ARG(adapter), DBG_88E(FUNC_ADPT_FMT" frame_type:%x, reg:%d\n", FUNC_ADPT_ARG(adapter),
@ -4859,7 +4849,12 @@ static struct cfg80211_ops rtw_cfg80211_ops = {
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE)
.mgmt_tx = cfg80211_rtw_mgmt_tx, .mgmt_tx = cfg80211_rtw_mgmt_tx,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
.update_mgmt_frame_registrations = cfg80211_rtw_mgmt_frame_register,
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE)
.mgmt_frame_register = cfg80211_rtw_mgmt_frame_register, .mgmt_frame_register = cfg80211_rtw_mgmt_frame_register,
#endif
#elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,34) && LINUX_VERSION_CODE<=KERNEL_VERSION(2,6,35)) #elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,34) && LINUX_VERSION_CODE<=KERNEL_VERSION(2,6,35))
.action = cfg80211_rtw_mgmt_tx, .action = cfg80211_rtw_mgmt_tx,
#endif #endif