2 * ide-default - Driver for unbound ide devices
4 * This provides a clean way to bind a device to default operations
5 * by having an actual driver class that rather than special casing
6 * "no driver" all over the IDE code
8 * Copyright (C) 2003, Red Hat <alan@redhat.com>
11 #include <linux/config.h>
12 #include <linux/module.h>
13 #include <linux/types.h>
14 #include <linux/string.h>
15 #include <linux/kernel.h>
16 #include <linux/delay.h>
17 #include <linux/timer.h>
19 #include <linux/interrupt.h>
20 #include <linux/major.h>
21 #include <linux/errno.h>
22 #include <linux/genhd.h>
23 #include <linux/slab.h>
24 #include <linux/cdrom.h>
25 #include <linux/ide.h>
26 #include <linux/bitops.h>
28 #include <asm/byteorder.h>
30 #include <asm/uaccess.h>
32 #include <asm/unaligned.h>
34 #define IDEDEFAULT_VERSION "0.9.newide"
36 * Driver initialization.
39 static int idedefault_attach(ide_drive_t *drive);
42 * IDE subdriver functions, registered with ide.c
45 ide_driver_t idedefault_driver = {
46 .name = "ide-default",
47 .version = IDEDEFAULT_VERSION,
48 .attach = idedefault_attach,
49 .cleanup = ide_unregister_subdriver,
50 .drives = LIST_HEAD_INIT(idedefault_driver.drives)
53 static int idedefault_attach (ide_drive_t *drive)
55 if (ide_register_subdriver(drive, &idedefault_driver)) {
56 printk(KERN_ERR "ide-default: %s: Failed to register the "
57 "driver with ide.c\n", drive->name);
61 /* For the sake of the request layer, we must make sure we have a
62 * correct ready_stat value, that is 0 for ATAPI devices or we will
63 * fail any request like Power Management
65 if (drive->media != ide_disk)
66 drive->ready_stat = 0;
71 MODULE_DESCRIPTION("IDE Default Driver");
73 MODULE_LICENSE("GPL");