2 * (C) Copyright IBM Corp. 2004 All Rights Reserved.
5 * Tape class device support
7 * Author: Stefan Bader <shbader@de.ibm.com>
8 * Based on simple class device code by Greg K-H
10 #ifndef __TAPE_CLASS_H__
11 #define __TAPE_CLASS_H__
13 #include <linux/init.h>
14 #include <linux/module.h>
16 #include <linux/major.h>
17 #include <linux/kobject.h>
18 #include <linux/kobj_map.h>
19 #include <linux/cdev.h>
21 #include <linux/device.h>
22 #include <linux/kdev_t.h>
24 #define TAPECLASS_NAME_LEN 32
26 struct tape_class_device
{
27 struct cdev
*char_device
;
28 struct device
*class_device
;
29 char device_name
[TAPECLASS_NAME_LEN
];
30 char mode_name
[TAPECLASS_NAME_LEN
];
34 * Register a tape device and return a pointer to the tape class device
35 * created by the call.
38 * The pointer to the struct device of the physical (base) device.
40 * The intended major/minor number. The major number may be 0 to
41 * get a dynamic major number.
43 * The pointer to the drivers file operations for the tape device.
45 * Pointer to the logical device name (will also be used as kobject name
46 * of the cdev). This can also be called the name of the tape class
49 * Points to the name of the tape mode. This creates a link with that
50 * name from the physical device to the logical device (class).
52 struct tape_class_device
*register_tape_dev(
53 struct device
* device
,
55 const struct file_operations
*fops
,
59 void unregister_tape_dev(struct tape_class_device
*tcd
);
61 #endif /* __TAPE_CLASS_H__ */