]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/linux/handhelds-pxa-2.6/ide_not_removable-r0.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / linux / handhelds-pxa-2.6 / ide_not_removable-r0.patch
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
5 @@ -125,45 +125,6 @@
6  }
7  
8  /**
9 - *     drive_is_flashcard      -       check for compact flash
10 - *     @drive: drive to check
11 - *
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.
18 - *
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
25 - */
26
27 -static inline int drive_is_flashcard (ide_drive_t *drive)
28 -{
29 -       struct hd_driveid *id = drive->id;
30 -
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 */
40 -               {
41 -                       return 1;       /* yes, it is a flash memory card */
42 -               }
43 -       }
44 -       return 0;       /* no, it is not a flash memory card */
45 -}
46 -
47 -/**
48   *     do_identify     -       identify a drive
49   *     @drive: drive to identify 
50   *     @cmd: command used
51 @@ -278,13 +239,17 @@
52         /*
53          * Not an ATAPI device: looks like a "regular" hard disk
54          */
55 -       if (id->config & (1<<7))
56 -               drive->removable = 1;
57  
58 -       if (drive_is_flashcard(drive))
59 -               drive->is_flash = 1;
60 +       /* 
61 +        * 0x848a = CompactFlash device 
62 +        * These are *not* removable in Linux definition of the term
63 +        */
64 +
65 +       if ((id->config != 0x848a) && (id->config & (1<<7)))
66 +               drive->removable = 1;
67 +       
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" );
71         QUIRK_LIST(drive);
72         return;
73  
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
78 @@ -242,7 +242,6 @@
79                 drive->name[2]                  = 'a' + (index * MAX_DRIVES) + unit;
80                 drive->max_failures             = IDE_DEFAULT_MAX_FAILURES;
81                 drive->using_dma                = 0;
82 -               drive->is_flash                 = 0;
83                 drive->vdma                     = 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
90 @@ -895,11 +895,7 @@
91         if (drive->id_read == 0)
92                 return;
93  
94 -       /*
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.
97 -        */
98 -       if (drive->removable && !(drive->is_flash)) {
99 +       if (drive->removable) {
100                 /*
101                  * Removable disks (eg. SYQUEST); ignore 'WD' drives 
102                  */
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
107 @@ -697,7 +697,6 @@
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 */