Subject: Re: kern/22869: Slave IDE drive not detected
To: Manuel Bouyer <bouyer@antioche.lip6.fr>
From: None <cube@cubidou.net>
List: tech-kern
Date: 09/22/2003 14:36:29
On Mon, Sep 22, 2003 at 02:30:29PM +0200, Manuel Bouyer wrote:
> 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 ?
In ata_reset(), which is also called for probing.
Quentin Garnier.