static void __exit myproc_exit(void){
	remove_proc_entry("pool",mydir);
	remove_proc_entry("mydir",NULL);
}
Exemple #2
0
/**
 * scsi_exit_procfs - Remove scsi/scsi and scsi from procfs
 */
void scsi_exit_procfs(void)
{
	remove_proc_entry("scsi/scsi", NULL);
	remove_proc_entry("scsi", NULL);
}
static void __exit partition_exit(void)
{
    remove_proc_entry("partinfo", NULL);
    remove_proc_entry("upgrade", NULL);
}
/**
 *	Initialize logging configuration.  Schedules a work thread to
 *	load the configuration file once the file system is readable.
 **/
void BCMLOG_InitConfig(void *h)
{
	int value;
	struct device * dev = (struct device *)h;
	/*
	 *      disable all AP logging (CP logging is
	 *      handled by CP) [MobC00126731]
	 */
	memset(&g_config, 0x00, sizeof(g_config));

	/*
	 *      set default configuration
	 */
	SetConfigDefaults();

	/*
	 *      create the procfs entry
	 */
	g_proc_dir_entry =
	    create_proc_entry(BCMLOG_CONFIG_PROC_FILE,
			      S_IRWXU | S_IRWXG | S_IRWXO, NULL);

	if (g_proc_dir_entry == NULL) {
		remove_proc_entry(BCMLOG_CONFIG_PROC_FILE, NULL);
	}

	else {
		g_proc_dir_entry->read_proc = proc_read;
		g_proc_dir_entry->write_proc = proc_write;
	}

	strncpy(g_config.file_base, BCMLOG_DEFAULT_FILE_BASE, MAX_STR_NAME);
	strncpy(g_config.uart_dev, BCMLOG_DEFAULT_UART_DEV, MAX_STR_NAME);
	strncpy(g_config.acm_dev, BCMLOG_DEFAULT_ACM_DEV, MAX_STR_NAME);

	value = device_create_file(dev, &dev_attr_log);
	if (value < 0)
		pr_err("BCMLOG Init failed to create bcmlog log attribute\n");
	value = device_create_file(dev, &dev_attr_log_lock);
	if (value < 0)
		pr_err
	    ("BCMLOG Init failed to create bcmlog log_lock attribute\n");
	value = device_create_file(dev, &dev_attr_cp_crash);
	if (value < 0)
		pr_err
	    ("BCMLOG Init failed to create bcmlog cp crash log attribute\n");
	value = device_create_file(dev, &dev_attr_cp_crash_lock);
	if (value < 0)
		pr_err
	("BCMLOG Init failed to create bcmlog cp crash log lock attribute\n");
	value = device_create_file(dev, &dev_attr_ap_crash);
	if (value < 0)
		pr_err
	    ("BCMLOG Init failed to create bcmlog ap crash log attribute\n");
	value = device_create_file(dev, &dev_attr_ap_crash_lock);
	if (value < 0)
		pr_err
	("BCMLOG Init failed to create bcmlog ap crash log lock attribute\n");
	value = device_create_file(dev, &dev_attr_file_base);
	if (value < 0)
		pr_err
	    ("BCMLOG Init failed to create bcmlog file_base attribute\n");
	value = device_create_file(dev, &dev_attr_file_max);
	if (value < 0)
		pr_err
	    ("BCMLOG Init failed to create bcmlog file max attribute\n");
	value = device_create_file(dev, &dev_attr_uart_dev);
	if (value < 0)
		pr_err
	    ("BCMLOG Init failed to create bcmlog uart_dev attribute\n");
	value = device_create_file(dev, &dev_attr_acm_dev);
	if (value < 0)
		pr_err
	    ("BCMLOG Init failed to create bcmlog acm_dev attribute\n");
}
static void __exit rtc_exit(void)
{
	remove_proc_entry("driver/rtc", NULL);
	misc_deregister(&rtc_dev);

}
Exemple #6
0
static void scull_remove_proc(void)
{
    /* no problem if it was not registered */
    remove_proc_entry("scullmem", NULL /* parent dir */);
    remove_proc_entry("scullseq", NULL);
}
Exemple #7
0
void unload_tester_4(void) {
   remove_proc_entry("tester_4", root_dir);
   printk(KERN_INFO "tester_4: Module unloaded successfully\n");
}
Exemple #8
0
static void __exit jit_exit(void){
	remove_proc_entry("jit_busy",NULL);
	remove_proc_entry("jit_sched",NULL);
	remove_proc_entry("jit_queue",NULL);
	remove_proc_entry("jit_schedto",NULL);
}
Exemple #9
0
void ftape_proc_destroy(void)
{
	remove_proc_entry("ftape", &proc_root);
}
static void __exit bt_power_exit(void)
{
  remove_proc_entry("bt_power", NULL);
  remove_proc_entry("bt_stat", NULL);
  remove_proc_entry("bt_status", NULL);
}
Exemple #11
0
static void __exit ikconfig_cleanup(void)
{
	remove_proc_entry("config.gz", NULL);
}
static void __exit sdhci_drv_exit(void)
{
	remove_proc_entry(PROC_GLOBAL_PARENT_DIR, NULL);
	platform_driver_unregister(&sdhci_pltfm_driver);
}
Exemple #13
0
void
svc_proc_unregister(const char *name)
{
	remove_proc_entry(name, proc_net_rpc);
}
Exemple #14
0
static void __exit fooproc_exit(void)
{
	remove_proc_entry("foobar", NULL);
}
void
xfs_cleanup_procfs(void)
{
	remove_proc_entry("fs/xfs/stat", NULL);
	remove_proc_entry("fs/xfs", NULL);
}
Exemple #16
0
static int my_init (void) {
	int rc=0;
	proc_mydev = proc_mkdir(MYDEV,0);

	proc_hello = create_proc_entry(HELLO,0,proc_mydev);
	proc_hello->read_proc = read_hello;
	proc_hello->write_proc = write_hello;

	// proc_hello->owner = THIS_MODULE;

	hello_data=(struct proc_hello_data *)
		kmalloc(sizeof(*hello_data),GFP_KERNEL);

	hello_data->proc_hello_value=(char *)
		kmalloc(PROC_HELLO_BUFLEN,GFP_KERNEL);

	// no need for a separate memory allocation for wkq.
	// create_workqueue sets it up
	// hello_data->proc_hello_wkq=(struct workqueue_struct *)
		// kmalloc(sizeof(struct workqueue_struct),GFP_KERNEL);
	hello_data->proc_hello_wkq=create_workqueue(HELLO);
	
	hello_data->wk=(struct delayed_work *)
	    kzalloc(sizeof(struct delayed_work),GFP_KERNEL);

	hello_data->proc_hello_flag=0;

    irqflags=MYIRQFLAGS;

    // #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30)
        //if (!can_request_irq(thisIRQ, irqflags))
        //    free_irq(thisIRQ,(void*)&dev_id);
    // #endif

        // setup interrupt handler
   	if ((rc=(request_irq(thisIRQ,
        	(irq_handler_t) irq_handler,
       		irqflags,
       		(char *)"MYDEV_irq_handler",
       		(void*) &dev_id)))<0) {
   		printk(KERN_ALERT "2470:10.6a: intr not initialized!(RC=%d)\n",rc);
			goto err;
	}
	else {
   		printk(KERN_ALERT "2470:10.6a: intr initialized!\n");
	}

    // module init message
    printk(KERN_ALERT "2470:10.6a: main initialized!\n");
    printk(KERN_ALERT "2470:10.6a: memory allocated(hello_data) = %0x(%d bytes)!\n", (int) hello_data, ksize(hello_data));
    printk(KERN_ALERT "2470:10.6a: memory allocated(hello_data->wk) = %0x(%d bytes)!\n", (int) &hello_data->wk, ksize(hello_data->wk));
    printk(KERN_ALERT "2470:10.6a: memory allocated(hello_data->proc_hello_value) = %d!\n", ksize(hello_data->proc_hello_value));

	return 0;

err:
	while (delayed_work_pending(hello_data->wk)) {
		cancel_delayed_work_sync(hello_data->wk);
        printk(KERN_ALERT "2470:10.6a: Cancelling delayed work!\n");
	}

	destroy_workqueue(hello_data->proc_hello_wkq);

	kfree(hello_data->wk);

	kfree(hello_data->proc_hello_value);
	kfree(hello_data);

	if (proc_hello)
		remove_proc_entry (HELLO, proc_mydev);
	if (proc_mydev)
		remove_proc_entry (MYDEV, 0);

    // module exit message
    printk(KERN_ALERT "2470:10.6a: main bailed out!\n");
	
	return rc;
}
Exemple #17
0
static void __exit wifi_proc_uninit(void)
{

	remove_proc_entry(procfs_name, &proc_root);
}
static int mvmhyper_init(void)
{
	int ret;
	printk("mvmhyper init.\n");
	if(useit[sys_ioctl_id])
    {
        jphyper[sys_ioctl_id].entry = (kprobe_opcode_t *) my_sys_ioctl;
        jphyper[sys_ioctl_id].kp.symbol_name="sys_ioctl";
    }
    if(useit[xen_pgd_pin_id])
    {
        jphyper[xen_pgd_pin_id].entry = (kprobe_opcode_t *) my_xen_pgd_pin;
        jphyper[xen_pgd_pin_id].kp.symbol_name="xen_pgd_pin";
    }
	if(useit[xen_l2_entry_update_id])
    {
        jphyper[xen_l2_entry_update_id].entry = (kprobe_opcode_t *) my_xen_l2_entry_update;
        jphyper[xen_l2_entry_update_id].kp.symbol_name="xen_l2_entry_update";
    }
	if(useit[direct_remap_pfn_range_id])
    {
        jphyper[direct_remap_pfn_range_id].entry = (kprobe_opcode_t *) my_direct_remap_pfn_range;
        jphyper[direct_remap_pfn_range_id].kp.symbol_name="direct_remap_pfn_range";
    }
	if(useit[xen_l3_entry_update_id])
    {
        jphyper[xen_l3_entry_update_id].entry = (kprobe_opcode_t *) my_xen_l3_entry_update;
        jphyper[xen_l3_entry_update_id].kp.symbol_name="xen_l3_entry_update";
    }
	if(useit[dispatch_rw_block_io_id])
    {
        jphyper[dispatch_rw_block_io_id].entry = (kprobe_opcode_t *) my_dispatch_rw_block_io;
        jphyper[dispatch_rw_block_io_id].kp.symbol_name="dispatch_rw_block_io";
    }
    printk("Fortune: Begin register.\n");
	for(i=0;i<jpnum;++i)
	{
	    if(!useit[i])
            continue;
		jphyper[i].kp.addr=(kprobe_opcode_t *) kallsyms_lookup_name(jphyper[i].kp.symbol_name);
		if((ret=register_jprobe(&jphyper[i]))<0)
		{
			printk("Fortune: Error, register probe %d failed with return %d\n", i, ret);
			return -1;
		}
		if(jphyper[i].kp.addr == NULL)
		{
			printk("Fortune: Error, can't find %d address.\n", i);
			return -1;
		}
		printk("Fortune: Planted probe at %p, change %s\n", jphyper[i].kp.addr, jphyper[i].kp.symbol_name);
	}
	dir = proc_mkdir("jphyper", NULL);
	if(dir == NULL)
	{
		printk("Fortune: Can't create /proc/jphyper\n");
		return -1;
	}
	proc_aim = create_proc_entry("aim", PERMISSION, dir);
	if(proc_aim == NULL)
	{
		printk("Fortune: Can't create /proc/jphyper/aim\n");
		remove_proc_entry("jphyper", NULL);
		return -1;
	}
	proc_aim->read_proc = proc_read_aim;
	proc_aim->write_proc = proc_write_aim;
	proc_fault = create_proc_entry("fault", PERMISSION, dir);
	if(proc_fault == NULL)
	{
		printk("Fortune: Can't create /proc/jphyper/fault\n");
		remove_proc_entry("aim",dir);
		remove_proc_entry("jphyper", NULL);
		return -1;
	}
	proc_fault->read_proc = proc_read_fault;
	proc_fault->write_proc = proc_write_fault;
	proc_time = create_proc_entry("time", PERMISSION, dir);
	if(proc_time == NULL)
	{
		printk("Fortune: Can't create /proc/jphyper/time\n");
		remove_proc_entry("aim",dir);
		remove_proc_entry("fault",dir);
		remove_proc_entry("jphyper", NULL);
		return -1;
	}
	proc_time->read_proc = proc_read_time;
	proc_time->write_proc = proc_write_time;
	proc_id = create_proc_entry("id", PERMISSION, dir);
	if(proc_id == NULL)
	{
		printk("Fortune: Can't create /proc/jphyper/id\n");
		remove_proc_entry("aim", dir);
		remove_proc_entry("fault", dir);
		remove_proc_entry("time", dir);
		remove_proc_entry("jphyper", NULL);
		return -1;
	}
	proc_id->read_proc = proc_read_id;
	proc_id->write_proc = proc_write_id;
	proc_signal = create_proc_entry("signal", PERMISSION, dir);
	if(proc_signal == NULL)
	{
		printk("Fortune: Can't create /proc/jphyper/signal\n");
		remove_proc_entry("aim", dir);
		remove_proc_entry("fault", dir);
		remove_proc_entry("time", dir);
		remove_proc_entry("id", dir);
		remove_proc_entry("jphyper", NULL);
		return -1;
	}
	proc_signal->read_proc = proc_read_signal;
	proc_signal->write_proc = proc_write_signal;
	printk("Fortune: Create /proc/jphyper done.\n");
	return 0;
}
Exemple #19
0
void wanrouter_proc_cleanup(void)
{
	remove_proc_entry("config", proc_router);
	remove_proc_entry("status", proc_router);
	remove_proc_entry(ROUTER_NAME, init_net.proc_net);
}
void mpc_proc_clean(void)
{
	remove_proc_entry(STAT_FILE_NAME, atm_proc_root);
}
Exemple #21
0
/*
 * Register a JFFS partition directory (called upon mount)
 */
