Implicit declaration of function 'usb_reset_endpoint'

This forum covers PCAN-Linux and Linux development issues concerning our products

Implicit declaration of function 'usb_reset_endpoint'

Postby ajay » Thu 8. Mar 2012, 13:39

Hello,

I'm trying to compile the sources of the PCAN driver 7.4.
I get the following compiler warning:
.../peak-linux-driver-7.4/driver/src/pcan_usb_core.c: In function ‘pcan_usb_plugin’:
.../peak-linux-driver-7.4/driver/src/pcan_usb_core.c:1176: warning: implicit declaration of function ‘usb_reset_endpoint’
...
WARNING: "usb_reset_endpoint" [.../peak-linux-driver-7.4/driver/pcan.ko] undefined!

I use Ubuntu 7.10 Gutsy Gibbon
Kernel version: 2.6.22-16-generic
gcc version: 4.1.3

When ignoring this warning and tiping "sudo make install" and "/sbin/modprobe pcan" I get
FATAL: Error inserting pcan (/lib/modules/2.6.22-16-generic/misc/pcan.ko): Unknown symbol in module, or unknown parameter (see dmesg)
FATAL: Error running install command for pcan

with
[ 4107.921646] pcan: Unknown symbol usb_reset_endpoint
as last line of dmesg.

I know my system is quite old, but I have to use this kernel version! Could someone please help me?

Best regards,
ajay
ajay
 
Posts: 10
Joined: Thu 8. Mar 2012, 13:12

Re: Implicit declaration of function 'usb_reset_endpoint'

Postby M.Maidhof » Thu 8. Mar 2012, 14:55

Hello,

please see the following post:

viewtopic.php?f=120&p=603#p603

regards

Michael
User avatar
M.Maidhof
Support
Support
 
Posts: 215
Joined: Wed 22. Sep 2010, 14:00
Location: Darmstadt, Germany

Re: Implicit declaration of function 'usb_reset_endpoint'

Postby ajay » Wed 14. Mar 2012, 11:01

Thanks now it compiles.

After make install and modprobe pcan I get the error
FATAL: Error inserting pcan (/lib/modules/2.6.22-16-generic/misc/pcan.ko): Unknown symbol in module, or unknown parameter (see dmesg)
FATAL: Error running install command for pcan

And dmesg says
[11330.540716] pcan: Unknown parameter `/usr/local/bin/pcan_make_devices'

The file exists and I gave the executable bit to it. What can I do?

Thank you,
ajay
ajay
 
Posts: 10
Joined: Thu 8. Mar 2012, 13:12

Re: Implicit declaration of function 'usb_reset_endpoint'

Postby M.Maidhof » Wed 14. Mar 2012, 13:24

Hi

which PEAK CAN Hardware do you use?

regards

Michael
User avatar
M.Maidhof
Support
Support
 
Posts: 215
Joined: Wed 22. Sep 2010, 14:00
Location: Darmstadt, Germany

Re: Implicit declaration of function 'usb_reset_endpoint'

Postby ajay » Tue 20. Mar 2012, 11:09

Hi

PEAK CAN Usb

best regards,
ajay
ajay
 
Posts: 10
Joined: Thu 8. Mar 2012, 13:12

Re: Implicit declaration of function 'usb_reset_endpoint'

Postby M.Maidhof » Tue 20. Mar 2012, 17:34

Hi,

then please build the driver for USB only:

make NET=NO PCC=NO PCI=NO ISA=NO DNG=NO PAR=NO

best regards

Michael
User avatar
M.Maidhof
Support
Support
 
Posts: 215
Joined: Wed 22. Sep 2010, 14:00
Location: Darmstadt, Germany

Re: Implicit declaration of function 'usb_reset_endpoint'

Postby ajay » Thu 29. Mar 2012, 14:27

Hello,

thank you very much!

Somehow it worked and I could install the driver. (I also reinstalled udev...)
At least
cat /proc/pcan
gave me a good output.

Unfortunately I have another problem:

I need to have a new version of the driver on industrial pcs. But those pcs don't have any developement tools at all! So I took the image of the really old operating system Ubuntu 7.10 which HAS all the developement stuff I need and loaded it in VirtualBox. I put the compiled files into the Fedora system of the IPCs which have kernel-version 2.6.23.1-42.fc8

On the industrial pcs now I get
FATAL: Error inserting pcan (/lib/modules/2.6.23.1-42.fc8/misc/pcan.ko: Invalid module format
after modprobe pcan

and dmesg says
pcan: version magic '2.6.22-16-generic SMP mod_unload 586 ' should be '2.6.23.1-42.fc8 SMP mod_unload 686 4KSTACKS '

I know one shouldn't expect it to work, but is there a way to bypass the problem with a wrong kernel-version???

Best regards,
ajay
ajay
 
Posts: 10
Joined: Thu 8. Mar 2012, 13:12

Re: Implicit declaration of function 'usb_reset_endpoint'

Postby M.Maidhof » Thu 29. Mar 2012, 15:03

Hello,

the output of dmesg directly informs you about the problem! A kernel module will only work on the kernel it was build for. It is possible to cross compile our driver to a specific kernel. Here are the steps:

- call uname -r on your target system
- search for the kernel headers or source of that kernel in the internet or at kernel.org
- build our driver with the following option: make KERNEL_LOCATION=/where/my/kernel/source/is/located

regards

Michael
User avatar
M.Maidhof
Support
Support
 
Posts: 215
Joined: Wed 22. Sep 2010, 14:00
Location: Darmstadt, Germany

Re: Implicit declaration of function 'usb_reset_endpoint'

Postby ajay » Thu 29. Mar 2012, 15:21

Thank you sir.

Another method would be
modprobe -i -f pcan
(But yes, unsafe etc ;-) )
I am so far that the driver loads automatically after rebooting. I first try it on this way.

Best regards,
ajay
ajay
 
Posts: 10
Joined: Thu 8. Mar 2012, 13:12


Return to Linux



cron