rtl8188eu: Fix builds through kernel 6.1

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2022-11-28 14:44:00 -06:00
parent ca2465c497
commit cb854ca647
7 changed files with 71 additions and 36 deletions

View file

@ -59,7 +59,7 @@ int rtl8188eu_init_recv_priv(struct adapter *padapter)
struct recv_buf *precvbuf;
tasklet_init(&precvpriv->recv_tasklet,
(void(*)(unsigned long))rtl8188eu_recv_tasklet,
(void(*))rtl8188eu_recv_tasklet,
(unsigned long)padapter);
#ifdef CONFIG_USB_INTERRUPT_IN_PIPE

View file

@ -33,7 +33,7 @@ s32 rtl8188eu_init_xmit_priv(struct adapter *padapter)
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
tasklet_init(&pxmitpriv->xmit_tasklet,
(void(*)(unsigned long))rtl8188eu_xmit_tasklet,
(void(*))rtl8188eu_xmit_tasklet,
(unsigned long)padapter);
return _SUCCESS;

View file

@ -957,21 +957,21 @@ enum ieee80211_state {
#define IP_FMT "%d.%d.%d.%d"
#define IP_ARG(x) ((u8*)(x))[0],((u8*)(x))[1],((u8*)(x))[2],((u8*)(x))[3]
extern __inline int is_multicast_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));
}
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)
{
return ((addr[0] == 0x00) && (addr[1] == 0x00) && (addr[2] == 0x00) && \
(addr[3] == 0x00) && (addr[4] == 0x00) && (addr[5] == 0x00));
return (addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) &&
(addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff);
}
#define CFG_IEEE80211_RESERVE_FCS (1<<0)

View file

@ -116,7 +116,11 @@ int pm_netdev_open(struct net_device *pnetdev,u8 bnormal);
spinlock_t lock;
};
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
#define thread_exit() complete_and_exit(NULL, 0)
#else
#define thread_exit() kthread_complete_and_exit(NULL, 0);
#endif
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))

View file

@ -670,8 +670,13 @@ check_bss:
DBG_88E(FUNC_ADPT_FMT" call cfg80211_roamed\n", FUNC_ADPT_ARG(padapter));
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0))
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0))
roam_info.links[0].channel = notify_channel;
roam_info.links[0].bssid = cur_network->network.MacAddress;
#else
roam_info.channel = notify_channel;
roam_info.bssid = cur_network->network.MacAddress;
#endif
roam_info.req_ie =
pmlmepriv->assoc_req+sizeof(struct rtw_ieee80211_hdr_3addr)+2;
roam_info.req_ie_len =
@ -1371,13 +1376,15 @@ exit:
return ret;
}
static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE)
u8 key_index, bool pairwise, const u8 *mac_addr,
#else /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) */
u8 key_index, const u8 *mac_addr,
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) */
struct key_params *params)
static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
, int link_id
#endif
, u8 key_index
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE)
, bool pairwise
#endif
, const u8 *mac_addr, struct key_params *params)
{
char *alg_name;
u32 param_len;
@ -1486,26 +1493,30 @@ addkey_end:
}
static int cfg80211_rtw_get_key(struct wiphy *wiphy, struct net_device *ndev,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE)
u8 key_index, bool pairwise, const u8 *mac_addr,
#else /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) */
u8 key_index, const u8 *mac_addr,
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) */
void *cookie,
void (*callback)(void *cookie,
struct key_params*))
static int cfg80211_rtw_get_key(struct wiphy *wiphy, struct net_device *ndev
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
, int link_id
#endif
, u8 keyid
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE)
, bool pairwise
#endif
, const u8 *mac_addr, void *cookie
, void (*callback)(void *cookie, struct key_params *))
{
DBG_88E(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));
return 0;
}
static int cfg80211_rtw_del_key(struct wiphy *wiphy, struct net_device *ndev,
#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)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
int link_id,
#endif
u8 key_index, bool pairwise, const u8 *mac_addr)
#else /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) */
#else /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) */
u8 key_index, const u8 *mac_addr)
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) */
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) */
{
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(ndev);
struct security_priv *psecuritypriv = &padapter->securitypriv;
@ -1522,11 +1533,15 @@ static int cfg80211_rtw_del_key(struct wiphy *wiphy, struct net_device *ndev,
}
static int cfg80211_rtw_set_default_key(struct wiphy *wiphy,
struct net_device *ndev, u8 key_index
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) || defined(COMPAT_KERNEL_RELEASE)
struct net_device *ndev,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
int link_id,
#endif
u8 key_index
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38)) || defined(COMPAT_KERNEL_RELEASE)
, bool unicast, bool multicast
#endif
)
)
{
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(ndev);
struct security_priv *psecuritypriv = &padapter->securitypriv;
@ -3526,7 +3541,11 @@ static int cfg80211_rtw_change_beacon(struct wiphy *wiphy, struct net_device *nd
return ret;
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 19, 2)
static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
#else
static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev, unsigned int link_id)
#endif
{
DBG_88E(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));
return 0;

View file

@ -626,7 +626,11 @@ void rtw_unregister_netdevs(struct dvobj_priv *dvobj)
if (padapter->DriverState != DRIVER_DISAPPEAR) {
struct wireless_dev *wdev = padapter->rtw_wdev;
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 19, 2)
wdev->current_bss = NULL;
#else
wdev->connected = 0;
#endif
pnetdev->reg_state = NETREG_REGISTERED;
unregister_netdev(pnetdev); /* will call netdev_close() */
rtw_proc_remove_one(pnetdev);
@ -1031,7 +1035,11 @@ static int _rtw_drv_register_netdev(struct adapter *padapter, char *name)
/* alloc netdev name */
rtw_init_netdev_name(pnetdev, name);
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
memcpy(pnetdev->dev_addr, padapter->eeprompriv.mac_addr, ETH_ALEN);
#else
dev_addr_set(pnetdev, padapter->eeprompriv.mac_addr);
#endif
/* Tell the network stack we exist */
if (register_netdev(pnetdev) != 0) {

View file

@ -1148,7 +1148,11 @@ int rtw_change_ifname(struct adapter *padapter, const char *ifname)
rtw_init_netdev_name(pnetdev, ifname);
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
memcpy(pnetdev->dev_addr, padapter->eeprompriv.mac_addr, ETH_ALEN);
#else
dev_addr_set(pnetdev, padapter->eeprompriv.mac_addr);
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26))
if (!rtnl_is_locked())