From owner-freebsd-drivers@FreeBSD.ORG Tue Oct 18 08:27:01 2005 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A6F8116A420 for ; Tue, 18 Oct 2005 08:27:01 +0000 (GMT) (envelope-from mayong@mail.com) Received: from cal1-1.us4.outblaze.com (cal1-1.us4.outblaze.com [205.158.62.188]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5CD8943D75 for ; Tue, 18 Oct 2005 08:26:56 +0000 (GMT) (envelope-from mayong@mail.com) Received: (from mdrop@localhost) by cal1-1.us4.outblaze.com (8.11.6/8.11.6) id j9I8Quw26871; Tue, 18 Oct 2005 08:26:56 GMT Message-Id: <200510180826.j9I8Quw26871@cal1-1.us4.outblaze.com> Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 From: "Yong Ma" To: freebsd-drivers@freebsd.org Date: Tue, 18 Oct 2005 03:26:56 -0500 Received: from [159.226.5.225] by cal1-1.us4.outblaze.com with http for mayong@mail.com; Tue, 18 Oct 2005 03:26:56 -0500 X-Originating-Ip: 159.226.5.225 X-Originating-Server: cal1-1.us4.outblaze.com Subject: Some Questions X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2005 08:27:01 -0000 Hi everybody: =20 I'm new here,nice to meet you all! I'm also aFreeBSD_device_driver newbie, = and now I'm enaged in writting a driverfor a cryptographic accelerator card= .As a preparation I read thesections of device driver in "FreeBSD Architect= ure Handbook",andexercised the example driver in the book.now I have severa= l questions(maybeeasy for you but most useful for me): 1)Some drivers declares the device_open() as int device_open(dev_t dev,...)= ,and some declare it as int device_open(struct cdev *dev,...),sometimes the first one couldn't be compliedsuccessfully,what's t= he difference? 2) if (pci_get_vendor(dev) =3D=3D 0x11c1) { ... ~~~~~~~~how to get this number if I don't kno= w it? 3)Could the device on PCI slot be listed by /pciconf -l /without driver. 4)The printf() seems not work under XWindow mode in functions like deviec_p= rob or device_attach,how to make it work? 5)If only the pseudo-device in /dev can be destroyed with destroy_dev(sc->d= ev0) in detach() function in a KLD driver? I can't do that! Thanks=20 Ma --=20 ___________________________________________________ Play 100s of games for FREE! http://games.mail.com/