int jffs_register_jffs_proc_dir(kdev_t dev, struct jffs_control *c)
{
	struct jffs_partition_dir *part_dir;
	struct proc_dir_entry *part_info = 0;
	struct proc_dir_entry *part_layout = 0;
	struct proc_dir_entry *part_root = 0;

	/*
	 * Needs to be allocated at each register since it's freed on unregister
	 */
	jffs_proc_root = proc_mkdir("jffs", proc_root_fs);

	/* Allocate structure for local JFFS partition table */
	if (!(part_dir = (struct jffs_partition_dir *)
		kmalloc (sizeof (struct jffs_partition_dir), GFP_KERNEL))) {
		return -ENOMEM;
	}

	/* Create entry for this partition */
	if ((part_root = create_proc_entry (kdevname(dev),
		S_IFDIR | S_IRUGO | S_IXUGO, jffs_proc_root))) {
		part_root->read_proc = jffs_proc_info_read;
		part_root->data = (void *) c;
	}
	else {
		kfree (part_dir);
		return -ENOMEM;
	}

	/* Create entry for 'info' file */
	if ((part_info = create_proc_entry ("info", 0, part_root))) {
		part_info->read_proc = jffs_proc_info_read;
		part_info->data = (void *) c;
	}
	else {
		remove_proc_entry (part_root->name, jffs_proc_root);
		kfree (part_dir);
		return -ENOMEM;
	}

	/* Create entry for 'layout' file */
	if ((part_layout = create_proc_entry ("layout", 0, part_root))) {
		part_layout->read_proc = jffs_proc_layout_read;
		part_layout->data = (void *) c;
	}
	else {
		remove_proc_entry (part_info->name, part_root);
		remove_proc_entry (part_root->name, jffs_proc_root);
		kfree (part_dir);
		return -ENOMEM;
	}

	/* Fill in structure for table and insert in the list */
	part_dir->c = c;
	part_dir->part_root = part_root;
	part_dir->part_info = part_info;
	part_dir->part_layout = part_layout;
	part_dir->next = jffs_part_dirs;
	jffs_part_dirs = part_dir;

	/* Return happy */
	return 0;
}
Exemple #22
0
static void proc_exit()
{
	remove_proc_entry(proc_entry,NULL);
	printk(KERN_ERR "HELLO EXIT!\n");

}
Exemple #23
0
static void __net_exit synproxy_proc_exit(struct net *net)
{
	remove_proc_entry("synproxy", net->proc_net_stat);
}
Exemple #24
0
void cleanup_module ()
{
	printk (KERN_INFO "/proc/%s: remove\n", PROCFS_NAME);
	remove_proc_entry (PROCFS_NAME, NULL);
}
Exemple #25
0
static void hello_remove_proc(void) {
	remove_proc_entry(HELLO_DEVICE_PROC_NAME, NULL);
}
Exemple #26
0
void igb_procfs_topdir_exit(void) 
{
//	remove_proc_entry("driver", proc_root_driver);
	remove_proc_entry("driver/igb", NULL);
}
void functn_cleanup(void) {
    remove_proc_entry("ps_list",NULL);
}
static void __exit toshiba_acpi_exit(void)
{
	acpi_bus_unregister_driver(&toshiba_acpi_driver);
	if (toshiba_proc_dir)
		remove_proc_entry(PROC_TOSHIBA, acpi_root_dir);
}
Exemple #29
0
/* Cleanup the objcount entry in the proc filesystem.  */
void sctp_dbg_objcnt_exit(struct net *net)
{
	remove_proc_entry("sctp_dbg_objcnt", net->sctp.proc_net_sctp);
}
Exemple #30
0
static void mymsg_exit(void)
{
	remove_proc_entry("mymsg", &proc_root);
}