Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Aug 2003 02:00:24 +0200
From:      Dan Lukes <dan@obluda.cz>
To:        Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Bug FreeBSD 4.8 ATA driver
Message-ID:  <3F4E9798.7020006@obluda.cz>
In-Reply-To: <Pine.LNX.4.44.0308271545120.22196-100000@artax.karlin.mff.cuni.cz>
References:  <Pine.LNX.4.44.0308271545120.22196-100000@artax.karlin.mff.cuni.cz>

next in thread | previous in thread | raw e-mail | index | archive | help
Mikulas Patocka wrote:

>>>I am reading FreeBSD ATA drivers because I want to use them as base for my
>>>ATA driver and I found a total nonsence: in ata-dma.c in FreeBSD 4.8,
>>>there is line
>>>
>>>if (!((pci_read_config(parent,0x40,4)>>(ch->unit<<8))&0x4000)) {

>>	Hm, it should be (IMHO)
>>if (!((pci_read_config(parent,0x40,4)>>(ch->unit<<5))&0x4000))
> 
> 
> That is incorrect too --- if ch->unit is 1, ch->unit<<5 is 32 and you
> can't shift 32-bit integer by 32 bits.

	My mistake. Configuration double-word at offset 64 (decimal) contain 
two word - one per unit. So, correct access to each word is
if (!((pci_read_config(parent,0x40,4)>>(ch->unit<<4))&0x4000))

	My theory about source of error ('8' key just above '5') is void, of 
course.

>>	A smel bych, uz asi mimo konferenci, vedet, proc si pises vlastni ATA
>>ovladac ?

> No, zatim to neni moc verejny projekt.

	OK. Ja jen, ze se pred nekolika malo lety na MFF obhajoval projekt OS 
kde take meli vlastni ATA ovladace (a psal jsem je do znacne miry ja) - 
tak me jen tak napadlo, ze uz se zase pise nejaky podobny projekt nebo 
diplomka.


					Sincerely

							Dan




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3F4E9798.7020006>