From owner-freebsd-hackers Sun Aug 23 18:06:15 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA16408 for freebsd-hackers-outgoing; Sun, 23 Aug 1998 18:06:15 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from picnic.mat.net (picnic.mat.net [209.118.174.117]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA16337 for ; Sun, 23 Aug 1998 18:06:02 -0700 (PDT) (envelope-from chuckr@glue.umd.edu) Received: from localhost (chuckr@localhost) by picnic.mat.net (8.9.1/8.8.5) with SMTP id UAA11357; Sun, 23 Aug 1998 20:03:38 -0400 (EDT) Date: Sun, 23 Aug 1998 20:03:38 -0400 (EDT) From: Chuck Robey X-Sender: chuckr@picnic.mat.net To: Mark turpin cc: FreeBSD hackers Subject: Re: PCI Device driver question In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sun, 23 Aug 1998, Mark turpin wrote: > Hello, > > This is my first attempt at writing a device driver.. I read most > of the other drivers in the pci directory before starting and thought I > knew what I was doing... Well, obviously I didn't :) So, I need your > help.. All I want to do right now is make it show that it actually found > the device on the startup list. > > Please help > Thanks > > Mark Turpin > I am looking at the example I've chosen, cy_pci.c, and the pci code figures out what to probe via linker sets, but I don't see the line in your code below that corresponds to the line 62 of cy_pci.c, as I show below: DATA_SET(pcidevice_set, cy_device); I think maybe you might be missing this line, so the pci code never probes your device. If I'm wrong, I'll be watching with interest for someone to correct me. > > I added the following line to files > > pci/if_rtk.c rtk device-driver > > and to GENERIC in i386/conf > > device rtk0 > > and here is my wonderful code.... > > > #include "pci.h" > #if NPCI > 0 > > #include > #include > #include > #include > #include > #include > > #include "rtk.h" > > static char* rtk_pci_probe __P((pcici_t, pcidi_t)); > static void rtk_pci_attach __P((pcici_t config_id, int unit)); > > static u_long rtk_pci_count = NRTK; > > static struct pci_device rtk_pci_driver = { > "rtk", > rtk_pci_probe, > rtk_pci_attach, > &rtk_pci_count, > NULL > }; > > static char* > rtk_pci_probe (config_id, device_id) > pcici_t config_id; > pcidi_t device_id; > { > if (device_id && 0x813910ec) > return ("RealTek 8139 10/100Mbps Ethernet"); > > return NULL; > } > > static void > rtk_pci_attach (config_id, unit) > pcici_t config_id; > int unit; > { > > /* Attach stuff goes here */ > return; > > } > #endif /* NPCI > 0 */ > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > > ----------------------------+----------------------------------------------- Chuck Robey | Interests include any kind of voice or data chuckr@glue.umd.edu | communications topic, C programming, and Unix. 213 Lakeside Drive Apt T-1 | Greenbelt, MD 20770 | I run Journey2 and picnic (FreeBSD-current) (301) 220-2114 | and jaunt (NetBSD). ----------------------------+----------------------------------------------- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message