#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/major.h>
+#include <linux/kmod.h> /* for request_module() */
#include <linux/sched.h>
#include <linux/lp.h>
#include <linux/malloc.h>
static int obd_init_magic;
int obd_print_entry = 1;
-int obd_debug_level = 4095;
+int obd_debug_level = 0;
struct obd_device obd_dev[MAX_OBD_DEVICES];
struct list_head obd_types;
case OBD_IOC_ATTACH: {
struct obd_type *type;
struct oic_generic *input = tmp_buf;
+ char *nm;
ENTRY;
/* have we attached a type to this device */
}
/* find the type */
- type = obd_nm_to_type(input->att_type);
+ nm = input->att_type;
+ type = obd_nm_to_type(nm);
+#ifdef CONFIG_KMOD
+ if ( !type ) {
+ if ( !request_module(nm) ) {
+ CDEBUG(D_IOCTL, "Loaded module '%s'\n", nm);
+ type = obd_nm_to_type(nm);
+ } else {
+ CDEBUG(D_IOCTL, "Can't load module '%s'\n", nm);
+ }
+ }
+#endif
+
OBD_FREE(input->att_type, input->att_typelen + 1);
if ( !type ) {
printk(__FUNCTION__ ": unknown obd type dev %d\n",
default: {
struct obd_type *type;
struct oic_generic input;
+ char *nm;
void *karg;
/* get data structures */
}
/* find the type */
- type = obd_nm_to_type(input.att_type);
+ nm = input.att_type;
+ type = obd_nm_to_type(nm);
+#ifdef CONFIG_KMOD
+ if ( !type ) {
+ if ( !request_module(nm) ) {
+ CDEBUG(D_IOCTL, "Loaded module '%s'\n", nm);
+ type = obd_nm_to_type(nm);
+ } else {
+ CDEBUG(D_IOCTL, "Can't load module '%s'\n", nm);
+ }
+ }
+#endif
OBD_FREE(input.att_type, input.att_typelen + 1);
if ( !type ) {
printk(__FUNCTION__ ": unknown obd type dev %d\n", dev);
obd_class_release, /* release */
NULL, /* fsync */
NULL, /* fasync */
- NULL, /* check_media_change */
- NULL, /* revalidate */
NULL /* lock */
};