Merge pull request #961 from Reflexe/v5.17.5

Fix compilation issues with 5.17 (archlinux)
pull/978/head
Christian Bremvåg 2022-06-06 03:21:14 +02:00 committed by GitHub
commit 2fcc00bbb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 13 additions and 39 deletions

View File

@ -15,5 +15,8 @@
#ifndef __DRV_TYPES_LINUX_H__
#define __DRV_TYPES_LINUX_H__
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0))
#define dev_addr_set(netdev, ethdata) _rtw_memcpy(netdev, ethdata, ETH_ALEN)
#endif
#endif

View File

@ -9725,7 +9725,7 @@ static int rtw_mp_efuse_set(struct net_device *dev,
rtw_hal_read_chip_info(padapter);
/* set mac addr*/
rtw_macaddr_cfg(adapter_mac_addr(padapter), get_hal_mac_addr(padapter));
_rtw_memcpy(padapter->pnetdev->dev_addr, get_hal_mac_addr(padapter), ETH_ALEN); /* set mac addr to net_device */
dev_addr_set(padapter->pnetdev, get_hal_mac_addr(padapter)); /* set mac addr to net_device */
#ifdef CONFIG_P2P
rtw_init_wifidirect_addrs(padapter, adapter_mac_addr(padapter), adapter_mac_addr(padapter));

View File

@ -404,7 +404,7 @@ int hostapd_mode_init(_adapter *padapter)
mac[4] = 0x11;
mac[5] = 0x12;
_rtw_memcpy(pnetdev->dev_addr, mac, ETH_ALEN);
dev_addr_set(pnetdev, mac);
rtw_netif_carrier_off(pnetdev);

View File

@ -1288,7 +1288,7 @@ static int rtw_net_set_mac_address(struct net_device *pnetdev, void *addr)
}
_rtw_memcpy(adapter_mac_addr(padapter), sa->sa_data, ETH_ALEN); /* set mac addr to adapter */
_rtw_memcpy(pnetdev->dev_addr, sa->sa_data, ETH_ALEN); /* set mac addr to net_device */
dev_addr_set(pnetdev, sa->sa_data); /* set mac addr to net_device */
#if 0
if (rtw_is_hw_init_completed(padapter)) {
@ -1753,7 +1753,7 @@ int rtw_os_ndev_register(_adapter *adapter, const char *name)
/* alloc netdev name */
rtw_init_netdev_name(ndev, name);
_rtw_memcpy(ndev->dev_addr, adapter_mac_addr(adapter), ETH_ALEN);
dev_addr_set(ndev, adapter_mac_addr(adapter));
#if defined(CONFIG_NET_NS)
dev_net_set(ndev, wiphy_net(adapter_to_wiphy(adapter)));
#endif //defined(CONFIG_NET_NS)
@ -2722,7 +2722,7 @@ int _netdev_vir_if_open(struct net_device *pnetdev)
rtw_mbid_camid_alloc(padapter, adapter_mac_addr(padapter));
#endif
rtw_init_wifidirect_addrs(padapter, adapter_mac_addr(padapter), adapter_mac_addr(padapter));
_rtw_memcpy(pnetdev->dev_addr, adapter_mac_addr(padapter), ETH_ALEN);
dev_addr_set(pnetdev, adapter_mac_addr(padapter));
}
#endif /*CONFIG_PLATFORM_INTEL_BYT*/
@ -3471,7 +3471,7 @@ int _netdev_open(struct net_device *pnetdev)
rtw_mbid_camid_alloc(padapter, adapter_mac_addr(padapter));
#endif
rtw_init_wifidirect_addrs(padapter, adapter_mac_addr(padapter), adapter_mac_addr(padapter));
_rtw_memcpy(pnetdev->dev_addr, adapter_mac_addr(padapter), ETH_ALEN);
dev_addr_set(pnetdev, adapter_mac_addr(padapter));
#endif /* CONFIG_PLATFORM_INTEL_BYT */
rtw_clr_surprise_removed(padapter);

View File

@ -213,11 +213,7 @@ const int drv_proc_hdls_num = sizeof(drv_proc_hdls) / sizeof(struct rtw_proc_hdl
static int rtw_drv_proc_open(struct inode *inode, struct file *file)
{
/* 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);
#else
ssize_t index = (ssize_t)inode->i_private;
#endif
const struct rtw_proc_hdl *hdl = drv_proc_hdls + index;
void *private = NULL;
@ -239,11 +235,7 @@ 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)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
ssize_t index = (ssize_t)PDE_DATA(file_inode(file));
#else
ssize_t index = (ssize_t)file_inode(file)->i_private;
#endif
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;
@ -4163,11 +4155,7 @@ const int adapter_proc_hdls_num = sizeof(adapter_proc_hdls) / sizeof(struct rtw_
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);
#else
ssize_t index = (ssize_t)inode->i_private;
#endif
const struct rtw_proc_hdl *hdl = adapter_proc_hdls + index;
void *private = proc_get_parent_data(inode);
@ -4189,11 +4177,7 @@ 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)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
ssize_t index = (ssize_t)PDE_DATA(file_inode(file));
#else
ssize_t index = (ssize_t)file_inode(file)->i_private;
#endif
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;
@ -4358,11 +4342,7 @@ const int odm_proc_hdls_num = sizeof(odm_proc_hdls) / sizeof(struct rtw_proc_hdl
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);
#else
ssize_t index = (ssize_t)inode->i_private;
#endif
const struct rtw_proc_hdl *hdl = odm_proc_hdls + index;
void *private = proc_get_parent_data(inode);
@ -4384,11 +4364,7 @@ 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)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
ssize_t index = (ssize_t)PDE_DATA(file_inode(file));
#else
ssize_t index = (ssize_t)file_inode(file)->i_private;
#endif
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;
@ -4525,11 +4501,7 @@ 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)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
ssize_t index = (ssize_t)PDE_DATA(inode);
#else
ssize_t index = (ssize_t)inode->i_private;
#endif
const struct rtw_proc_hdl *hdl = mcc_proc_hdls + index;
void *private = proc_get_parent_data(inode);
@ -4551,11 +4523,7 @@ 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)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
ssize_t index = (ssize_t)PDE_DATA(file_inode(file));
#else
ssize_t index = (ssize_t)file_inode(file)->i_private;
#endif
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;

View File

@ -17,6 +17,9 @@
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0)
#define PDE_DATA pde_data
#endif
#define RTW_PROC_HDL_TYPE_SEQ 0
#define RTW_PROC_HDL_TYPE_SSEQ 1

View File

@ -2516,7 +2516,7 @@ int rtw_change_ifname(_adapter *padapter, const char *ifname)
rtw_init_netdev_name(pnetdev, ifname);
_rtw_memcpy(pnetdev->dev_addr, adapter_mac_addr(padapter), ETH_ALEN);
dev_addr_set(pnetdev, adapter_mac_addr(padapter));
if (rtnl_lock_needed)
ret = register_netdev(pnetdev);