char **);
void (*init)(const struct cdev *);
void (*free)(const struct cdev *);
+ void (*attach_xinfo)(struct cdev *);
int (*handle_fdinfo)(struct cdev *, const char *, const char *);
+ const struct ipc_class * (*get_ipc_class)(struct cdev *);
};
static bool cdev_fill_column(struct proc *proc __attribute__((__unused__)),
cdev->cdev_ops->free(cdev);
}
+static void cdev_attach_xinfo(struct file *file)
+{
+ struct cdev *cdev = (struct cdev *)file;
+
+ if (cdev->cdev_ops->attach_xinfo)
+ cdev->cdev_ops->attach_xinfo(cdev);
+}
+
static int cdev_handle_fdinfo(struct file *file, const char *key, const char *value)
{
struct cdev *cdev = (struct cdev *)file;
return 0; /* Should be handled in parents */
}
+static const struct ipc_class *cdev_get_ipc_class(struct file *file)
+{
+ struct cdev *cdev = (struct cdev *)file;
+
+ if (cdev->cdev_ops->get_ipc_class)
+ return cdev->cdev_ops->get_ipc_class(cdev);
+ return NULL;
+}
+
const struct file_class cdev_class = {
.super = &file_class,
.size = sizeof(struct cdev),
.fill_column = cdev_fill_column,
.initialize_content = init_cdev_content,
.free_content = free_cdev_content,
+ .attach_xinfo = cdev_attach_xinfo,
.handle_fdinfo = cdev_handle_fdinfo,
+ .get_ipc_class = cdev_get_ipc_class,
};