Exemplo n.º 1
0
/*  Called by modules package when installing the driver or by kernel
 *  during the initialization phase
 */
int __init zft_init(void)
{
	int i;
	TRACE_FUN(ft_t_flow);

#ifdef MODULE
	printk(KERN_INFO ZFTAPE_VERSION "\n");
        if (TRACE_LEVEL >= ft_t_info) {
		printk(
KERN_INFO
"(c) 1996, 1997 Claus-Justus Heine ([email protected])\n"
KERN_INFO
"vfs interface for ftape floppy tape driver.\n"
KERN_INFO
"Support for QIC-113 compatible volume table, dynamic memory allocation\n"
KERN_INFO
"and builtin compression (lzrw3 algorithm).\n");
        }
#else /* !MODULE */
	/* print a short no-nonsense boot message */
	printk(KERN_INFO ZFTAPE_VERSION "\n");
#endif /* MODULE */
	TRACE(ft_t_info, "zft_init @ 0x%p", zft_init);
	TRACE(ft_t_info,
	      "installing zftape VFS interface for ftape driver ...");
	TRACE_CATCH(register_chrdev(QIC117_TAPE_MAJOR, "zft", &zft_cdev),);

	zft_class = class_create(THIS_MODULE, "zft");
	for (i = 0; i < 4; i++) {
		class_device_create(zft_class, NULL, MKDEV(QIC117_TAPE_MAJOR, i), NULL, "qft%i", i);
		class_device_create(zft_class, NULL, MKDEV(QIC117_TAPE_MAJOR, i + 4), NULL, "nqft%i", i);
		class_device_create(zft_class, NULL, MKDEV(QIC117_TAPE_MAJOR, i + 16), NULL, "zqft%i", i);
		class_device_create(zft_class, NULL, MKDEV(QIC117_TAPE_MAJOR, i + 20), NULL, "nzqft%i", i);
		class_device_create(zft_class, NULL, MKDEV(QIC117_TAPE_MAJOR, i + 32), NULL, "rawqft%i", i);
		class_device_create(zft_class, NULL, MKDEV(QIC117_TAPE_MAJOR, i + 36), NULL, "nrawrawqft%i", i);
	}

#ifdef CONFIG_ZFT_COMPRESSOR
	(void)zft_compressor_init();
#endif
	zft_status = ftape_get_status(); /*  fetch global data of ftape 
					  *  hardware driver 
					  */
	TRACE_EXIT 0;
}
Exemplo n.º 2
0
/*  Called by modules package when installing the driver or by kernel
 *  during the initialization phase
 */
int __init zft_init(void)
{
	int i;
	TRACE_FUN(ft_t_flow);

#ifdef MODULE
	printk(KERN_INFO ZFTAPE_VERSION "\n");
        if (TRACE_LEVEL >= ft_t_info) {
		printk(
KERN_INFO
"(c) 1996, 1997 Claus-Justus Heine ([email protected])\n"
KERN_INFO
"vfs interface for ftape floppy tape driver.\n"
KERN_INFO
"Support for QIC-113 compatible volume table, dynamic memory allocation\n"
KERN_INFO
"and builtin compression (lzrw3 algorithm).\n"
KERN_INFO
"Compiled for Linux version %s"
#ifdef MODVERSIONS
		       " with versioned symbols"
#endif
		       "\n", UTS_RELEASE);
        }
#else /* !MODULE */
	/* print a short no-nonsense boot message */
	printk(KERN_INFO ZFTAPE_VERSION " for Linux " UTS_RELEASE "\n");
#endif /* MODULE */
	TRACE(ft_t_info, "zft_init @ 0x%p", zft_init);
	TRACE(ft_t_info,
	      "installing zftape VFS interface for ftape driver ...");
	TRACE_CATCH(devfs_register_chrdev(QIC117_TAPE_MAJOR, "zft", &zft_cdev),);

	for (i = 0; i < 4; i++) {
		char devname[9];

		sprintf (devname, "qft%i", i);
		devfs_register (NULL, devname, DEVFS_FL_DEFAULT,
			        QIC117_TAPE_MAJOR, i,
				S_IFCHR | S_IRUSR | S_IWUSR,
				&zft_cdev, NULL);
		sprintf (devname, "nqft%i", i);
		devfs_register (NULL, devname, DEVFS_FL_DEFAULT,
				QIC117_TAPE_MAJOR, i + 4,
				S_IFCHR | S_IRUSR | S_IWUSR,
				&zft_cdev, NULL);
		sprintf (devname, "zqft%i", i);
		devfs_register (NULL, devname, DEVFS_FL_DEFAULT,
				QIC117_TAPE_MAJOR, i + 16,
				S_IFCHR | S_IRUSR | S_IWUSR,
				&zft_cdev, NULL);
		sprintf (devname, "nzqft%i", i);
		devfs_register (NULL, devname, DEVFS_FL_DEFAULT,
				QIC117_TAPE_MAJOR, i + 20,
				S_IFCHR | S_IRUSR | S_IWUSR,
				&zft_cdev, NULL);
		sprintf (devname, "rawqft%i", i);
		devfs_register (NULL, devname, DEVFS_FL_DEFAULT,
				QIC117_TAPE_MAJOR, i + 32,
				S_IFCHR | S_IRUSR | S_IWUSR,
				&zft_cdev, NULL);
		sprintf (devname, "nrawqft%i", i);
		devfs_register (NULL, devname, DEVFS_FL_DEFAULT,
				QIC117_TAPE_MAJOR, i + 36,
				S_IFCHR | S_IRUSR | S_IWUSR,
				&zft_cdev, NULL);
	}

#ifdef CONFIG_ZFT_COMPRESSOR
	(void)zft_compressor_init();
#endif
	zft_status = ftape_get_status(); /*  fetch global data of ftape 
					  *  hardware driver 
					  */
	TRACE_EXIT 0;
}