iowarrior sdk doesn't compile with fedora kernel 2.6.16

This is the English forum for all topics related to IO-Warrior. Please post in English only

Moderator: Guido Körber

Post Reply
echion
Posts: 6
Joined: Wed Jun 15, 2005 7:58 am

iowarrior sdk doesn't compile with fedora kernel 2.6.16

Post by echion »

Hi,

Has anyone gotten the IOW SDK (latest) to compile with a recent kernel? On Fedora Core 5 I get the following error -- as if my usb headers are too new / different:

# uname -a
Linux xxxx 2.6.16-1.2111_FC5 #1 SMP Thu May 4 21:16:04 EDT 2006 x86_64 x86_64 x86_64 GNU/Linux

# rpm -q kernel libusb libusb-devel
kernel-2.6.16-1.2111_FC5
libusb-0.1.11-2.2
libusb-devel-0.1.11-2.2

# make
make -C /lib/modules/2.6.16-1.2111_FC5/build SUBDIRS=/home/martin/src/iow/LinuxSDK/Kernel_2.6/Driver modules
make[1]: Entering directory `/usr/src/kernels/2.6.16-1.2111_FC5-x86_64'
CC [M] /home/martin/src/iow/LinuxSDK/Kernel_2.6/Driver/iowarrior.o
/home/martin/src/iow/LinuxSDK/Kernel_2.6/Driver/iowarrior.c:166: error: unknown field ‘mode’ specified in initializer
/home/martin/src/iow/LinuxSDK/Kernel_2.6/Driver/iowarrior.c:173: error: unknown field ‘owner’ specified in initializer
/home/martin/src/iow/LinuxSDK/Kernel_2.6/Driver/iowarrior.c:173: warning: initialization from incompatible pointer type
/home/martin/src/iow/LinuxSDK/Kernel_2.6/Driver/iowarrior.c: In function ‘iowarrior_read’:
/home/martin/src/iow/LinuxSDK/Kernel_2.6/Driver/iowarrior.c:412: warning: format ‘%d’ expects type ‘int’, but argument 4 has type ‘size_t’
/home/martin/src/iow/LinuxSDK/Kernel_2.6/Driver/iowarrior.c: In function ‘iowarrior_ioctl’:
/home/martin/src/iow/LinuxSDK/Kernel_2.6/Driver/iowarrior.c:468: warning: ISO C90 forbids mixed declarations and code
make[2]: *** [/home/martin/src/iow/LinuxSDK/Kernel_2.6/Driver/iowarrior.o] Error 1
make[1]: *** [_module_/home/martin/src/iow/LinuxSDK/Kernel_2.6/Driver] Error 2
make[1]: Leaving directory `/usr/src/kernels/2.6.16-1.2111_FC5-x86_64'
make: *** [default] Error 2


Can anyone help?
Robert Marquardt
Posts: 543
Joined: Mon Dec 01, 2003 6:09 pm

Post by Robert Marquardt »

Simply delete the line with the mode initialization.
This element of the struct has been dropped in 2.6.16.
wayoda
Posts: 362
Joined: Fri Dec 19, 2003 12:00 pm
Location: Wuppertal/Germany

Post by wayoda »

/home/martin/src/iow/LinuxSDK/Kernel_2.6/Driver/iowarrior.c:173: error: unknown field 'owner' specified in initializer
the .owner element has also been removed from struct usb_driver in Kernel 2.6.16 so you have to remove this line, too.

By the way :
As I see from the top of your post:
# rpm -q kernel libusb libusb-devel
kernel-2.6.16-1.2111_FC5
libusb-0.1.11-2.2
libusb-devel-0.1.11-2.2
there are references to libusb .

If you intend to use libusb with the iowarrior there are two things you
have to keep in mind:
1. You don't need the Kernel-Module for the iowarrior if you use libusb . It will actually get in your way, so you have to call usb_detach_kernel_driver_np
to get access to the device.

