Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.


  Search this Thread
Old 04-28-2009, 07:36 AM   #1
LQ Newbie
Registered: Apr 2009
Posts: 3

Rep: Reputation: 0
How I can test my PCI driver code with hardware?

ear All,

I am new for PCI driver development, I write a simple PCI driver and I need to test it, I need to do simple read/write/ioctl operations, but I have no hardware(PCI development board) for doing this, I tried to use any of the PCI cards connected to my PC, I understand that ,to invoke the Driver probe method, the VENDOR_ID and DEVICE_ID of my driver should match one of the IDs of the cards connected to PC, so I used the lspci utility to list all vendor and device IDs . and I used one of these IDs in my code to make the kernel invoke my driver probe method,
inside the probe, I tried to get the address of BAR0 and BAR1 using pci_resource_start to allocate my data structure in BAR0 of the PCI, but It fails and returns NULL from pci_resource_start.

My question:
-Does anyone know how I could fix this problem ??
-What is the suitable PCI card connected to PC should I use to test my driver?

Appreciate your help

Old 05-04-2009, 04:37 PM   #2
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
You don't allocate using pci_resource_start. It's a simple macro that returns you a value from a table in struct pci_dev. I think you should compare you driver with one of the simple ones. For instance, if you have a PCI sound card, it may be a good thing to test your driver with.

Detection and such stuff should work with any card, so when you have something, it should be fine. I'd only check if the original driver is complicated. If so, search for something easier to understand.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
unable to test driver code written for rtl8139D(l) ethernet controller sandeep_raju123 Linux - Networking 1 12-26-2008 09:26 AM
Newbie: problems trying to build test driver code from O'Reilly dwxrt Ubuntu 2 12-11-2008 11:56 PM
error compiling dlink DFE-520TX PCI adapter driver source code ignoribis Linux - Newbie 0 07-09-2008 11:52 AM > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 03:36 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration