| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2012-07-20 11:15:04 +02:00
										 |  |  |  * Copyright IBM Corp. 2004   All Rights Reserved. | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  |  * | 
					
						
							|  |  |  |  * Tape class device support | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Author: Stefan Bader <shbader@de.ibm.com> | 
					
						
							|  |  |  |  * Based on simple class device code by Greg K-H | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | #ifndef __TAPE_CLASS_H__
 | 
					
						
							|  |  |  | #define __TAPE_CLASS_H__
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <linux/init.h>
 | 
					
						
							|  |  |  | #include <linux/module.h>
 | 
					
						
							|  |  |  | #include <linux/fs.h>
 | 
					
						
							|  |  |  | #include <linux/major.h>
 | 
					
						
							|  |  |  | #include <linux/cdev.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <linux/device.h>
 | 
					
						
							|  |  |  | #include <linux/kdev_t.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define TAPECLASS_NAME_LEN	32
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | struct tape_class_device { | 
					
						
							| 
									
										
										
										
											2007-10-22 12:52:42 +02:00
										 |  |  | 	struct cdev		*char_device; | 
					
						
							|  |  |  | 	struct device		*class_device; | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	char			device_name[TAPECLASS_NAME_LEN]; | 
					
						
							|  |  |  | 	char			mode_name[TAPECLASS_NAME_LEN]; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*
 | 
					
						
							|  |  |  |  * Register a tape device and return a pointer to the tape class device | 
					
						
							|  |  |  |  * created by the call. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * device | 
					
						
							|  |  |  |  *	The pointer to the struct device of the physical (base) device. | 
					
						
							|  |  |  |  * dev | 
					
						
							|  |  |  |  *	The intended major/minor number. The major number may be 0 to | 
					
						
							|  |  |  |  *	get a dynamic major number. | 
					
						
							|  |  |  |  * fops | 
					
						
							|  |  |  |  *	The pointer to the drivers file operations for the tape device. | 
					
						
							|  |  |  |  * device_name | 
					
						
							|  |  |  |  *	Pointer to the logical device name (will also be used as kobject name | 
					
						
							|  |  |  |  *	of the cdev). This can also be called the name of the tape class | 
					
						
							|  |  |  |  *	device. | 
					
						
							|  |  |  |  * mode_name | 
					
						
							|  |  |  |  *	Points to the name of the tape mode. This creates a link with that | 
					
						
							|  |  |  |  *	name from the physical device to the logical device (class). | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | struct tape_class_device *register_tape_dev( | 
					
						
							|  |  |  | 	struct device *		device, | 
					
						
							|  |  |  | 	dev_t			dev, | 
					
						
							| 
									
										
										
										
											2007-02-12 00:55:37 -08:00
										 |  |  | 	const struct file_operations *fops, | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	char *			device_name, | 
					
						
							|  |  |  | 	char *			node_name | 
					
						
							|  |  |  | ); | 
					
						
							| 
									
										
										
										
											2008-04-17 07:46:05 +02:00
										 |  |  | void unregister_tape_dev(struct device *device, struct tape_class_device *tcd); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | #endif /* __TAPE_CLASS_H__ */
 |