"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "driver/proc.c" between
ndiswrapper-1.62.tar.gz and ndiswrapper-1.63.tar.gz

About: ndiswrapper is a linux kernel module that loads and runs NDIS (Windows network driver API) drivers supplied by wireless network card vendors.

proc.c  (ndiswrapper-1.62):proc.c  (ndiswrapper-1.63)
skipping to change at line 89 skipping to change at line 89
de->data = data; de->data = data;
de->proc_fops = fops; de->proc_fops = fops;
} }
return de; return de;
} }
#endif #endif
static int do_proc_make_entry(const char *name, umode_t mode, static int do_proc_make_entry(const char *name, umode_t mode,
struct proc_dir_entry *parent, struct proc_dir_entry *parent,
struct file_operations *fops, kuid_t uid, #if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
kgid_t gid, struct ndis_device *wnd) const struct proc_ops *fops,
#else
struct file_operations *fops,
#endif
kuid_t uid, kgid_t gid, struct ndis_device *wnd)
{ {
struct proc_dir_entry *de; struct proc_dir_entry *de;
de = proc_create_data(name, mode, parent, fops, wnd); de = proc_create_data(name, mode, parent, fops, wnd);
if (de == NULL) { if (de == NULL) {
ERROR("couldn't create proc entry for '%s'", name); ERROR("couldn't create proc entry for '%s'", name);
return -ENOMEM; return -ENOMEM;
} }
proc_set_user(de, uid, gid); proc_set_user(de, uid, gid);
return 0; return 0;
} }
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
#define PROC_DECLARE_RO(name) \
static int proc_##name##_open(struct inode *inode, struct file *file) \
{ \
return single_open(file, proc_##name##_read, PDE_DATA(inode)); \
} \
static const struct proc_ops name##_fops = { \
.proc_open = proc_##name##_open, \
.proc_read = seq_read, \
.proc_lseek = seq_lseek, \
.proc_release = single_release, \
};
#define PROC_DECLARE_RW(name) \
static int proc_##name##_open(struct inode *inode, struct file *file) \
{ \
return single_open(file, proc_##name##_read, PDE_DATA(inode)); \
} \
static const struct proc_ops name##_fops = { \
.proc_open = proc_##name##_open, \
.proc_read = seq_read, \
.proc_lseek = seq_lseek, \
.proc_release = single_release, \
.proc_write = proc_##name##_write, \
};
#else
#define PROC_DECLARE_RO(name) \ #define PROC_DECLARE_RO(name) \
static int proc_##name##_open(struct inode *inode, struct file *file) \ static int proc_##name##_open(struct inode *inode, struct file *file) \
{ \ { \
return single_open(file, proc_##name##_read, PDE_DATA(inode)); \ return single_open(file, proc_##name##_read, PDE_DATA(inode)); \
} \ } \
static struct file_operations name##_fops = { \ static struct file_operations name##_fops = { \
.owner = THIS_MODULE, \ .owner = THIS_MODULE, \
.open = proc_##name##_open, \ .open = proc_##name##_open, \
.read = seq_read, \ .read = seq_read, \
.llseek = seq_lseek, \ .llseek = seq_lseek, \
skipping to change at line 129 skipping to change at line 159
return single_open(file, proc_##name##_read, PDE_DATA(inode)); \ return single_open(file, proc_##name##_read, PDE_DATA(inode)); \
} \ } \
static struct file_operations name##_fops = { \ static struct file_operations name##_fops = { \
.owner = THIS_MODULE, \ .owner = THIS_MODULE, \
.open = proc_##name##_open, \ .open = proc_##name##_open, \
.read = seq_read, \ .read = seq_read, \
.llseek = seq_lseek, \ .llseek = seq_lseek, \
.release = single_release, \ .release = single_release, \
.write = proc_##name##_write, \ .write = proc_##name##_write, \
}; };
#endif
#define proc_make_entry_ro(name, parent, wnd) \ #define proc_make_entry_ro(name, parent, wnd) \
do_proc_make_entry(#name, S_IFREG | S_IRUSR | S_IRGRP, parent, \ do_proc_make_entry(#name, S_IFREG | S_IRUSR | S_IRGRP, parent, \
&name##_fops, proc_kuid, proc_kgid, wnd) &name##_fops, proc_kuid, proc_kgid, wnd)
#define proc_make_entry_rw(name, parent, wnd) \ #define proc_make_entry_rw(name, parent, wnd) \
do_proc_make_entry(#name, \ do_proc_make_entry(#name, \
S_IFREG | S_IRUSR | S_IRGRP | S_IWUSR | S_IWGRP, \ S_IFREG | S_IRUSR | S_IRGRP | S_IWUSR | S_IWGRP, \
parent, &name##_fops, proc_kuid, proc_kgid, wnd) parent, &name##_fops, proc_kuid, proc_kgid, wnd)
#define add_text(fmt, ...) seq_printf(sf, fmt, ##__VA_ARGS__) #define add_text(fmt, ...) seq_printf(sf, fmt, ##__VA_ARGS__)
 End of changes. 3 change blocks. 
2 lines changed or deleted 33 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)