2005-06-24 01:02:16 -04:00
|
|
|
/*
|
|
|
|
* Configuration OSM
|
|
|
|
*
|
|
|
|
* Copyright (C) 2005 Markus Lidel <Markus.Lidel@shadowconnect.com>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation; either version 2 of the License, or (at your
|
|
|
|
* option) any later version.
|
|
|
|
*
|
|
|
|
* Fixes/additions:
|
|
|
|
* Markus Lidel <Markus.Lidel@shadowconnect.com>
|
|
|
|
* initial version.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/i2o.h>
|
2005-07-07 20:56:02 -04:00
|
|
|
#include <linux/dcache.h>
|
2005-06-24 01:02:16 -04:00
|
|
|
#include <linux/namei.h>
|
2005-07-07 20:56:02 -04:00
|
|
|
#include <linux/fs.h>
|
2005-06-24 01:02:16 -04:00
|
|
|
|
|
|
|
#include <asm/uaccess.h>
|
|
|
|
|
|
|
|
#define OSM_NAME "config-osm"
|
2006-01-06 03:19:33 -05:00
|
|
|
#define OSM_VERSION "1.323"
|
2005-06-24 01:02:16 -04:00
|
|
|
#define OSM_DESCRIPTION "I2O Configuration OSM"
|
|
|
|
|
|
|
|
/* access mode user rw */
|
|
|
|
#define S_IWRSR (S_IRUSR | S_IWUSR)
|
|
|
|
|
|
|
|
static struct i2o_driver i2o_config_driver;
|
|
|
|
|
|
|
|
/* Config OSM driver struct */
|
|
|
|
static struct i2o_driver i2o_config_driver = {
|
|
|
|
.name = OSM_NAME,
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef CONFIG_I2O_CONFIG_OLD_IOCTL
|
|
|
|
#include "i2o_config.c"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* i2o_config_init - Configuration OSM initialization function
|
|
|
|
*
|
|
|
|
* Registers Configuration OSM in the I2O core and if old ioctl's are
|
|
|
|
* compiled in initialize them.
|
|
|
|
*
|
|
|
|
* Returns 0 on success or negative error code on failure.
|
|
|
|
*/
|
|
|
|
static int __init i2o_config_init(void)
|
|
|
|
{
|
|
|
|
printk(KERN_INFO OSM_DESCRIPTION " v" OSM_VERSION "\n");
|
|
|
|
|
|
|
|
if (i2o_driver_register(&i2o_config_driver)) {
|
|
|
|
osm_err("handler register failed.\n");
|
|
|
|
return -EBUSY;
|
|
|
|
}
|
|
|
|
#ifdef CONFIG_I2O_CONFIG_OLD_IOCTL
|
2005-09-21 12:55:35 -04:00
|
|
|
if (i2o_config_old_init()) {
|
|
|
|
osm_err("old config handler initialization failed\n");
|
2005-06-24 01:02:16 -04:00
|
|
|
i2o_driver_unregister(&i2o_config_driver);
|
2005-09-21 12:55:35 -04:00
|
|
|
return -EBUSY;
|
|
|
|
}
|
2005-06-24 01:02:16 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* i2o_config_exit - Configuration OSM exit function
|
|
|
|
*
|
|
|
|
* If old ioctl's are compiled in exit remove them and unregisters
|
|
|
|
* Configuration OSM from I2O core.
|
|
|
|
*/
|
|
|
|
static void i2o_config_exit(void)
|
|
|
|
{
|
|
|
|
#ifdef CONFIG_I2O_CONFIG_OLD_IOCTL
|
|
|
|
i2o_config_old_exit();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
i2o_driver_unregister(&i2o_config_driver);
|
|
|
|
}
|
|
|
|
|
|
|
|
MODULE_AUTHOR("Markus Lidel <Markus.Lidel@shadowconnect.com>");
|
|
|
|
MODULE_LICENSE("GPL");
|
|
|
|
MODULE_DESCRIPTION(OSM_DESCRIPTION);
|
|
|
|
MODULE_VERSION(OSM_VERSION);
|
|
|
|
|
|
|
|
module_init(i2o_config_init);
|
|
|
|
module_exit(i2o_config_exit);
|