From owner-freebsd-hackers@FreeBSD.ORG Tue May 30 13:42:37 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 5B74916A4D2 for ; Tue, 30 May 2006 13:42:37 +0000 (UTC) (envelope-from fierykylin@gmail.com) Received: from wx-out-0102.google.com (wx-out-0102.google.com [66.249.82.205]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1A0A443D46 for ; Tue, 30 May 2006 13:42:36 +0000 (GMT) (envelope-from fierykylin@gmail.com) Received: by wx-out-0102.google.com with SMTP id i31so279590wxd for ; Tue, 30 May 2006 06:42:35 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=UIjdCF7pT9bYhq0H7S4+VJQGRcTrIarS0KI2jc00OeCmvyvkhQkfW4SrsN99SYL/eeH+tNCzS4ECAizsJA5pyhceQ20889HFhSrW9AuDVaVsSdm9JdC8K+fZUPWC2X1JtZ0lJq40ES3BAjsrcpW7CzU2uszHY9tLvZkKbVVCAF4= Received: by 10.70.68.2 with SMTP id q2mr3554139wxa; Tue, 30 May 2006 06:42:35 -0700 (PDT) Received: by 10.70.43.11 with HTTP; Tue, 30 May 2006 06:42:35 -0700 (PDT) Message-ID: <87ab37ab0605300642ja608c97s24836a317cdac24@mail.gmail.com> Date: Tue, 30 May 2006 21:42:35 +0800 From: "william wallace" Sender: fierykylin@gmail.com To: "freebsd-hackers@freebsd.org" , "Warner Losh" In-Reply-To: <87ab37ab0605280309s15a31cb4yc8a54be1af5472dd@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-2022-JP; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <87ab37ab0605210108w127a235bue281428f52bbc784@mail.gmail.com> <87ab37ab0605212328ue7c70fcu49c5fec8921ae229@mail.gmail.com> <20060522.005010.104089663.imp@bsdimp.com> <87ab37ab0605221816y6cca5387sc43fa1e1116f55cc@mail.gmail.com> <44729B81.8010909@samsco.org> <87ab37ab0605240048g224218a5s87cfe1b1ed5cc8c9@mail.gmail.com> <20060524075946.GE49081@funkthat.com> <87ab37ab0605240613n594c566q844b754043c2c10@mail.gmail.com> <20060524153153.GF49081@funkthat.com> <87ab37ab0605280309s15a31cb4yc8a54be1af5472dd@mail.gmail.com> X-Google-Sender-Auth: 68196bb1f7f0b424 Cc: "Sy, Dely L" , Scott Long Subject: Re: misc questions about the device&driver arch X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 May 2006 13:42:42 -0000 Sir: I have got the way to map linux pci access way to the BSD way :) now ,several more question ,wondering :( FIRST struct pci_devinfo * pci_read_device(device_t pcib, int b, int s, int f, size_t size) struct cardbus_devinfo { struct pci_devinfo pci; uint8_t mprefetchable; /* bit mask of prefetchable BARs */ so what happen when dinfo = (struct cardbus_devinfo *)pci_read_device(brdev, bus, slot, func, sizeof(struct cardbus_devinfo)); can we use this magic as a common way to wrap common guts? SECOND what should we do to destroy a device and hot remove it from the system ? 1 pause the application 2 device_detach(devlist[tmp]); 3***_release_all_resources(busdev, dinfo); 4 device_delete_child(busdev, devlist[tmp]); 5 pci_freecfg((struct pci_devinfo *)dinfo); 6 shutdown power of the slot so what exactly happens between 2 and 5? THIRD Because the PCIE configure space is 4k long ,shall we change the #define PCI_REGMAX 255 to facilitate the PCI express config R/W?