Skip to content

Instantly share code, notes, and snippets.

@IvarWithoutBones
Created March 23, 2022 20:58
Show Gist options
  • Save IvarWithoutBones/9fd1614b24e2f067bd542a8f118b80e6 to your computer and use it in GitHub Desktop.
Save IvarWithoutBones/9fd1614b24e2f067bd542a8f118b80e6 to your computer and use it in GitHub Desktop.
diff --git a/os_dep/linux/rtw_proc.c b/os_dep/linux/rtw_proc.c
index eb942a1..fa3a592 100644
--- a/os_dep/linux/rtw_proc.c
+++ b/os_dep/linux/rtw_proc.c
@@ -212,7 +212,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); */
- 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;
void *private = NULL;
@@ -234,7 +234,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)
{
- 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;
ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *, void *) = hdl->write;
@@ -3891,7 +3891,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)
{
- 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;
void *private = proc_get_parent_data(inode);
@@ -3913,7 +3913,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)
{
- 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;
ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *, void *) = hdl->write;
@@ -4078,7 +4078,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)
{
- 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;
void *private = proc_get_parent_data(inode);
@@ -4100,7 +4100,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)
{
- 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;
ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *, void *) = hdl->write;
@@ -4237,7 +4237,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)
{
- 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;
void *private = proc_get_parent_data(inode);
@@ -4259,7 +4259,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)
{
- 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;
ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *, void *) = hdl->write;
diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c
index 7705d87..1ff0fac 100644
--- a/os_dep/osdep_service.c
+++ b/os_dep/osdep_service.c
@@ -1299,7 +1299,7 @@ u32 _rtw_down_sema(_sema *sema)
inline void thread_exit(_completion *comp)
{
#ifdef PLATFORM_LINUX
- complete_and_exit(comp, 0);
+ kthread_complete_and_exit(comp, 0);
#endif
#ifdef PLATFORM_FREEBSD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment