old mode 100644new mode 100755| .. | .. |
|---|
| 47 | 47 | #include <linux/proc_fs.h> |
|---|
| 48 | 48 | #include <asm/uaccess.h> |
|---|
| 49 | 49 | #include <asm/unaligned.h> |
|---|
| 50 | | -#include <linux/fs.h> |
|---|
| 51 | | -#include <linux/namei.h> |
|---|
| 52 | 50 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0) |
|---|
| 53 | 51 | #include <uapi/linux/sched/types.h> |
|---|
| 54 | 52 | #elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) |
|---|
| .. | .. |
|---|
| 1929 | 1927 | struct dhd_conf *conf; /* Bus module handle */ |
|---|
| 1930 | 1928 | void *adapter; /* adapter information, interrupt, fw path etc. */ |
|---|
| 1931 | 1929 | void *event_params; |
|---|
| 1932 | | -#ifdef WL_TIMER |
|---|
| 1933 | | - void *timer_params; |
|---|
| 1934 | | -#endif /* WL_TIMER */ |
|---|
| 1935 | 1930 | #ifdef BCMDBUS |
|---|
| 1936 | 1931 | bool dhd_remove; |
|---|
| 1937 | 1932 | #endif /* BCMDBUS */ |
|---|
| .. | .. |
|---|
| 3703 | 3698 | |
|---|
| 3704 | 3699 | #ifdef DBG_PKT_MON |
|---|
| 3705 | 3700 | /* Enable DHD PKT MON spin lock/unlock */ |
|---|
| 3706 | | -#define DHD_PKT_MON_LOCK(lock, flags) (flags) = osl_mutex_lock(lock) |
|---|
| 3707 | | -#define DHD_PKT_MON_UNLOCK(lock, flags) osl_mutex_unlock(lock, (flags)) |
|---|
| 3701 | +#define DHD_PKT_MON_LOCK(lock, flags) (flags) = osl_spin_lock(lock) |
|---|
| 3702 | +#define DHD_PKT_MON_UNLOCK(lock, flags) osl_spin_unlock(lock, (flags)) |
|---|
| 3708 | 3703 | #endif /* DBG_PKT_MON */ |
|---|
| 3709 | 3704 | |
|---|
| 3710 | 3705 | #ifdef DHD_PKT_LOGGING |
|---|
| .. | .. |
|---|
| 4655 | 4650 | #error "DHD_DEBUGABILITY_LOG_DUMP_RING without DEBUGABILITY" |
|---|
| 4656 | 4651 | #endif /* DEBUGABILITY */ |
|---|
| 4657 | 4652 | #endif /* DHD_DEBUGABILITY_LOG_DUMP_RING */ |
|---|
| 4658 | | - |
|---|
| 4659 | | -#if defined(__linux__) |
|---|
| 4660 | | -#ifdef DHD_SUPPORT_VFS_CALL |
|---|
| 4661 | | -static INLINE struct file *dhd_filp_open(const char *filename, int flags, int mode) |
|---|
| 4662 | | -{ |
|---|
| 4663 | | - return filp_open(filename, flags, mode); |
|---|
| 4664 | | -} |
|---|
| 4665 | | - |
|---|
| 4666 | | -static INLINE int dhd_filp_close(void *image, void *id) |
|---|
| 4667 | | -{ |
|---|
| 4668 | | - return filp_close((struct file *)image, id); |
|---|
| 4669 | | -} |
|---|
| 4670 | | - |
|---|
| 4671 | | -static INLINE int dhd_i_size_read(const struct inode *inode) |
|---|
| 4672 | | -{ |
|---|
| 4673 | | - return i_size_read(inode); |
|---|
| 4674 | | -} |
|---|
| 4675 | | - |
|---|
| 4676 | | -static INLINE int dhd_kernel_read_compat(struct file *fp, loff_t pos, void *buf, size_t count) |
|---|
| 4677 | | -{ |
|---|
| 4678 | | - return kernel_read_compat(fp, pos, buf, count); |
|---|
| 4679 | | -} |
|---|
| 4680 | | - |
|---|
| 4681 | | -static INLINE int dhd_vfs_read(struct file *filep, char *buf, size_t size, loff_t *pos) |
|---|
| 4682 | | -{ |
|---|
| 4683 | | - return vfs_read(filep, buf, size, pos); |
|---|
| 4684 | | -} |
|---|
| 4685 | | - |
|---|
| 4686 | | -static INLINE int dhd_vfs_write(struct file *filep, char *buf, size_t size, loff_t *pos) |
|---|
| 4687 | | -{ |
|---|
| 4688 | | - return vfs_write(filep, buf, size, pos); |
|---|
| 4689 | | -} |
|---|
| 4690 | | - |
|---|
| 4691 | | -static INLINE int dhd_vfs_fsync(struct file *filep, int datasync) |
|---|
| 4692 | | -{ |
|---|
| 4693 | | -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35)) |
|---|
| 4694 | | - return vfs_fsync(filep, datasync); |
|---|
| 4695 | | -#else |
|---|
| 4696 | | - return vfs_fsync(filep, filep->f_path.dentry, 0); |
|---|
| 4697 | | -#endif |
|---|
| 4698 | | -} |
|---|
| 4699 | | - |
|---|
| 4700 | | -static INLINE int dhd_vfs_stat(char *buf, struct kstat *stat) |
|---|
| 4701 | | -{ |
|---|
| 4702 | | - return vfs_stat(buf, stat); |
|---|
| 4703 | | -} |
|---|
| 4704 | | - |
|---|
| 4705 | | -static INLINE int dhd_kern_path(char *name, int flags, struct path *file_path) |
|---|
| 4706 | | -{ |
|---|
| 4707 | | - return kern_path(name, flags, file_path); |
|---|
| 4708 | | -} |
|---|
| 4709 | | - |
|---|
| 4710 | | -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)) |
|---|
| 4711 | | -#define DHD_VFS_INODE(dir) (dir->d_inode) |
|---|
| 4712 | | -#else |
|---|
| 4713 | | -#define DHD_VFS_INODE(dir) d_inode(dir) |
|---|
| 4714 | | -#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0) */ |
|---|
| 4715 | | - |
|---|
| 4716 | | -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)) |
|---|
| 4717 | | -#define DHD_VFS_UNLINK(dir, b, c) vfs_unlink(DHD_VFS_INODE(dir), b) |
|---|
| 4718 | | -#else |
|---|
| 4719 | | -#define DHD_VFS_UNLINK(dir, b, c) vfs_unlink(DHD_VFS_INODE(dir), b, c) |
|---|
| 4720 | | -#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0) */ |
|---|
| 4721 | | - |
|---|
| 4722 | | -#else |
|---|
| 4723 | | -#define DHD_VFS_UNLINK(dir, b, c) 0 |
|---|
| 4724 | | - |
|---|
| 4725 | | -static INLINE struct file *dhd_filp_open(const char *filename, int flags, int mode) |
|---|
| 4726 | | - { return NULL; } |
|---|
| 4727 | | -static INLINE int dhd_filp_close(void *image, void *id) |
|---|
| 4728 | | - { return 0; } |
|---|
| 4729 | | -static INLINE int dhd_i_size_read(const struct inode *inode) |
|---|
| 4730 | | - { return 0; } |
|---|
| 4731 | | -static INLINE int dhd_kernel_read_compat(struct file *fp, loff_t pos, void *buf, size_t count) |
|---|
| 4732 | | - { return 0; } |
|---|
| 4733 | | -static INLINE int dhd_vfs_read(struct file *filep, char *buf, size_t size, loff_t *pos) |
|---|
| 4734 | | - { return 0; } |
|---|
| 4735 | | -static INLINE int dhd_vfs_write(struct file *filep, char *buf, size_t size, loff_t *pos) |
|---|
| 4736 | | - { return 0; } |
|---|
| 4737 | | -static INLINE int dhd_vfs_fsync(struct file *filep, int datasync) |
|---|
| 4738 | | - { return 0; } |
|---|
| 4739 | | -static INLINE int dhd_vfs_stat(char *buf, struct kstat *stat) |
|---|
| 4740 | | - { return 0; } |
|---|
| 4741 | | -static INLINE int dhd_kern_path(char *name, int flags, struct path *file_path) |
|---|
| 4742 | | - { return 0; } |
|---|
| 4743 | | -#endif /* DHD_SUPPORT_VFS_CALL */ |
|---|
| 4744 | | -#endif /* __linux__ */ |
|---|
| 4745 | | - |
|---|
| 4746 | 4653 | #ifdef WL_MONITOR |
|---|
| 4747 | 4654 | void dhd_set_monitor(dhd_pub_t *pub, int ifidx, int val); |
|---|
| 4748 | 4655 | #endif /* WL_MONITOR */ |
|---|