1 Index: linux-2.6.13/drivers/ide/ide-probe.c
2 ===================================================================
3 --- linux-2.6.13.orig/drivers/ide/ide-probe.c 2005-08-29 00:41:01.000000000 +0100
4 +++ linux-2.6.13/drivers/ide/ide-probe.c 2005-09-21 20:57:34.000000000 +0100
9 - * drive_is_flashcard - check for compact flash
10 - * @drive: drive to check
12 - * CompactFlash cards and their brethern pretend to be removable
13 - * hard disks, except:
14 - * (1) they never have a slave unit, and
15 - * (2) they don't have doorlock mechanisms.
16 - * This test catches them, and is invoked elsewhere when setting
17 - * appropriate config bits.
19 - * FIXME: This treatment is probably applicable for *all* PCMCIA (PC CARD)
20 - * devices, so in linux 2.3.x we should change this to just treat all
21 - * PCMCIA drives this way, and get rid of the model-name tests below
22 - * (too big of an interface change for 2.4.x).
23 - * At that time, we might also consider parameterizing the timeouts and
24 - * retries, since these are MUCH faster than mechanical drives. -M.Lord
27 -static inline int drive_is_flashcard (ide_drive_t *drive)
29 - struct hd_driveid *id = drive->id;
31 - if (drive->removable) {
32 - if (id->config == 0x848a) return 1; /* CompactFlash */
33 - if (!strncmp(id->model, "KODAK ATA_FLASH", 15) /* Kodak */
34 - || !strncmp(id->model, "Hitachi CV", 10) /* Hitachi */
35 - || !strncmp(id->model, "SunDisk SDCFB", 13) /* old SanDisk */
36 - || !strncmp(id->model, "SanDisk SDCFB", 13) /* SanDisk */
37 - || !strncmp(id->model, "HAGIWARA HPC", 12) /* Hagiwara */
38 - || !strncmp(id->model, "LEXAR ATA_FLASH", 15) /* Lexar */
39 - || !strncmp(id->model, "ATA_FLASH", 9)) /* Simple Tech */
41 - return 1; /* yes, it is a flash memory card */
44 - return 0; /* no, it is not a flash memory card */
48 * do_identify - identify a drive
49 * @drive: drive to identify
53 * Not an ATAPI device: looks like a "regular" hard disk
55 - if (id->config & (1<<7))
56 - drive->removable = 1;
58 - if (drive_is_flashcard(drive))
59 - drive->is_flash = 1;
61 + * 0x848a = CompactFlash device
62 + * These are *not* removable in Linux definition of the term
65 + if ((id->config != 0x848a) && (id->config & (1<<7)))
66 + drive->removable = 1;
68 drive->media = ide_disk;
69 - printk("%s DISK drive\n", (drive->is_flash) ? "CFA" : "ATA" );
70 + printk("%s DISK drive\n", (id->config == 0x848a) ? "CFA" : "ATA" );
74 Index: linux-2.6.13/drivers/ide/ide.c
75 ===================================================================
76 --- linux-2.6.13.orig/drivers/ide/ide.c 2005-09-19 10:53:59.000000000 +0100
77 +++ linux-2.6.13/drivers/ide/ide.c 2005-09-21 20:52:53.000000000 +0100
79 drive->name[2] = 'a' + (index * MAX_DRIVES) + unit;
80 drive->max_failures = IDE_DEFAULT_MAX_FAILURES;
82 - drive->is_flash = 0;
84 INIT_LIST_HEAD(&drive->list);
85 sema_init(&drive->gendev_rel_sem, 0);
86 Index: linux-2.6.13/drivers/ide/ide-disk.c
87 ===================================================================
88 --- linux-2.6.13.orig/drivers/ide/ide-disk.c 2005-09-19 10:53:59.000000000 +0100
89 +++ linux-2.6.13/drivers/ide/ide-disk.c 2005-09-21 20:51:31.000000000 +0100
91 if (drive->id_read == 0)
95 - * CompactFlash cards and their brethern look just like hard drives
96 - * to us, but they are removable and don't have a doorlock mechanism.
98 - if (drive->removable && !(drive->is_flash)) {
99 + if (drive->removable) {
101 * Removable disks (eg. SYQUEST); ignore 'WD' drives
103 Index: linux-2.6.13/include/linux/ide.h
104 ===================================================================
105 --- linux-2.6.13.orig/include/linux/ide.h 2005-08-29 00:41:01.000000000 +0100
106 +++ linux-2.6.13/include/linux/ide.h 2005-09-21 20:56:29.000000000 +0100
108 unsigned noprobe : 1; /* from: hdx=noprobe */
109 unsigned removable : 1; /* 1 if need to do check_media_change */
110 unsigned attach : 1; /* needed for removable devices */
111 - unsigned is_flash : 1; /* 1 if probed as flash */
112 unsigned forced_geom : 1; /* 1 if hdx=c,h,s was given at boot */
113 unsigned no_unmask : 1; /* disallow setting unmask bit */
114 unsigned no_io_32bit : 1; /* disallow enabling 32bit I/O */