equal
deleted
inserted
replaced
42 #include "master.h" |
42 #include "master.h" |
43 #include "slave_config.h" |
43 #include "slave_config.h" |
44 #include "voe_handler.h" |
44 #include "voe_handler.h" |
45 #include "ioctl.h" |
45 #include "ioctl.h" |
46 |
46 |
|
47 #define DEBUG_IOCTL 0 |
|
48 |
47 /*****************************************************************************/ |
49 /*****************************************************************************/ |
48 |
50 |
49 static int eccdev_open(struct inode *, struct file *); |
51 static int eccdev_open(struct inode *, struct file *); |
50 static int eccdev_release(struct inode *, struct file *); |
52 static int eccdev_release(struct inode *, struct file *); |
51 static long eccdev_ioctl(struct file *, unsigned int, unsigned long); |
53 static long eccdev_ioctl(struct file *, unsigned int, unsigned long); |
2899 priv->requested = 0; |
2901 priv->requested = 0; |
2900 priv->process_data = NULL; |
2902 priv->process_data = NULL; |
2901 priv->process_data_size = 0; |
2903 priv->process_data_size = 0; |
2902 |
2904 |
2903 filp->private_data = priv; |
2905 filp->private_data = priv; |
2904 if (master->debug_level) |
2906 |
2905 EC_DBG("File opened.\n"); |
2907 #if DEBUG_IOCTL |
|
2908 EC_DBG("File opened.\n"); |
|
2909 #endif |
2906 return 0; |
2910 return 0; |
2907 } |
2911 } |
2908 |
2912 |
2909 /*****************************************************************************/ |
2913 /*****************************************************************************/ |
2910 |
2914 |
2919 ecrt_release_master(master); |
2923 ecrt_release_master(master); |
2920 |
2924 |
2921 if (priv->process_data) |
2925 if (priv->process_data) |
2922 vfree(priv->process_data); |
2926 vfree(priv->process_data); |
2923 |
2927 |
2924 if (master->debug_level) |
2928 #if DEBUG_IOCTL |
2925 EC_DBG("File closed.\n"); |
2929 EC_DBG("File closed.\n"); |
|
2930 #endif |
|
2931 |
2926 kfree(priv); |
2932 kfree(priv); |
2927 return 0; |
2933 return 0; |
2928 } |
2934 } |
2929 |
2935 |
2930 /*****************************************************************************/ |
2936 /*****************************************************************************/ |
2934 long eccdev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |
2940 long eccdev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |
2935 { |
2941 { |
2936 ec_cdev_priv_t *priv = (ec_cdev_priv_t *) filp->private_data; |
2942 ec_cdev_priv_t *priv = (ec_cdev_priv_t *) filp->private_data; |
2937 ec_master_t *master = priv->cdev->master; |
2943 ec_master_t *master = priv->cdev->master; |
2938 |
2944 |
2939 if (master->debug_level) |
2945 #if DEBUG_IOCTL |
2940 EC_DBG("ioctl(filp = 0x%x, cmd = 0x%08x (0x%02x), arg = 0x%x)\n", |
2946 EC_DBG("ioctl(filp = 0x%x, cmd = 0x%08x (0x%02x), arg = 0x%x)\n", |
2941 (u32) filp, (u32) cmd, (u32) _IOC_NR(cmd), (u32) arg); |
2947 (u32) filp, (u32) cmd, (u32) _IOC_NR(cmd), (u32) arg); |
|
2948 #endif |
2942 |
2949 |
2943 switch (cmd) { |
2950 switch (cmd) { |
2944 case EC_IOCTL_MASTER: |
2951 case EC_IOCTL_MASTER: |
2945 return ec_cdev_ioctl_master(master, arg); |
2952 return ec_cdev_ioctl_master(master, arg); |
2946 case EC_IOCTL_SLAVE: |
2953 case EC_IOCTL_SLAVE: |