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>
27 #include <asm/byteorder.h>
29 #include <asm/uaccess.h>
31 #include <asm/unaligned.h>
32 #include <asm/bitops.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 .drives = LIST_HEAD_INIT(idedefault_driver.drives)
52 static int idedefault_attach (ide_drive_t *drive)
54 if (ide_register_subdriver(drive, &idedefault_driver)) {
55 printk(KERN_ERR "ide-default: %s: Failed to register the "
56 "driver with ide.c\n", drive->name);
60 /* For the sake of the request layer, we must make sure we have a
61 * correct ready_stat value, that is 0 for ATAPI devices or we will
62 * fail any request like Power Management
64 if (drive->media != ide_disk)
65 drive->ready_stat = 0;
70 MODULE_DESCRIPTION("IDE Default Driver");
72 MODULE_LICENSE("GPL");