LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-18-2009, 03:05 AM   #1
surya1006
LQ Newbie
 
Registered: Sep 2008
Posts: 3

Rep: Reputation: 0
Error in application with PlxPciDeviceFind() function


Our main file calls the standard PLX function SelectDevice() which further includes the standard function PlxPciDeviceFind().
The codes are compiled successfully, but when we run the application, it prints the message "Before PlxPciDeviceFind function call:" as shown below and stops after that, showing a "segmentation fault".


/*********************************************************************
*
* Function : SelectDevice
*
* Description: Asks the user which PLX PCI device to select
*
* Returns : Total Plx devices found
* -1, if user cancelled the selection
*
********************************************************************/
S8
SelectDevice(
DEVICE_LOCATION *pDevice
)
{
printf("Entering Select Device function:");
U32 i;
U32 DeviceNum;


pDevice->BusNumber = (U8)-1;
pDevice->SlotNumber = (U8)-1;
pDevice->VendorId = (U16)-1;
pDevice->DeviceId = (U16)-1;
pDevice->SerialNumber[0] = '\0';

DeviceNum = FIND_AMOUNT_MATCHED;
printf("\nBefore PlxPciDeviceFind function call:");
if (PlxPciDeviceFind(
pDevice,
&DeviceNum
) != ApiSuccess)
{
return 0;
}
printf("\nAfter PlxPciDeviceFind function call:");
if (DeviceNum == 0)
return 0;

This is a standard code in the standard file called PlxInit.c. The value of FIND_AMOUNT_ATTACHED is derived from a standard file included here called Plx.h and the value of which is 80001.
Can anybody suggest why is it stopping at that point, as I suspect the problem might be with the DeviceNum parameter here.
Thanks.
 
  


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
How to access the SD/MMC driver function in the application module ranju* Programming 0 01-20-2009 04:29 AM
C function to get application path sibtay Programming 5 06-22-2005 05:45 AM
sizeof() function error ??? Quest101 Programming 9 03-10-2005 09:35 PM
Winfast 2000 TV radio function uses what application? andylow Linux - Software 0 01-23-2005 10:58 AM
error recursive function in c shams Programming 3 07-28-2004 08:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:57 AM.

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
Open Source Consulting | Domain Registration