--- zzzz-none-000/linux-4.1.52/include/linux/debugfs.h 2018-05-28 02:26:45.000000000 +0000 +++ bcm63-7530ax-731/linux-4.1.52/include/linux/debugfs.h 2022-03-02 11:37:13.000000000 +0000 @@ -37,6 +37,11 @@ const struct debugfs_reg32 *regs; int nregs; void __iomem *base; +#if defined(CONFIG_AVM_ENHANCED) + uint32_t (*reg_read_fn)(void *, uint32_t); + uint32_t (*reg_write_fn)(void *, uint32_t, uint32_t); + void *rw_context; +#endif }; extern struct dentry *arch_debugfs_dir; @@ -117,6 +122,21 @@ bool debugfs_initialized(void); +#if defined(CONFIG_AVM_ENHANCED) + +#define SD_MAX_INPUT_BUF 8192 + +int add_simple_debugfs_file( const char* fname, struct dentry *parent, + int (*kernel_input)(char *, void *), + void (*kernel_output)(struct seq_file *, void *), + void *priv_data); + +void remove_simple_debugfs_file( struct dentry *this ); + +struct dentry *debugfs_create_atomic_t(const char *name, umode_t mode, + struct dentry *parent, atomic_t *value); + +#endif /* CONFIG_AVM_ENHANCED */ #else #include @@ -127,132 +147,157 @@ * want to duplicate the design decision mistakes of procfs and devfs again. */ -static inline struct dentry *debugfs_create_file(const char *name, umode_t mode, - struct dentry *parent, void *data, - const struct file_operations *fops) +static inline struct dentry *debugfs_create_file( + const char *name __maybe_unused, + umode_t mode __maybe_unused, + struct dentry *parent __maybe_unused, + void *data __maybe_unused, + const struct file_operations *fops __maybe_unused) { return ERR_PTR(-ENODEV); } -static inline struct dentry *debugfs_create_file_size(const char *name, umode_t mode, - struct dentry *parent, void *data, - const struct file_operations *fops, - loff_t file_size) +static inline struct dentry *debugfs_create_file_size(const char *name __maybe_unused, umode_t mode __maybe_unused, + struct dentry *parent __maybe_unused, void *data __maybe_unused, + const struct file_operations *fops __maybe_unused, + loff_t file_size __maybe_unused) { return ERR_PTR(-ENODEV); } -static inline struct dentry *debugfs_create_dir(const char *name, - struct dentry *parent) +static inline struct dentry *debugfs_create_dir(const char *name __maybe_unused, + struct dentry *parent __maybe_unused) { return ERR_PTR(-ENODEV); } -static inline struct dentry *debugfs_create_symlink(const char *name, - struct dentry *parent, - const char *dest) +static inline struct dentry *debugfs_create_symlink( + const char *name __maybe_unused, + struct dentry *parent __maybe_unused, + const char *dest __maybe_unused) { return ERR_PTR(-ENODEV); } -static inline void debugfs_remove(struct dentry *dentry) +static inline void debugfs_remove(struct dentry *dentry __maybe_unused) { } -static inline void debugfs_remove_recursive(struct dentry *dentry) +static inline void debugfs_remove_recursive(struct dentry *dentry __maybe_unused) { } -static inline struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry, - struct dentry *new_dir, char *new_name) +static inline struct dentry *debugfs_rename( + struct dentry *old_dir __maybe_unused, + struct dentry *old_dentry __maybe_unused, + struct dentry *new_dir __maybe_unused, + char *new_name __maybe_unused) { return ERR_PTR(-ENODEV); } -static inline struct dentry *debugfs_create_u8(const char *name, umode_t mode, - struct dentry *parent, - u8 *value) +static inline struct dentry *debugfs_create_u8( + const char *name __maybe_unused, + umode_t mode __maybe_unused, + struct dentry *parent __maybe_unused, + u8 *value __maybe_unused) { return ERR_PTR(-ENODEV); } -static inline struct dentry *debugfs_create_u16(const char *name, umode_t mode, - struct dentry *parent, - u16 *value) +static inline struct dentry *debugfs_create_u16( + const char *name __maybe_unused, + umode_t mode __maybe_unused, + struct dentry *parent __maybe_unused, + u16 *value __maybe_unused) { return ERR_PTR(-ENODEV); } -static inline struct dentry *debugfs_create_u32(const char *name, umode_t mode, - struct dentry *parent, - u32 *value) +static inline struct dentry *debugfs_create_u32( + const char *name __maybe_unused, + umode_t mode __maybe_unused, + struct dentry *parent __maybe_unused, + u32 *value __maybe_unused) { return ERR_PTR(-ENODEV); } -static inline struct dentry *debugfs_create_u64(const char *name, umode_t mode, - struct dentry *parent, - u64 *value) +static inline struct dentry *debugfs_create_u64( + const char *name __maybe_unused, + umode_t mode __maybe_unused, + struct dentry *parent __maybe_unused, + u64 *value __maybe_unused) { return ERR_PTR(-ENODEV); } -static inline struct dentry *debugfs_create_x8(const char *name, umode_t mode, - struct dentry *parent, - u8 *value) +static inline struct dentry *debugfs_create_x8( + const char *name __maybe_unused, + umode_t mode __maybe_unused, + struct dentry *parent __maybe_unused, + u8 *value __maybe_unused) { return ERR_PTR(-ENODEV); } -static inline struct dentry *debugfs_create_x16(const char *name, umode_t mode, - struct dentry *parent, - u16 *value) +static inline struct dentry *debugfs_create_x16( + const char *name __maybe_unused, + umode_t mode __maybe_unused, + struct dentry *parent __maybe_unused, + u16 *value __maybe_unused) { return ERR_PTR(-ENODEV); } -static inline struct dentry *debugfs_create_x32(const char *name, umode_t mode, - struct dentry *parent, - u32 *value) +static inline struct dentry *debugfs_create_x32( + const char *name __maybe_unused, + umode_t mode __maybe_unused, + struct dentry *parent __maybe_unused, + u32 *value __maybe_unused) { return ERR_PTR(-ENODEV); } -static inline struct dentry *debugfs_create_x64(const char *name, umode_t mode, - struct dentry *parent, - u64 *value) +static inline struct dentry *debugfs_create_x64(const char *name __maybe_unused, umode_t mode __maybe_unused, + struct dentry *parent __maybe_unused, + u64 *value __maybe_unused) { return ERR_PTR(-ENODEV); } -static inline struct dentry *debugfs_create_size_t(const char *name, umode_t mode, - struct dentry *parent, - size_t *value) +static inline struct dentry *debugfs_create_size_t(const char *name __maybe_unused, umode_t mode __maybe_unused, + struct dentry *parent __maybe_unused, + size_t *value __maybe_unused) { return ERR_PTR(-ENODEV); } -static inline struct dentry *debugfs_create_atomic_t(const char *name, umode_t mode, - struct dentry *parent, atomic_t *value) +static inline struct dentry *debugfs_create_atomic_t(const char *name __maybe_unused, umode_t mode __maybe_unused, + struct dentry *parent __maybe_unused, atomic_t *value __maybe_unused) { return ERR_PTR(-ENODEV); } -static inline struct dentry *debugfs_create_bool(const char *name, umode_t mode, - struct dentry *parent, - u32 *value) +static inline struct dentry *debugfs_create_bool(const char *name __maybe_unused, umode_t mode, + struct dentry *parent __maybe_unused, + u32 *value __maybe_unused) { return ERR_PTR(-ENODEV); } -static inline struct dentry *debugfs_create_blob(const char *name, umode_t mode, - struct dentry *parent, - struct debugfs_blob_wrapper *blob) +static inline struct dentry *debugfs_create_blob( + const char *name __maybe_unused, + umode_t mode __maybe_unused, + struct dentry *parent __maybe_unused, + struct debugfs_blob_wrapper *blob __maybe_unused) { return ERR_PTR(-ENODEV); } -static inline struct dentry *debugfs_create_regset32(const char *name, - umode_t mode, struct dentry *parent, - struct debugfs_regset32 *regset) +static inline struct dentry *debugfs_create_regset32( + const char *name __maybe_unused, + umode_t mode __maybe_unused, + struct dentry *parent __maybe_unused, + struct debugfs_regset32 *regset __maybe_unused) { return ERR_PTR(-ENODEV); } @@ -283,6 +328,26 @@ return ERR_PTR(-ENODEV); } -#endif +#if defined(CONFIG_AVM_ENHANCED) -#endif +static inline int add_simple_debugfs_file( + const char *fname __maybe_unused, + struct dentry *parent __maybe_unused, + int (*kernel_input) (char *, void *) __maybe_unused, + void (*kernel_output) (struct seq_file *, void *) __maybe_unused, + void *priv_data __maybe_unused) +{ + return 0; +} + +static inline void remove_simple_debugfs_file( + struct dentry *this __maybe_unused) +{ + return; +} + +#endif /* CONFIG_AVM_ENHANCED */ + +#endif /* CONFIG_DEBUG_FS */ + +#endif /* _DEBUGFS_H_ */