From: sumalatha Date: Wed, 20 Sep 2006 12:32:36 +0000 Subject: Re: PCI hotplug question: drivers Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: linux-hotplug@vger.kernel.org Greg KH kroah.com> writes: >=20 > On Tue, Sep 19, 2006 at 05:22:47AM +0000, sumalatha wrote: > > Hi Greg, > > =20 >=20 > Ick, no. Please read Documentation/pci.txt, a very old document that > tells you not to use this style for pci drivers. Please us > pci_register_driver() instead. >=20 > If you do that, your driver will work properly with any pci hotplug > driver. >=20 Exactly I did the same for linux driver,but when translating to RTLinux = driver I was confused with the probe() to access my 4 pci cards of 2 diffe= rent types which have same vendorid and deviceid.(2 cards of same type are having same subdeviceid and subvendorid) and implemented 2.4 card detection functi= ons. According to your suggestion I implemented probe() and checked hotswap. After hotswap ,device is detected (from user space fd value returned is 3) = plx is working fine ,i mean i am able to read hotswap status from 0x48 address = (from pci cinfig registers).it came correctly,but local bus offsets are not working.when ever i read i am getting 0xffff always.i think problem from lo= cal bus side.=20 what may be the mistake i did ? Also using my probe only one card driver is registered.how to do for the other card. here is my few lines of code....... static struct pci_device_id dio_id_table[] __devinitdata =3D { {0xAAAA,0xBBBB,0xCCCC,0xDDDD, 0, 0, 0 }, //SAME TYPE OF CARDS {0xAAAA,0xBBBB,0xCCCC,0xDDDD, 0, 0, 0 }, {0,}, }; static int __devinit mycard_init_one(struct pci_dev *pdev,const struct pci_device_id *ids) { static int i=3D0; unsigned char pci_bus, pci_device_fn; printk("\nprobe"); pci_enable_device(pdev); pci_bus =3D pdev->bus->number; pci_device_fn =3D pdev->devfn; pio_start[i] =3D pci_resource_start(pdev, 2); printf("\nBusnumber =3D %x",pci_bus); printf("\nDevfn =3D %x",pci_device_fn); printf("\nBAR2 ADDR =3D %x",pio_start[i]); if(i =3D 0) { if ( rtl_register_dev( "/dev/dev_0", &dio_fops, 0 ) ) { printf("Unable to register /dev_0\n"); rtl_unregister_dev("/dev/dev_0"); //return -EIO; } } if(i =3D 1) { if ( rtl_register_dev( "/dev/dev_1", &dio_fops, 1 ) ) { printf("Unable to register /dev_1\n"); rtl_unregister_dev("/dev/dev_1"); //return -EIO; } } i++; return 0; } =20 static int __devexit mycard_remove_one(struct pci_dev *pdev) { pci_set_drvdata(pdev,NULL); return 0; } module_init() { ret =3D pci_module_init(&dio_pci_rtl_driver); printk("\nmain ret =3D %d ",ret); if (ret !=3D 0) return (-1); return 0; } cleanup_module() { rtl_unregister_dev("/dev/dev_0"); rtl_unregister_dev("/dev/dev_1"); pci_unregister_driver(&pci_rtl_driver); return SUCCESS; thanks and regards, sumalatha. =20 >=20 >=20 > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share y= our > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=DE= VDEV >=20 ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=DEVD= EV _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel