Lines Matching defs:mdev
9 * Sample driver that creates mdev device that simulates serial port over PCI
29 #include <linux/mdev.h>
128 /* State of each mdev device */
136 struct mdev_device *mdev;
634 static ssize_t mdev_access(struct mdev_device *mdev, u8 *buf, size_t count,
642 if (!mdev || !buf)
645 mdev_state = mdev_get_drvdata(mdev);
711 static int mtty_create(struct kobject *kobj, struct mdev_device *mdev)
717 if (!mdev)
722 dev_driver_string(mdev_parent_dev(mdev)), i + 1);
749 mdev_state->mdev = mdev;
750 mdev_set_drvdata(mdev, mdev_state);
761 static int mtty_remove(struct mdev_device *mdev)
764 struct mdev_state *mdev_state = mdev_get_drvdata(mdev);
771 mdev_set_drvdata(mdev, NULL);
783 static int mtty_reset(struct mdev_device *mdev)
787 if (!mdev)
790 mdev_state = mdev_get_drvdata(mdev);
799 static ssize_t mtty_read(struct mdev_device *mdev, char __user *buf,
811 ret = mdev_access(mdev, (u8 *)&val, sizeof(val),
823 ret = mdev_access(mdev, (u8 *)&val, sizeof(val),
835 ret = mdev_access(mdev, (u8 *)&val, sizeof(val),
858 static ssize_t mtty_write(struct mdev_device *mdev, const char __user *buf,
873 ret = mdev_access(mdev, (u8 *)&val, sizeof(val),
885 ret = mdev_access(mdev, (u8 *)&val, sizeof(val),
897 ret = mdev_access(mdev, (u8 *)&val, sizeof(val),
915 static int mtty_set_irqs(struct mdev_device *mdev, uint32_t flags,
922 if (!mdev)
925 mdev_state = mdev_get_drvdata(mdev);
1043 static int mtty_get_region_info(struct mdev_device *mdev,
1051 if (!mdev)
1054 mdev_state = mdev_get_drvdata(mdev);
1092 static int mtty_get_irq_info(struct mdev_device *mdev,
1117 static int mtty_get_device_info(struct mdev_device *mdev,
1127 static long mtty_ioctl(struct mdev_device *mdev, unsigned int cmd,
1134 if (!mdev)
1137 mdev_state = mdev_get_drvdata(mdev);
1154 ret = mtty_get_device_info(mdev, &info);
1179 ret = mtty_get_region_info(mdev, &info, &cap_type_id,
1203 ret = mtty_get_irq_info(mdev, &info);
1237 ret = mtty_set_irqs(mdev, hdr.flags, hdr.index, hdr.start,
1244 return mtty_reset(mdev);
1249 static int mtty_open(struct mdev_device *mdev)
1255 static void mtty_close(struct mdev_device *mdev)