Resources and ACPI

Alan Garfield alan at fromorbit.com
Wed Apr 11 09:05:38 UTC 2007


Hi all,

When you have say :-

----
static int
jnet_probe(device_t
dev)                                                                                                            
{       
        static char *jnet_ids[] = { "NWS8001",
NULL };                                                                              

        if (acpi_disabled("jnet")
||                                                                                                
                        ACPI_ID_PROBE(device_get_parent(dev), dev,
jnet_ids) == NULL)                                               
                return (ENXIO); 
        
        // Woo we found it, set the description s we know what we
are.                                                              
        device_set_desc(dev, "JNet Ethernet System
Interface");                                                                     
        return (BUS_PROBE_DEFAULT);
}       
----

and when the device is kldload'ed you get :-

----
jnet0: <JNet Ethernet System Interface> port 0xa8,0xae-0xaf irq 19 on
acpi0
----

are these resources automagically allocated for me? Or do I have to
allocate them myself?

I've got my driver mostly working but at the moment I've hard-coded in
the resources and I'm thinking this isn't correct given the acpi bus
knows what resources I'm expecting and lists them helpfully in the dmesg
output.

If the resources are allocated how do I access/see them?

I've been all through device_t and bus.h this and acpi.h that, and I
cannot find a good example of getting resources from the acpi bus.

Any help would be appreciated!

Thanks,
Alan.




More information about the freebsd-hackers mailing list