This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problem with IDE disk


On Tue, 2005-02-08 at 11:10 +0100, Andrew Lunn wrote:
> On Wed, Feb 02, 2005 at 01:35:40PM +0100, knud.woehler@microplex.de wrote:
> > Hello
> > the attached patch corrects two problems with the ide_disk driver.
> > 
> > 1. The check for hard disks does not work. The line
> > "if (((ide_idData->general_conf>>8)&0x1f)!=2) " returns true with my 
> > hard disk. (ide_idData->general_conf = 0x0040)
> 
> I've not commited this part. I would like to understand this
> better. Maybe somebody can spend some time looking at the standard and
> work out what is correct.
>  
That bit (the original code) looks wrong. It looks similar to a test
in my original IDE code in redboot/current/src/fs/ide.c where I check
to see if the device is a CDROM. The thing is, that test is on the
results of an Identify Packet Device command (0xA1), not the results
of an Identify Device command (0xEC).

The original code assumes that if the Identify Device command succeeds,
then its a non-packet HDD. If the Identify Device command fails, then
an Identify Packet Device is used to see if its a CDROM. That test
looks like:

    if (((u16 >> 8) & 0x1f) != 5) {

where u16 holds the general config word from the Identify Packet Device
command. A value of 5 indicates a CD-ROM device. The value of 2 used in
the devs/disk/ide code indicates a printer device _if_ the test was
against the Identify Packet Device command. Its not, so that test of the
general config word of an Identify Device command response is checking
some obsolete bits.

Bottom line is that I don't think we need that check in its current
form.

--Mark


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]