2 #define __KERNEL_SYSCALLS__
3 #include <linux/module.h>
6 #include <linux/malloc.h>
7 #include <linux/unistd.h>
8 #include <asm/uaccess.h>
11 static int do_mod_firmware_load(const char *fn
, char **fp
)
20 printk(KERN_INFO
"Unable to load '%s'.\n", fn
);
24 if (l
<= 0 || l
> 131072)
26 printk(KERN_INFO
"Invalid firmware '%s'\n", fn
);
34 printk(KERN_INFO
"Out of memory loading '%s'.\n", fn
);
38 if (read(fd
, dp
, l
) != l
)
40 printk(KERN_INFO
"Failed to read '%s'.\n", fn
);
50 int mod_firmware_load(const char *fn
, char **fp
)
53 mm_segment_t fs
= get_fs();
56 r
= do_mod_firmware_load(fn
, fp
);