2. If you're libusb-application is going to use more than one thread for reading and writing to the device, it will NOT work with the 0.1.xx release of libusb .
You will have to wait for the new libusb-API 1.0.x. But development in this area is progressing at the speed of a snail, so I doubt that we will even see an alpha-release this year. :-(

Eberhard
echion
Posts: 6
Joined: Wed Jun 15, 2005 7:58 am

Post by echion »

thanks for the hint about not needing the kernel module. I only quoted the versions of my libusb because the kernel module includes usb.h, which on fedora seems to be provided by the libusb packages I mentioned.

I am just trying to get some python code talking to the iow. I apologize for any/all these stupid questions.

1. Are there any existing rpms for fedora? I don't think so as all documentation says that only suse is supported.
2. Sounds like I should still try to build the kernel module -- am I missing some build documentation?
3. If not, where should I get the right version of jni.h? What is the right version? I ask because I've had to do this to get anything to start to compile:

a) install kdevelop & cmake
b) change all references to /usr/local/bin/cmake to the real location of cmake (fedora packages put it in /usr/bin/cmake)
c) change all references to /home/rom/iowkit to the directory wherein I've unpacked the SDK.zip (LinuxSDK/Kernel_2.6/iowkit).

Now I can get further but can't build iowkitjni.cpp since I lack jni.h. Is this provided by some java sdk?

Thanks,
Martin
wayoda
Posts: 362
Joined: Fri Dec 19, 2003 12:00 pm
Location: Wuppertal/Germany

Post by wayoda »

Hi Martin,
echion wrote: thanks for the hint about not needing the kernel module. I only quoted the versions of my libusb because the kernel module includes usb.h, which on fedora seems to be provided by the libusb packages I mentioned.
Looks like you got me wrong.

If you use libusb, you don't need the Kernel-module.
But since you want to use the Iowkit-library, you need the Kernel-Module too.

The include-file <linux/usb.h> is at /usr/src/linux/include/linux/usb.h. I
never ran Fedora, but since this file is part of the default Linux-Kernel I don't think you will need libusb at all.
echion wrote: 1. Are there any existing rpms for fedora? I don't think so as all documentation says that only suse is supported.
There are no rpms for any plarform, sorry. But on the other hand, there
no Suse-specific code int the Kernel-module or the Iowkit-Library. The
Library was developed on a Suse-System but as far as I know it is at least
used on Debian as well.
echion wrote: 2. Sounds like I should still try to build the kernel module -- am I missing some build documentation?
Yes, you have to build it! With the changes from the previous posts applyed, do you still have problems compiling?
What's the compiler output?
(the 2 warnings can be ignored for now. The don't have any effect on the
functions of the module. I think they will be taken care of very soon by a
new release, because in 2 days the new Suse 10.1 will be available that
uses Kernel 2.6.16 like you do. So there will be a lot more users that run
into the same problems you have.
echion wrote: 3. If not, where should I get the right version of jni.h? What is the right version? I ask because I've had to do this to get anything to start to compile:
a) install kdevelop & cmake
b) change all references to /usr/local/bin/cmake to the real location of cmake (fedora packages put it in /usr/bin/cmake)
c) change all references to /home/rom/iowkit to the directory wherein I've unpacked the SDK.zip (LinuxSDK/Kernel_2.6/iowkit).
You will need the Java-SDK for Linux from Sun. (any version >=1.3 will do)
From the SDK you will actually need 2 files jni.h and jni_md.h
Descending from the directory where the Java-Sdk is installed
(on my machine it's at /usr/java/ but this depends on the installation)
these files are at jdk1.MajorVersion.MinorVersion/inlude/jni.h and
jdk1.MajorVersion.MinorVersion/inlude/linux/jni_md.h
You will have to copy these 2 files into your project, or at least copy them
into the src-directory of the IowKit-Library.

Hope that helps
Eberhard
Post Reply