* [Xenomai-help] How to Obtaining Pci Device Private Data ( base Address ) with RTDM
@ 2010-12-04 7:16 adilkaraoz
2010-12-04 9:10 ` Gilles Chanteperdrix
0 siblings, 1 reply; 2+ messages in thread
From: adilkaraoz @ 2010-12-04 7:16 UTC (permalink / raw)
To: xenomai
[-- Attachment #1: Type: text/plain, Size: 1845 bytes --]
Hi,
I want to obtain private data of my PLX pci device but I don't understand
anything what I do. Starting of my code below please help me.
/**
* define devices our driver supports
*/
static struct pci_device_id pic1711_ids[]={ { PCI_DEVICE(PCI_VENDOR_ID_PLX,
PCI_DEVICE_ID_1711) },{0,}, };
/**
* export pci_device_id structure to user space, allowing hotplug
*/
MODULE_DEVICE_TABLE (pci, pic1711_ids);
/**
* create pci_driver structure,
* and register it in cpci_ea221_driver_init_module,
* unregister in cpci_ea221_driver_exit_module
*/
static struct pci_driver pci1711_driver = {
.name = DRV_NAME,
.id_table = pic1711_ids,
.probe = pci1711_probe,
.remove = __devexit_p(pci1711_remove),
};
/**
* Init module function
*/
static int xeno_pic1711_driver_init_module(void){
static int ret_val;
printk( KERN_DEBUG "Module xenoPci1711_driver init\n" );
ret_val = pci_register_driver(&pci1711_driver);
return ret_val;
}
And I found this code for obtain private data.
struct pci_dev *pcidev;
printk("PCI-1711 DETECT PCI \n");
pcidev=NULL;
pcidev =pci_get_device (PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_1711, pcidev );
if (pcidev==NULL){
printk("PCI-1711 CANNOT BE FOUND \n");
}
else{
printk("PCI-1711 LOCATED \n");
if (pci_enable_device(pcidev)){
printk("PCI-1711 NOT ENABLED \n");
return(-EIO);
}
else{
printk("PCI-1711 ENABLED \n");
}
//PCI_BASE_ADRESS_1711= pci_resource_start(pcidev, 1)&
//PCI_BASE_ADDRESS_MEM_MASK; printk("PCI-1711 DETECT PCI %x
\n",PCI_BASE_ADRESS_1711);
With this code pci_dev used but my code has pci_driver I don't understand
relation between pci_dev and pci_driver.
--
Adil Karaöz
C TECH Yazılım Geliştiricisi
GYTE Bilgisayar Mühendisliği
[-- Attachment #2: Type: text/html, Size: 4440 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Xenomai-help] How to Obtaining Pci Device Private Data ( base Address ) with RTDM
2010-12-04 7:16 [Xenomai-help] How to Obtaining Pci Device Private Data ( base Address ) with RTDM adilkaraoz
@ 2010-12-04 9:10 ` Gilles Chanteperdrix
0 siblings, 0 replies; 2+ messages in thread
From: Gilles Chanteperdrix @ 2010-12-04 9:10 UTC (permalink / raw)
To: adilkaraoz; +Cc: xenomai
adilkaraoz wrote:
> Hi,
>
> I want to obtain private data of my PLX pci device but I don't understand
> anything what I do. Starting of my code below please help me.
The way you would do this with RTDM is the same you would do it with
Linux. RTDM does not define any API, it lets you use Linux API.
If your trouble is about writing a PCI driver with Linux, then you are
asking the wrong list, since you ask to a Xenomai mailing list, mainly
talking about Xenomai.
Though we can suggest you to read the chapter on PCI devices of the
"Linux device drivers" book. Available online here:
http://lwn.net/Kernel/LDD3/
Hopefully, when you have read that book, you will understand better what
you are doing
--
Gilles.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-12-04 9:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-04 7:16 [Xenomai-help] How to Obtaining Pci Device Private Data ( base Address ) with RTDM adilkaraoz
2010-12-04 9:10 ` Gilles Chanteperdrix
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.