2 #include <linux/slab.h>
3 #include <linux/miscdevice.h>
5 #include <asm/uaccess.h>
7 static ssize_t read_check_wifi_chip(struct file *file,
8 char __user *buffer, size_t count, loff_t *ppos)
13 if (*ppos < 0 || !count)
16 buf = kmalloc(count, GFP_KERNEL);
21 ret = sprintf(buf, "%s", "bcm43438 cob");
24 if (copy_to_user(buffer, buf, ret)) {
35 static const struct file_operations check_wifi_chip_fops = {
36 .read = read_check_wifi_chip,
39 static struct miscdevice check_wifi_chip = {
40 .minor = MISC_DYNAMIC_MINOR,
41 .name = "check_wifi_chip",
42 .fops = &check_wifi_chip_fops,
45 static int __init check_wifi_chip_init(void)
47 return misc_register(&check_wifi_chip);
50 static void __exit check_wifi_chip_exit(void)
52 misc_deregister(&check_wifi_chip);
55 module_init(check_wifi_chip_init);
56 module_exit(check_wifi_chip_exit);