All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ramon <ramoncostacastello@domain.hid>
To: xenomai@xenomai.org
Subject: [Xenomai-help] RTDM : Obtaining PCI base address
Date: Wed, 18 Aug 2010 20:24:42 +0200	[thread overview]
Message-ID: <4C6C256A.3060404@domain.hid> (raw)

Hi,

In order to introduce myself to RTDM and driver development in Xenomai, 
I'm trying to develop a simple "driver"
for an advantech PCI-1711 card.

First thing I need to do is obtaining the PCI base address of the card. 
To do this I used an old code I already have :

struct pci_dev *pcidev;

printk("PCI-1711 DETECT PCI \n");
pcidev=NULL;
pcidev =pci_get_device (PCI_VENDOR_, PCI_DEVICE_, 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);
}



Unfortunatelly PCI_BASE_ADRESS_1711 always takes de 0 value.

Is this type of code already valid in current linux kernels ?
Could anyone point me to a similar code ?

Thank you in advance
Ramon


             reply	other threads:[~2010-08-18 18:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-18 18:24 Ramon [this message]
2010-08-18 19:03 ` [Xenomai-help] RTDM : Obtaining PCI base address Paul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C6C256A.3060404@domain.hid \
    --to=ramoncostacastello@domain.hid \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.