/alps/kmm

To get this branch, use:
bzr branch http://suren.me/webbzr/alps/kmm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <linux/init.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/types.h>
#include <linux/cdev.h>
#include <linux/fs.h>
#include <linux/slab.h>


#include "mod.h"
#include "dev.h"
#include "debug.h"

int kmm_device_open(struct inode *inode, struct file *filp)
{
    kmm_dev_t *dev;

    dev = container_of( inode->i_cdev, kmm_dev_t, cdev);
    filp->private_data = dev;
    
    mod_info("open\n");

    return 0;
}

int kmm_device_release(struct inode *inode, struct file *filp)
{
    mod_info("close\n");

    return 0;
}


static struct file_operations kmm_fops = {
    .owner = THIS_MODULE,
//	.unlocked_ioctl = pcidriver_ioctl,
//	.mmap = pcidriver_mmap,
    .open = kmm_device_open,
    .release = kmm_device_release,
};

const struct file_operations *kmm_get_fops(void)
{
    return &kmm_fops;
}