Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 09 Dec 2001 09:35:58 +1030
From:      David Rowe <david@voicetronix.com.au>
To:        Brooks Davis <brooks@one-eyed-alien.net>, hackers@freebsd.org
Subject:   Re: Newbie: Driver for PLX9050
Message-ID:  <3C129CD6.32663F24@voicetronix.com.au>
References:  <3C11C69B.F2898B1D@voicetronix.com.au> <20011208132933.A6980@Odin.AC.HMC.Edu> <3C128D82.CBF9DFB3@voicetronix.com.au> <20011208140528.A16554@Odin.AC.HMC.Edu>

next in thread | previous in thread | raw e-mail | index | archive | help
> No, you can claim PCI devices after boot.  It works fine.  Stick some
> printfs in your probe code to be sure it's being called correctly and
> what it's being called on.
> 

OK - this is my probe function:

static int
mypci_probe(device_t dev)
{
  uprintf("MyPCI Probe\n"
          "Vendor ID : 0x%x\n"
          "Device ID : 0x%x\n",pci_get_vendor(dev),pci_get_device(dev));
 
  return ENXIO;
}

OK - here is what happens:

su-2.05# kldload -v ./mypci.ko
MyPCI Probe
Vendor ID : 0x15e2
Device ID : 0x500
MyPCI Probe
Vendor ID : 0x5333
Device ID : 0x5631
Loaded ./mypci.ko, id=7

Note: - none of these are my PLX chip (vender ID 0x9050) which has
already been assigned to the chip2 device, for example here is the
output of pciconf -l:

su-2.05# pciconf -l
chip0@pci0:0:0: class=0x060000 card=0x00000000 chip=0x71008086 rev=0x01
hdr=0x00
isab0@pci0:7:0: class=0x060100 card=0x00000000 chip=0x71108086 rev=0x01
hdr=0x00
atapci0@pci0:7:1:       class=0x010180 card=0x00000000 chip=0x71118086
rev=0x01 hdr=0x00
uhci0@pci0:7:2: class=0x0c0300 card=0x00000000 chip=0x71128086 rev=0x01
hdr=0x00
chip1@pci0:7:3: class=0x068000 card=0x00000000 chip=0x71138086 rev=0x01
hdr=0x00
none0@pci0:9:0: class=0x040100 card=0x00000000 chip=0x050015e2 rev=0x00
hdr=0x00
chip2@pci0:10:0: class=0x068000 card=0x56345654 chip=0x905010b5 rev=0x02
hdr=0x00
none1@pci0:11:0: class=0x030000 card=0x00000000 chip=0x56315333 rev=0x06
hdr=0x00
ed0@pci0:12:0:  class=0x020000 card=0x802910ec chip=0x802910ec rev=0x00
hdr=0x00

As far as I can see - it is _only_ the PCI devices without drivers that
are presented to mypci_probe.  As my device has already been assigned to
the chip2 driver, it is not presented to the probe function.

Is there any way to probe those devices that already have drivers?
Is it possible to replace an exixiting driver (e.g. chip2) with my
driver?

Thanks,

David

> -- Brooks
> 
> --
> Any statement of the form "X is the one, true Y" is FALSE.
> PGP fingerprint 655D 519C 26A7 82E7 2529  9BF0 5D8E 8BE9 F238 1AD4
> 
>   ------------------------------------------------------------------------
>    Part 1.2Type: application/pgp-signature

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3C129CD6.32663F24>