mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2024-11-25 22:13:41 +00:00
rtl8188eu: Fix build with kernel 5.17
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
78df4f193d
commit
1944ad78ce
7 changed files with 42 additions and 6 deletions
|
@ -13,7 +13,7 @@ int usb_init_recv_priv(_adapter *padapter, u16 ini_in_buf_sz)
|
||||||
struct recv_buf *precvbuf;
|
struct recv_buf *precvbuf;
|
||||||
|
|
||||||
tasklet_init(&precvpriv->recv_tasklet,
|
tasklet_init(&precvpriv->recv_tasklet,
|
||||||
(void(*)(unsigned long))usb_recv_tasklet,
|
(void(*))usb_recv_tasklet,
|
||||||
(unsigned long)padapter);
|
(unsigned long)padapter);
|
||||||
|
|
||||||
#ifdef CONFIG_USB_INTERRUPT_IN_PIPE
|
#ifdef CONFIG_USB_INTERRUPT_IN_PIPE
|
||||||
|
|
|
@ -9418,7 +9418,7 @@ static int rtw_mp_efuse_set(struct net_device *dev,
|
||||||
rtw_hal_read_chip_info(padapter);
|
rtw_hal_read_chip_info(padapter);
|
||||||
/* set mac addr*/
|
/* set mac addr*/
|
||||||
rtw_macaddr_cfg(adapter_mac_addr(padapter), get_hal_mac_addr(padapter));
|
rtw_macaddr_cfg(adapter_mac_addr(padapter), get_hal_mac_addr(padapter));
|
||||||
memcpy(padapter->pnetdev->dev_addr, get_hal_mac_addr(padapter), ETH_ALEN); /* set mac addr to net_device */
|
memcpy((void *)padapter->pnetdev->dev_addr, get_hal_mac_addr(padapter), ETH_ALEN); /* set mac addr to net_device */
|
||||||
|
|
||||||
#ifdef CONFIG_P2P
|
#ifdef CONFIG_P2P
|
||||||
rtw_init_wifidirect_addrs(padapter, adapter_mac_addr(padapter), adapter_mac_addr(padapter));
|
rtw_init_wifidirect_addrs(padapter, adapter_mac_addr(padapter), adapter_mac_addr(padapter));
|
||||||
|
|
|
@ -946,7 +946,7 @@ static int rtw_net_set_mac_address(struct net_device *pnetdev, void *addr)
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(adapter_mac_addr(padapter), sa->sa_data, ETH_ALEN); /* set mac addr to adapter */
|
memcpy(adapter_mac_addr(padapter), sa->sa_data, ETH_ALEN); /* set mac addr to adapter */
|
||||||
memcpy(pnetdev->dev_addr, sa->sa_data, ETH_ALEN); /* set mac addr to net_device */
|
memcpy((void *)pnetdev->dev_addr, sa->sa_data, ETH_ALEN); /* set mac addr to net_device */
|
||||||
|
|
||||||
rtw_ps_deny(padapter, PS_DENY_IOCTL);
|
rtw_ps_deny(padapter, PS_DENY_IOCTL);
|
||||||
LeaveAllPowerSaveModeDirect(padapter); /* leave PS mode for guaranteeing to access hw register successfully */
|
LeaveAllPowerSaveModeDirect(padapter); /* leave PS mode for guaranteeing to access hw register successfully */
|
||||||
|
@ -1329,7 +1329,7 @@ static int rtw_os_ndev_register(_adapter *adapter, const char *name)
|
||||||
/* alloc netdev name */
|
/* alloc netdev name */
|
||||||
rtw_init_netdev_name(ndev, name);
|
rtw_init_netdev_name(ndev, name);
|
||||||
|
|
||||||
memcpy(ndev->dev_addr, adapter_mac_addr(adapter), ETH_ALEN);
|
memcpy((void *)ndev->dev_addr, adapter_mac_addr(adapter), ETH_ALEN);
|
||||||
|
|
||||||
/* Tell the network stack we exist */
|
/* Tell the network stack we exist */
|
||||||
|
|
||||||
|
|
|
@ -1367,7 +1367,7 @@ int rtw_change_ifname(_adapter *padapter, const char *ifname)
|
||||||
|
|
||||||
rtw_init_netdev_name(pnetdev, ifname);
|
rtw_init_netdev_name(pnetdev, ifname);
|
||||||
|
|
||||||
memcpy(pnetdev->dev_addr, adapter_mac_addr(padapter), ETH_ALEN);
|
memcpy((void *)pnetdev->dev_addr, adapter_mac_addr(padapter), ETH_ALEN);
|
||||||
|
|
||||||
if (rtnl_lock_needed)
|
if (rtnl_lock_needed)
|
||||||
ret = register_netdev(pnetdev);
|
ret = register_netdev(pnetdev);
|
||||||
|
|
|
@ -153,7 +153,11 @@ typedef void *_thread_hdl_;
|
||||||
typedef int thread_return;
|
typedef int thread_return;
|
||||||
typedef void *thread_context;
|
typedef void *thread_context;
|
||||||
|
|
||||||
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
|
||||||
#define thread_exit() complete_and_exit(NULL, 0)
|
#define thread_exit() complete_and_exit(NULL, 0)
|
||||||
|
#else
|
||||||
|
#define thread_exit() kthread_complete_and_exit(NULL, 0)
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef void timer_hdl_return;
|
typedef void timer_hdl_return;
|
||||||
typedef void *timer_hdl_context;
|
typedef void *timer_hdl_context;
|
||||||
|
|
|
@ -13,7 +13,7 @@ s32 rtl8188eu_init_xmit_priv(_adapter *padapter)
|
||||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||||
|
|
||||||
tasklet_init(&pxmitpriv->xmit_tasklet,
|
tasklet_init(&pxmitpriv->xmit_tasklet,
|
||||||
(void(*)(unsigned long))rtl8188eu_xmit_tasklet,
|
(void(*))rtl8188eu_xmit_tasklet,
|
||||||
(unsigned long)padapter);
|
(unsigned long)padapter);
|
||||||
#ifdef CONFIG_TX_EARLY_MODE
|
#ifdef CONFIG_TX_EARLY_MODE
|
||||||
pHalData->bEarlyModeEnable = padapter->registrypriv.early_mode;
|
pHalData->bEarlyModeEnable = padapter->registrypriv.early_mode;
|
||||||
|
|
32
rtw_proc.c
32
rtw_proc.c
|
@ -178,7 +178,11 @@ static const int drv_proc_hdls_num = sizeof(drv_proc_hdls) / sizeof(struct rtw_p
|
||||||
static int rtw_drv_proc_open(struct inode *inode, struct file *file)
|
static int rtw_drv_proc_open(struct inode *inode, struct file *file)
|
||||||
{
|
{
|
||||||
/* struct net_device *dev = proc_get_parent_data(inode); */
|
/* struct net_device *dev = proc_get_parent_data(inode); */
|
||||||
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
|
||||||
ssize_t index = (ssize_t)PDE_DATA(inode);
|
ssize_t index = (ssize_t)PDE_DATA(inode);
|
||||||
|
#else
|
||||||
|
ssize_t index = (ssize_t)pde_data(inode);
|
||||||
|
#endif
|
||||||
const struct rtw_proc_hdl *hdl = drv_proc_hdls + index;
|
const struct rtw_proc_hdl *hdl = drv_proc_hdls + index;
|
||||||
void *private = NULL;
|
void *private = NULL;
|
||||||
|
|
||||||
|
@ -200,7 +204,11 @@ static int rtw_drv_proc_open(struct inode *inode, struct file *file)
|
||||||
|
|
||||||
static ssize_t rtw_drv_proc_write(struct file *file, const char __user *buffer, size_t count, loff_t *pos)
|
static ssize_t rtw_drv_proc_write(struct file *file, const char __user *buffer, size_t count, loff_t *pos)
|
||||||
{
|
{
|
||||||
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
|
||||||
ssize_t index = (ssize_t)PDE_DATA(file_inode(file));
|
ssize_t index = (ssize_t)PDE_DATA(file_inode(file));
|
||||||
|
#else
|
||||||
|
ssize_t index = (ssize_t)pde_data(file_inode(file));
|
||||||
|
#endif
|
||||||
const struct rtw_proc_hdl *hdl = drv_proc_hdls + index;
|
const struct rtw_proc_hdl *hdl = drv_proc_hdls + index;
|
||||||
ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *, void *) = hdl->write;
|
ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *, void *) = hdl->write;
|
||||||
|
|
||||||
|
@ -2511,7 +2519,11 @@ static const int adapter_proc_hdls_num = sizeof(adapter_proc_hdls) / sizeof(stru
|
||||||
|
|
||||||
static int rtw_adapter_proc_open(struct inode *inode, struct file *file)
|
static int rtw_adapter_proc_open(struct inode *inode, struct file *file)
|
||||||
{
|
{
|
||||||
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
|
||||||
ssize_t index = (ssize_t)PDE_DATA(inode);
|
ssize_t index = (ssize_t)PDE_DATA(inode);
|
||||||
|
#else
|
||||||
|
ssize_t index = (ssize_t)pde_data(inode);
|
||||||
|
#endif
|
||||||
const struct rtw_proc_hdl *hdl = adapter_proc_hdls + index;
|
const struct rtw_proc_hdl *hdl = adapter_proc_hdls + index;
|
||||||
void *private = proc_get_parent_data(inode);
|
void *private = proc_get_parent_data(inode);
|
||||||
|
|
||||||
|
@ -2533,7 +2545,11 @@ static int rtw_adapter_proc_open(struct inode *inode, struct file *file)
|
||||||
|
|
||||||
static ssize_t rtw_adapter_proc_write(struct file *file, const char __user *buffer, size_t count, loff_t *pos)
|
static ssize_t rtw_adapter_proc_write(struct file *file, const char __user *buffer, size_t count, loff_t *pos)
|
||||||
{
|
{
|
||||||
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
|
||||||
ssize_t index = (ssize_t)PDE_DATA(file_inode(file));
|
ssize_t index = (ssize_t)PDE_DATA(file_inode(file));
|
||||||
|
#else
|
||||||
|
ssize_t index = (ssize_t)pde_data(file_inode(file));
|
||||||
|
#endif
|
||||||
const struct rtw_proc_hdl *hdl = adapter_proc_hdls + index;
|
const struct rtw_proc_hdl *hdl = adapter_proc_hdls + index;
|
||||||
ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *, void *) = hdl->write;
|
ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *, void *) = hdl->write;
|
||||||
|
|
||||||
|
@ -2829,7 +2845,11 @@ static const int odm_proc_hdls_num = sizeof(odm_proc_hdls) / sizeof(struct rtw_p
|
||||||
|
|
||||||
static int rtw_odm_proc_open(struct inode *inode, struct file *file)
|
static int rtw_odm_proc_open(struct inode *inode, struct file *file)
|
||||||
{
|
{
|
||||||
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
|
||||||
ssize_t index = (ssize_t)PDE_DATA(inode);
|
ssize_t index = (ssize_t)PDE_DATA(inode);
|
||||||
|
#else
|
||||||
|
ssize_t index = (ssize_t)pde_data(inode);
|
||||||
|
#endif
|
||||||
const struct rtw_proc_hdl *hdl = odm_proc_hdls + index;
|
const struct rtw_proc_hdl *hdl = odm_proc_hdls + index;
|
||||||
void *private = proc_get_parent_data(inode);
|
void *private = proc_get_parent_data(inode);
|
||||||
|
|
||||||
|
@ -2851,7 +2871,11 @@ static int rtw_odm_proc_open(struct inode *inode, struct file *file)
|
||||||
|
|
||||||
static ssize_t rtw_odm_proc_write(struct file *file, const char __user *buffer, size_t count, loff_t *pos)
|
static ssize_t rtw_odm_proc_write(struct file *file, const char __user *buffer, size_t count, loff_t *pos)
|
||||||
{
|
{
|
||||||
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
|
||||||
ssize_t index = (ssize_t)PDE_DATA(file_inode(file));
|
ssize_t index = (ssize_t)PDE_DATA(file_inode(file));
|
||||||
|
#else
|
||||||
|
ssize_t index = (ssize_t)pde_data(file_inode(file));
|
||||||
|
#endif
|
||||||
const struct rtw_proc_hdl *hdl = odm_proc_hdls + index;
|
const struct rtw_proc_hdl *hdl = odm_proc_hdls + index;
|
||||||
ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *, void *) = hdl->write;
|
ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *, void *) = hdl->write;
|
||||||
|
|
||||||
|
@ -2989,7 +3013,11 @@ const int mcc_proc_hdls_num = sizeof(mcc_proc_hdls) / sizeof(struct rtw_proc_hdl
|
||||||
|
|
||||||
static int rtw_mcc_proc_open(struct inode *inode, struct file *file)
|
static int rtw_mcc_proc_open(struct inode *inode, struct file *file)
|
||||||
{
|
{
|
||||||
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
|
||||||
ssize_t index = (ssize_t)PDE_DATA(inode);
|
ssize_t index = (ssize_t)PDE_DATA(inode);
|
||||||
|
#else
|
||||||
|
ssize_t index = (ssize_t)pde_data(inode);
|
||||||
|
#endif
|
||||||
const struct rtw_proc_hdl *hdl = mcc_proc_hdls + index;
|
const struct rtw_proc_hdl *hdl = mcc_proc_hdls + index;
|
||||||
void *private = proc_get_parent_data(inode);
|
void *private = proc_get_parent_data(inode);
|
||||||
|
|
||||||
|
@ -3011,7 +3039,11 @@ static int rtw_mcc_proc_open(struct inode *inode, struct file *file)
|
||||||
|
|
||||||
static ssize_t rtw_mcc_proc_write(struct file *file, const char __user *buffer, size_t count, loff_t *pos)
|
static ssize_t rtw_mcc_proc_write(struct file *file, const char __user *buffer, size_t count, loff_t *pos)
|
||||||
{
|
{
|
||||||
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
|
||||||
ssize_t index = (ssize_t)PDE_DATA(file_inode(file));
|
ssize_t index = (ssize_t)PDE_DATA(file_inode(file));
|
||||||
|
#else
|
||||||
|
ssize_t index = (ssize_t)pde_data(file_inode(file));
|
||||||
|
#endif
|
||||||
const struct rtw_proc_hdl *hdl = mcc_proc_hdls + index;
|
const struct rtw_proc_hdl *hdl = mcc_proc_hdls + index;
|
||||||
ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *, void *) = hdl->write;
|
ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *, void *) = hdl->write;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue