Header:
#include <linux/proc_fs.h>

static int __init
init(void)
{
    //Proc File System
    static struct proc_dir_entry *proc = create_proc_entry("ccaminfo", 0444, NULL);
    if(proc == NULL)
   goto release_proc;
 
    util_proc->owner = THIS_MODULE;
    util_proc->read_proc = mt9p111_read_proc;

    return 0;

release_proc:
    remove_proc_entry("ccaminfo", NULL);
    return 0;
 }
 
static int mt9p111_read_proc(char *page, char **start, off_t off,
 int count, int *eof, void *data)
{
int len;
len = sprintf(page, "Hello World!\n", val);

*eof = 1;

return len;
}


 
proc API:

create_proc_entry
create_proc_read_entry
create_proc_info_entry
proc_mkdir
proc_symlink
remove_proc_entry 

+ Recent posts