From mboxrd@z Thu Jan 1 00:00:00 1970 From: sumalatha Date: Tue, 26 Sep 2006 08:52:14 +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 > If you have rtlinux issues, I suggest you ask on a rtlinux specific > mailing list, as I do not know anything about it. >=20 Hello Greg, I am facing the same problem with linux driver too.Forget about RTLinux.Regarding linux where may be the mistake in my code below. why loca= l bus offsets are giving 0xffff always after hot swap? static struct pci_device_id my_id_table[] __devinitdata =3D { {0xAAAA,0xBBBB,0xCCCC,0xDDDD, 0, 0, 0 }, {0xAAAA,0xBBBB,0xCCCC,0xDDDD, 0, 0, 0 }, {0,}, }; MODULE_DEVICE_TABLE(pci, my_id_table); static int __devinit my_init_one (struct pci_dev *, const struct pci_devi= ce_id *); static int __devexit my_remove_one (struct pci_dev *); static struct pci_driver my_pci_driver =3D { name: DRV_NAME, id_table: my_id_table, probe: my_init_one, remove: __devexit_p(my_remove_one)=20 }; static int __devinit my_init_one(struct pci_dev *pdev,const struct pci_device_id *my_id_table) { unsigned char pci_bus, pci_device_fn; int flag =3D -1,result =3D 0,ret =3D 0; printf("my_init_one invoked!\n"); =20 /* initialize device structures */ for(pciCnt =3D 0; pciCnt < MAX_DEV; pciCnt++) devCtrl[pciCnt]=3D0; /* Initialize PCI controller*/=20 devCtrl[i] =3D pdev; if(pci_enable_device(devCtrl[i]) < 0) { printf("\nnot enabled"); ret =3D -EBUSY; } pci_bus =3D devCtrl[i]->bus->number; pci_device_fn =3D devCtrl[i]->devfn; pio_start[i] =3D pci_resource_start(devCtrl[i], 2); len[i] =3D pci_resource_len(devCtrl[i], 2); printf("\nBusnumber =3D %x",pci_bus); printf("\nDevfn =3D %x",pci_device_fn); printf("\nBAR2 ADDR =3D %x",pio_start[i]); =20 if((pci_request_regions(pdev,DRV_NAME))) { ret =3D -ENOMEM; // goto mem_err_out; } if(i =3D 0) { if(register_chrdev(---, "mydev_0", &my_fops)) { ret =3D -EIO; // goto register_err_out; =20 } =20 } if(i =3D 1 ) { if ( register_chrdev(----, "mydev_1", &my_fops)) { ret =3D -EIO; // goto register_err_out; } } i++; return ret; } static int __devexit my_remove_one(struct pci_dev *pdev) { int j=3D0,k; printf ("my_remove_one invoked!\n"); pci_release_regions(pdev); pci_disable_device(pdev); return 0; } init_module() { int ret; printk("\nmy_init\n"); ret =3D pci_module_init(&my_pci_driver); printk("\nmain ret =3D %d ",ret); if (ret !=3D 0) return -EFAULT; cleanup_module() { pci_unregister_driver(&my_pci_driver); unregister_chrdev("mydev_0"); unregister_chrdev("mydev_1"); } ------------------------------------------------------------------------- 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