Garrett D'Amore wrote:
> Christian Kaiser wrote:
>> Hi all,
>>
>> I am currently porting a driver from Linux to Solaris.
>>
>> The BAR description in the PCI config space looks like this:
>>
>> BAR0, Offset 0x10, Value 0xcbdc0000
>> BAR1, Offset 0x14, Value 0x00000000
>> BAR2, Offset 0x18, Value 0xc4000000
>> BAR3, Offset 0x1c, Value 0xc0000000
>> BAR4, Offset 0x20, Value 0xbc000000
>> BAR5, Offset 0x24, Value 0xb8000000
>>
>> ddi_dev_nregs returns 6 register sets what is correct but for 
>> ddi_dev_regsize I don't get the zero size value for BAR1 (which would 
>> be correct) but the size of BAR2. I get an error running 
>> ddi_dev_regsize with rnumber=6. It seems that Solaris renumbers the 
>> register sets in my special case where one BAR1 value is 0x0 and the 
>> size is 0. The same applies to ddi_regs_map_setup.
>>
>> Is my assumption concerning the renumbering correct? Isn't that 
>> confusing?
>>
>> Regards,
>> Christian
>>
>>   
> For PCI devices, the starting index is 1, not 0.  (0 is reserved to 
> indicate PCI configuration space.)

And I am aware of this.

> I don't know why with rnumber 6 you get an error -- that's surprising.  
> I'd have expected rnumber 6 to return the settings for BAR5 above.

OK, let me clarify this:

BAR layout
==========

BAR 0  Offset 0x10  Value 0xcbdc0000  Size 256K
BAR 1  Offset 0x14  Value 0x00000000  Size    0
BAR 2  Offset 0x18  Value 0xc4000000  Size  64M
BAR 3  Offset 0x1c  Value 0xc0000000  Size  64M
BAR 4  Offset 0x20  Value 0xbc000000  Size  64M
BAR 5  Offset 0x24  Value 0xb8000000  Size  64M

Using ddi_dev_regsize()
=======================

rnumber=1  Size 256K
rnumber=2  Size  64M
rnumber=3  Size  64M
rnumber=4  Size  64M
rnumber=5  Size  64M
rnumber=6  n/a (error)

Do you understand now what I meant by "renumbering"?

Christian

-- 
Christian Kaiser, Software Engineer, Dolphin Interconnect Solutions
http//www.dolphinics.com
_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to