LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-15-2008, 05:20 AM   #1
webquinty
Member
 
Registered: Apr 2008
Location: Espaņa
Distribution: Suse
Posts: 218

Rep: Reputation: 32
Problem with pci_get_device.....


Hello,

In this moment, I am learning how to handle pci devices.
Well, I am made some test and I have one doubt:

1.- This function, pci_get_device(MY_VENDOR_ID, MY_DEVICE_ID, NULL);, can I only use with a driver???. I try to explain more, I try to use this function in a normal programm, example.c with a main function.
When I try to compile this example I have this message:

Quote:
/home/john/NetBeansProjects/driver/driver.c:23: undefined reference to `pci_get_device'
collect2: ld returned 1 exit status
Quote:
#include <stdio.h>
#include <stdlib.h>
#include <linux/pci.h>

#define MY_VENDOR_ID 0X1677
#define MY_DEVICE_ID 0x197B

struct pci_dev *my_dev;
/*
*
*/
int main(int argc, char** argv) {

my_dev = pci_get_device(MY_VENDOR_ID, MY_DEVICE_ID, NULL);

return (EXIT_SUCCESS);
}
Can I do it??? or not???

Can I use it only in a driver???

Best regards.
 
  


Reply


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
perl problem? apache problem? cgi problem? WorldBuilder Linux - Software 1 09-17-2003 08:45 PM


All times are GMT -5. The time now is 08:28 PM.

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