From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 27 05:51:49 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 A240116A402 for ; Thu, 27 Apr 2006 05:51:49 +0000 (UTC) (envelope-from darren.pilgrim@bitfreak.org) Received: from mail.bitfreak.org (mail.bitfreak.org [65.75.198.146]) by mx1.FreeBSD.org (Postfix) with ESMTP id 48A0743D49 for ; Thu, 27 Apr 2006 05:51:49 +0000 (GMT) (envelope-from darren.pilgrim@bitfreak.org) Received: from [127.0.0.1] (mail.bitfreak.org [65.75.198.146]) by mail.bitfreak.org (Postfix) with ESMTP id 5D1FE19F2C; Wed, 26 Apr 2006 22:51:48 -0700 (PDT) Message-ID: <44505BF1.80806@bitfreak.org> Date: Wed, 26 Apr 2006 22:51:45 -0700 From: Darren Pilgrim User-Agent: Thunderbird 1.5.0.2 (Windows/20060308) MIME-Version: 1.0 To: hongz@promisechina.com References: <1146110516$75164$50215385@hongz@promisechina.com> In-Reply-To: <1146110516$75164$50215385@hongz@promisechina.com> Content-Type: multipart/mixed; boundary="------------000201020006050802060608" Cc: freebsd-hackers@freebsd.org Subject: Re: Can kldload trigger pci bus rescan? 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: Thu, 27 Apr 2006 05:51:49 -0000 This is a multi-part message in MIME format. --------------000201020006050802060608 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit hongz@promisechina.com wrote: > Hi guys: > > My situation is: > (1) We are porting our HBA driver (Promise FastTrak TX4310 SoftRaid5) from > Linux to FreeBSD(6.0). Our HBA driver can work normally under Linux. > (2) At this time, I just wrote a sample driver code (see sr5.c in the > attached file) to check the driver's probe function in FreeBSD. > (3) After I successfully compiled the codes, I run "make load" (see Makefile > and load.info in the attached file) for testing. > (4) Our probe function was called indeed, but no matching pci device was > found! (Yes, I have plugged our HBA card in the system). > (5) Our HBA card information can be found by running pciconf (see > pciconf.info in the attached file). The only two storage devices in the pciconf output are: atapci0@pci0:7:1: class=0x01018a card=0x74411022 chip=0x74411022 rev=0x04 hdr=0x00 vendor = 'Advanced Micro Devices (AMD)' device = 'AMD-768 EIDE Controller' class = mass storage subclass = ATA atapci1@pci2:4:0: class=0x010400 card=0x3515105a chip=0x3515105a rev=0x02 hdr=0x00 vendor = 'Promise Technology Inc' class = mass storage subclass = RAID The first looks like the ATA controller on the motherboard. The second is your Promise ATA RAID card. Both devices are already attached by FreeBSD's ATA framework. You will need to patch FreeBSD's ATA framework to not detect your card. The attached patch should do the trick (it removes the corresponding PCI ID for your card). I tested the patch to the point that it compiles, but I can't guarantee this will prevent the attach or even result in a bootable kernel, so test carefully. To apply the patch, do the following with root privileges: cd /usr/src # Replace /usr/src with the base of your src tree. patch