Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Mar 2004 23:12:30 -0500
From:      Jason <jason@ec.rr.com>
To:        freebsd-hackers@freebsd.org
Subject:   agp device drivers
Message-ID:  <4057D02E.8020701@ec.rr.com>

next in thread | raw e-mail | index | archive | help
I am working on learning to write device drivers mainly because I have 
no 3d on my system.  After ready the handbooks and lots of source code I 
have a question about the current driver I am trying to work on.  Here 
is a sample that I have a question about:

struct agp_nvidia_softc {
    struct agp_softc    agp;
    u_int32_t        initial_aperture; /* aperture size at startup */
    struct agp_gatt *    gatt;

    device_t        dev;        /* AGP Controller */
    device_t        mc1_dev;    /* Memory Controller */
    device_t        mc2_dev;    /* Memory Controller */
    device_t        bdev;        /* Bridge */

As in a standard driver there is a probe, attach, and detach, but only 
for dev the agp controller.  The other 3 devices do not have these 
functions.  Here is the dmesg for each device:


Preloaded elf module "/boot/kernel/agp.ko" at 0xc07ba21c.
agp0: <NVIDIA nForce2 AGP Controller> mem 0xd0000000-0xd7ffffff at 
device 0.0 on pci0

Windows has drivers for these, but the linux source from nvidia does not 
mention the 3 memory controllers.
pci0: <memory, RAM> at device 0.1 (no driver attached)
pci0: <memory, RAM> at device 0.2 (no driver attached)
pci0: <memory, RAM> at device 0.3 (no driver attached)
pci0: <memory, RAM> at device 0.4 (no driver attached)
pci0: <memory, RAM> at device 0.5 (no driver attached)

pcib2: <PCI-PCI bridge> at device 30.0 on pci0
$PIR: 0:30 INTA routed to irq 11   (not sure if this is related to the 
bdev or not)

As you can see there seems to be no drivers for anything but the one agp 
controller.  It seems to me that this would be caused by the absence of 
the attach, probe, detach.  I would start slapping this stuff in the 
source as just another device, but its not just some pci device, or is 
it?  Since this is an agp driver is there a special way to add these, or 
should I just follow the example in the handbook for pci devices?

Thanks for any input,
Jason



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4057D02E.8020701>