6#ifndef OAL_LINUX_KERNEL_FILE_H
7#define OAL_LINUX_KERNEL_FILE_H
9#include <linux/kernel.h>
10#include <linux/init.h>
11#include <linux/module.h>
13#include <linux/string.h>
15#include <linux/syscalls.h>
16#include <asm/unistd.h>
17#include <asm/uaccess.h>
25#define OAL_KERNEL_DS KERNEL_DS
28#define OAL_O_ACCMODE O_ACCMODE
29#define OAL_O_RDONLY O_RDONLY
30#define OAL_O_WRONLY O_WRONLY
31#define OAL_O_RDWR O_RDWR
32#define OAL_O_CREAT O_CREAT
33#define OAL_O_TRUNC O_TRUNC
34#define OAL_O_APPEND O_APPEND
36#define OAL_PRINT_FORMAT_LENGTH 200
43#if defined(LINUX_VERSION_CODE) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
49 return force_uaccess_begin();
56#if defined(LINUX_VERSION_CODE) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
62 force_uaccess_end(fs);
69#if defined(LINUX_VERSION_CODE) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
75 force_uaccess_begin();
81 const struct attribute_group *grp)
83 return sysfs_create_group(kobj, grp);
87 const struct attribute_group *grp)
89 sysfs_remove_group(kobj, grp);
91#ifdef _PRE_CONFIG_CONN_EXT_SYSFS_SUPPORT
92extern oal_kobject *oal_get_sysfs_root_object_etc(
osal_void);
94extern oal_kobject *oal_get_sysfs_root_boot_object_etc(
osal_void);
95extern oal_kobject *oal_conn_sysfs_root_obj_init_etc(
osal_void);
#define OAL_INLINE
Definition driver_soc_common.h:47
INT32 ssize_t
Definition los_typedef.h:77
OAL_STATIC OAL_INLINE int oal_debug_sysfs_create_group(struct kobject *kobj, const struct attribute_group *grp)
Definition oal_kernel_file.h:80
OAL_STATIC OAL_INLINE osal_void oal_set_ds(osal_void)
Definition oal_kernel_file.h:67
OAL_STATIC OAL_INLINE osal_void oal_debug_sysfs_remove_group(struct kobject *kobj, const struct attribute_group *grp)
Definition oal_kernel_file.h:86
oal_file * oal_kernel_file_open_etc(osal_u8 *file_path, osal_s32 attribute)
mm_segment_t oal_mm_segment_t
Definition oal_kernel_file.h:39
OAL_STATIC OAL_INLINE osal_void oal_set_fs(oal_mm_segment_t fs)
Definition oal_kernel_file.h:54
osal_slong oal_kernel_file_write_etc(oal_file *file, osal_u8 *buf, loff_t fsize)
loff_t oal_kernel_file_size_etc(oal_file *file)
ssize_t oal_kernel_file_read_etc(oal_file *file, osal_u8 *buff, loff_t fsize)
osal_slong oal_kernel_file_print_etc(oal_file *file, const osal_s8 *pc_fmt,...)
OAL_STATIC OAL_INLINE oal_mm_segment_t oal_get_fs(osal_void)
Definition oal_kernel_file.h:41
struct file oal_file
Definition oal_kernel_file.h:38
int osal_s32
Definition osal_types.h:19
long osal_slong
Definition osal_types.h:21
unsigned char osal_u8
Definition osal_types.h:11
signed char osal_s8
Definition osal_types.h:17
void osal_void
Definition osal_types.h:29
#define OAL_STATIC
Definition soc_wifi_service_api.c:30