From owner-freebsd-hackers@FreeBSD.ORG Tue Mar 16 20:11:01 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B371316A4CE for ; Tue, 16 Mar 2004 20:11:01 -0800 (PST) Received: from ms-smtp-01-eri0.southeast.rr.com (ms-smtp-01-lbl.southeast.rr.com [24.25.9.100]) by mx1.FreeBSD.org (Postfix) with ESMTP id 37DC243D1F for ; Tue, 16 Mar 2004 20:11:01 -0800 (PST) (envelope-from jason@ec.rr.com) Received: from ec.rr.com (cpe-024-211-231-149.ec.rr.com [24.211.231.149]) i2H4AwSm009297 for ; Tue, 16 Mar 2004 23:10:58 -0500 (EST) Message-ID: <4057D02E.8020701@ec.rr.com> Date: Tue, 16 Mar 2004 23:12:30 -0500 From: Jason User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.6b) Gecko/20040210 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Symantec AntiVirus Scan Engine Subject: agp device drivers X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Mar 2004 04:11:01 -0000 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: 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: at device 0.1 (no driver attached) pci0: at device 0.2 (no driver attached) pci0: at device 0.3 (no driver attached) pci0: at device 0.4 (no driver attached) pci0: at device 0.5 (no driver attached) pcib2: 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