Subject: Re: kern/22869: Slave IDE drive not detected
To: None <cube@cubidou.net>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: tech-kern
Date: 09/22/2003 14:30:29
On Mon, Sep 22, 2003 at 02:03:08PM +0200, cube@cubidou.net wrote:
> Correct me if I'm wrong, but my reading of the ATAng code in FreeBSD is
> that it only performs registers IO.
> 
> (src/sys/dev/ata/ata-lowlevel.c)
> 
> Here's what the core loop does:
> 
> For each drive:
>   select drive
>   read wd_error, wd_cyl_{lo,hi}, wd_status
>   if !(wd_status & WDCS_BSY)
>     if wd_error == WDCE_AMNF
>       /* drive found, additional test of wd_cyl_{lo,hi} with
>        * magic values to detect an ATAPI device */
>     else if (wd_status & (WDCS_DRDY | WDCS_CORR | WDCS_IDX | WDCS_ERR))
>             && wd_cyl_lo == wd_error && wd_cyl_hi == wd_error
>       /* continue looping for that drive */
>     else
>       /* stop looping, no device here */
> 
> Apparently, status register might be different whether a device is here
> or not.

Where is this exactly in ata-lowlevel.c ?

--
Manuel Bouyer, LIP6, Universite Paris VI.           Manuel.Bouyer@lip6.fr
     NetBSD: 24 ans d'experience feront toujours la difference
--