mirror of
https://github.com/RinCat/RTL88x2BU-Linux-Driver.git
synced 2024-12-25 09:31:36 +00:00
Linux 5.17
This commit is contained in:
parent
fde349936e
commit
ac5758c404
@ -1,6 +1,6 @@
|
|||||||
# REALTEK RTL88x2B USB Linux Driver
|
# REALTEK RTL88x2B USB Linux Driver
|
||||||
**Current Driver Version**: 5.13.1
|
**Current Driver Version**: 5.13.1
|
||||||
**Support Kernel**: 2.6.24 ~ 5.16 (with unofficial patches)
|
**Support Kernel**: 2.6.24 ~ 5.17 (with unofficial patches)
|
||||||
|
|
||||||
Official release note please check ReleaseNotes.pdf
|
Official release note please check ReleaseNotes.pdf
|
||||||
|
|
||||||
|
@ -35,8 +35,10 @@ inline struct proc_dir_entry *get_rtw_drv_proc(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0))
|
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0))
|
||||||
#define PDE_DATA(inode) PDE((inode))->data
|
#define pde_data(inode) PDE((inode))->data
|
||||||
#define proc_get_parent_data(inode) PDE((inode))->parent->data
|
#define proc_get_parent_data(inode) PDE((inode))->parent->data
|
||||||
|
#elif (LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0))
|
||||||
|
#define pde_data(inode) PDE_DATA(inode)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24))
|
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24))
|
||||||
@ -247,7 +249,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)
|
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); */
|
||||||
ssize_t index = (ssize_t)PDE_DATA(inode);
|
ssize_t index = (ssize_t)pde_data(inode);
|
||||||
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;
|
||||||
|
|
||||||
@ -273,7 +275,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)
|
static ssize_t rtw_drv_proc_write(struct file *file, const char __user *buffer, size_t count, loff_t *pos)
|
||||||
{
|
{
|
||||||
ssize_t index = (ssize_t)PDE_DATA(file_inode(file));
|
ssize_t index = (ssize_t)pde_data(file_inode(file));
|
||||||
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;
|
||||||
|
|
||||||
@ -5688,7 +5690,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)
|
static int rtw_adapter_proc_open(struct inode *inode, struct file *file)
|
||||||
{
|
{
|
||||||
ssize_t index = (ssize_t)PDE_DATA(inode);
|
ssize_t index = (ssize_t)pde_data(inode);
|
||||||
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);
|
||||||
|
|
||||||
@ -5714,7 +5716,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)
|
static ssize_t rtw_adapter_proc_write(struct file *file, const char __user *buffer, size_t count, loff_t *pos)
|
||||||
{
|
{
|
||||||
ssize_t index = (ssize_t)PDE_DATA(file_inode(file));
|
ssize_t index = (ssize_t)pde_data(file_inode(file));
|
||||||
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;
|
||||||
|
|
||||||
@ -5877,7 +5879,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)
|
static int rtw_odm_proc_open(struct inode *inode, struct file *file)
|
||||||
{
|
{
|
||||||
ssize_t index = (ssize_t)PDE_DATA(inode);
|
ssize_t index = (ssize_t)pde_data(inode);
|
||||||
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);
|
||||||
|
|
||||||
@ -5903,7 +5905,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)
|
static ssize_t rtw_odm_proc_write(struct file *file, const char __user *buffer, size_t count, loff_t *pos)
|
||||||
{
|
{
|
||||||
ssize_t index = (ssize_t)PDE_DATA(file_inode(file));
|
ssize_t index = (ssize_t)pde_data(file_inode(file));
|
||||||
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;
|
||||||
|
|
||||||
@ -6042,7 +6044,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)
|
static int rtw_mcc_proc_open(struct inode *inode, struct file *file)
|
||||||
{
|
{
|
||||||
ssize_t index = (ssize_t)PDE_DATA(inode);
|
ssize_t index = (ssize_t)pde_data(inode);
|
||||||
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);
|
||||||
|
|
||||||
@ -6068,7 +6070,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)
|
static ssize_t rtw_mcc_proc_write(struct file *file, const char __user *buffer, size_t count, loff_t *pos)
|
||||||
{
|
{
|
||||||
ssize_t index = (ssize_t)PDE_DATA(file_inode(file));
|
ssize_t index = (ssize_t)pde_data(file_inode(file));
|
||||||
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;
|
||||||
|
|
||||||
|
@ -17,6 +17,11 @@
|
|||||||
#define _OSDEP_SERVICE_C_
|
#define _OSDEP_SERVICE_C_
|
||||||
|
|
||||||
#include <drv_types.h>
|
#include <drv_types.h>
|
||||||
|
#include <linux/kthread.h>
|
||||||
|
|
||||||
|
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0))
|
||||||
|
#define kthread_complete_and_exit(comp, code) complete_and_exit(comp, code)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define RT_TAG '1178'
|
#define RT_TAG '1178'
|
||||||
|
|
||||||
@ -1309,7 +1314,7 @@ u32 _rtw_down_sema(_sema *sema)
|
|||||||
inline void thread_exit(_completion *comp)
|
inline void thread_exit(_completion *comp)
|
||||||
{
|
{
|
||||||
#ifdef PLATFORM_LINUX
|
#ifdef PLATFORM_LINUX
|
||||||
complete_and_exit(comp, 0);
|
kthread_complete_and_exit(comp, 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PLATFORM_FREEBSD
|
#ifdef PLATFORM_FREEBSD
|
||||||
|
Loading…
Reference in New Issue
Block a user