• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1413
  • Last Modified:

Problem with patching ipw 3945 driver to enable packet injection on wireless card on Duo Core Centrion Laptop

Dear All

I am trying to enable injection on my Toshiba Satellite laptop the wireless card is ipw 3945 as experienced users might know that the driver that comes with Ubuntu does not support injection and the driver needs to be patched.

I have followed http://aircrack-ng.org/doku.php?id=ipw3945 from the aircrack site.

I did not get very far with the process although it is simple and straight forward :

I did

wget http://homepages.tu-darmstadt.de/~p_larbig/wlan/ipwraw-ng-2.0.0-10072007.tar.bz2
tar -xjf ipwraw-ng*
cd ipwraw-ng
make

but make returns the errors presented.

I did the following steps to make sure I have all the needed dependencie:

apt-get install build-essential

I have downloaded the correct kernel headers and the linux source for my kernel using apt-get...I could not find anything useful using Google..


any hints ?




/home/alinux/ipwraw-ng/ipwraw.c: In function ‘ipw_bg_up’:
/home/alinux/ipwraw-ng/ipwraw.c:8212: error: dereferencing pointer to incomplete type
/home/alinux/ipwraw-ng/ipwraw.c:8212: warning: type defaults to ‘int’ in declaration of ‘__mptr’
/home/alinux/ipwraw-ng/ipwraw.c:8212: warning: initialization from incompatible pointer type
/home/alinux/ipwraw-ng/ipwraw.c:8212: error: invalid use of undefined type ‘struct delayed_work’
/home/alinux/ipwraw-ng/ipwraw.c:8213: warning: type defaults to ‘int’ in declaration of ‘__mptr’
/home/alinux/ipwraw-ng/ipwraw.c:8213: warning: initialization from incompatible pointer type
/home/alinux/ipwraw-ng/ipwraw.c: In function ‘ipw_bg_restart’:
/home/alinux/ipwraw-ng/ipwraw.c:8226: error: dereferencing pointer to incomplete type
/home/alinux/ipwraw-ng/ipwraw.c:8226: warning: type defaults to ‘int’ in declaration of ‘__mptr’
/home/alinux/ipwraw-ng/ipwraw.c:8226: warning: initialization from incompatible pointer type
/home/alinux/ipwraw-ng/ipwraw.c:8226: error: invalid use of undefined type ‘struct delayed_work’
/home/alinux/ipwraw-ng/ipwraw.c:8227: warning: type defaults to ‘int’ in declaration of ‘__mptr’
/home/alinux/ipwraw-ng/ipwraw.c:8227: warning: initialization from incompatible pointer type
/home/alinux/ipwraw-ng/ipwraw.c: In function ‘ipw_pci_probe’:
/home/alinux/ipwraw-ng/ipwraw.c:8737: warning: passing argument 2 of ‘request_irq’ from incompatible pointer type
make[2]: *** [/home/alinux/ipwraw-ng/ipwraw.o] Error 1
make[1]: *** [_module_/home/alinux/ipwraw-ng] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.17-12-386'
make: *** [modules] Error 2

Open in new window

0
http:// thevpn.guru
Asked:
http:// thevpn.guru
  • 7
  • 5
1 Solution
 
Duncan RoeSoftware DeveloperCommented:
I downloaded and tried it myself. It didn't work for me either, but with only 1 error:

make -C /lib/modules/2.6.22.9fba/build M=/tmp/ipwraw-ng modules
make[1]: Entering directory `/usr/src/linux-2.6.22.9'
  CC [M]  /tmp/ipwraw-ng/ipwraw.o
/tmp/ipwraw-ng/ipwraw.c: In function `ipw_pci_probe':
/tmp/ipwraw-ng/ipwraw.c:8737: warning: `deprecated_irq_flag' is deprecated (declared at include/linux/interrupt.h:66)
/tmp/ipwraw-ng/ipwraw.c:8753: error: structure has no member named `wireless_handlers'
make[2]: *** [/tmp/ipwraw-ng/ipwraw.o] Error 1
make[1]: *** [_module_/tmp/ipwraw-ng] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.22.9'
make: *** [modules] Error 2

What version of linux are you building against? The INSTALL file mentions 2.6.13 - that might be a good one to try (rather old though). 2.6.15 and current sources both have the element "`wireless_handlers'" in *some* structures. Current source has a whole new directory net/wireless/ (as well as drivers/net/wireless/) so maybe my kernel is a bit too new.

I suspect your kernel is too old (according to ipwraw-ng/INSTALL).  Either that or /lib/modules/$(uname -r)/build is not a symbolic link to your current kernel's source. Please check these items and post your findings
0
 
http:// thevpn.guruAuthor Commented:
Well concerning the version of the kernel..I have seen that users with Ubuntu 6.10 and 7.10 have been able to get it to run..and those with problems did not face this problem..or they did face my problem but the installation of the kernel headers or build-essential did solve their problem..see

http://tinyshell.be/aircrackng/forum/index.php?topic=924.0

http://tinyshell.be/aircrackng/forum/index.php?topic=1985.120

Well concerning you question about the symlink I did

root@alinux-laptop:/lib/modules# ls -F
2.6.15-28-386/  2.6.17-12-386/  2.6.17-12-generic/  

They do look like directories not like symlinks..did I do something wrong here ?

Anyway I am glad you are helping me I respect your expertise.

Thx
0
 
http:// thevpn.guruAuthor Commented:
I have read the INSTALL file and it mentioned the following

First we install the firmware files (first finding where to install
them):

        % wget http://bughost.org/ipw3945/ucode/iwlwifi-ucode-2.14.1.tgz .
        % DIR=$(sed -ne "s:^FIRMWARE_DIR=\([^, ]*\).*:\1:p" \
                /etc/hotplug/firmware.agent)
        % tar xzvf iwlwifi-ucode-2.14.1.tgz
        % less iwlwifi-ucode-2.14.1/LICENSE.iwlwifi-ucode
        # cp ipwlwifi-ucode-2.14.1/iwlwifi-3945.ucode $DIR

NOTE:  'DIR' above typically works out to /lib/firmware.

Next you can build the driver sources:

        % make


However..I do not have a /etc/hotplug/firmware.agent on my system so I just copied the iwlfifi-ucode file to /lib/firmware/`uname -r`

would that be correct...?

What is this firmware.agent for anyway ? And why aint it included in ubuntu os
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
Duncan RoeSoftware DeveloperCommented:
Don't know about the firmware stuff - you should probably ask a separate Q about that. Also, ubuntu revs mean nothing to me - please quote the linux revisions.
Unfortunately your ls is not actually what I wanted, although it does show that your linux revs are adequately new. Try these:

ls -l /lib/modules/$(uname -r)/build
ls -l /lib/modules/$(uname -r)/build/

The forward slash at the end of the second one should list directory contents.
0
 
http:// thevpn.guruAuthor Commented:
root@alinux-laptop:/home/alinux# ls -l /lib/modules/$(uname -r)/build
lrwxrwxrwx 1 root root 36 2007-11-22 16:16 /lib/modules/2.6.17-12-386/build -> /usr/src/linux-headers-2.6.17-12-386


root@alinux-laptop:/home/alinux# ls -l /lib/modules/$(uname -r)/build/
total 340
lrwxrwxrwx 1 root root     31 2007-11-22 16:16 arch -> ../linux-headers-2.6.17-12/arch
lrwxrwxrwx 1 root root     32 2007-11-22 16:16 block -> ../linux-headers-2.6.17-12/block
lrwxrwxrwx 1 root root     33 2007-11-22 16:16 crypto -> ../linux-headers-2.6.17-12/crypto
lrwxrwxrwx 1 root root     34 2007-11-22 16:16 drivers -> ../linux-headers-2.6.17-12/drivers
lrwxrwxrwx 1 root root     35 2007-11-22 16:16 firmware -> ../linux-headers-2.6.17-12/firmware
lrwxrwxrwx 1 root root     29 2007-11-22 16:16 fs -> ../linux-headers-2.6.17-12/fs
drwxr-xr-x 4 root root   4096 2007-11-22 16:16 include
lrwxrwxrwx 1 root root     31 2007-11-22 16:16 init -> ../linux-headers-2.6.17-12/init
lrwxrwxrwx 1 root root     30 2007-11-22 16:16 ipc -> ../linux-headers-2.6.17-12/ipc
lrwxrwxrwx 1 root root     33 2007-11-22 16:16 kernel -> ../linux-headers-2.6.17-12/kernel
lrwxrwxrwx 1 root root     30 2007-11-22 16:16 lib -> ../linux-headers-2.6.17-12/lib
-rw-r--r-- 1 root root  45475 2007-09-24 02:10 Makefile
lrwxrwxrwx 1 root root     29 2007-11-22 16:16 mm -> ../linux-headers-2.6.17-12/mm
lrwxrwxrwx 1 root root     34 2007-11-22 16:16 modules -> ../linux-headers-2.6.17-12/modules
-rw-r--r-- 1 root root 286242 2007-09-24 00:25 Module.symvers
lrwxrwxrwx 1 root root     30 2007-11-22 16:16 net -> ../linux-headers-2.6.17-12/net
drwxr-xr-x 8 root root   4096 2007-11-22 16:16 scripts
lrwxrwxrwx 1 root root     35 2007-11-22 16:16 security -> ../linux-headers-2.6.17-12/security
lrwxrwxrwx 1 root root     32 2007-11-22 16:16 sound -> ../linux-headers-2.6.17-12/sound
lrwxrwxrwx 1 root root     30 2007-11-22 16:16 usr -> ../linux-headers-2.6.17-12/usr

0
 
Duncan RoeSoftware DeveloperCommented:
I don't think what you have there is a proper source directory. You could verify that by cd to it and try "make oldconfig". This is what my (proper) directory looks like:

20:27:05$ ls -l /lib/modules/$(uname -r)/build
lrwxrwxrwx  1 root root 23 2007-10-10 22:48 /lib/modules/2.6.22.9fba/build -> /usr/src/linux-2.6.22.9

20:11:04$ ls -l /lib/modules/$(uname -r)/build/
total 5752
-rw-r--r--   1 dunc users   18693 2007-09-27 04:03 COPYING
-rw-r--r--   1 dunc users   91435 2007-09-27 04:03 CREDITS
drwxr-xr-x  64 dunc users    8192 2007-09-27 04:03 Documentation
-rw-r--r--   1 dunc users    1530 2007-09-27 04:03 Kbuild
-rw-r--r--   1 dunc users   89876 2007-09-27 04:03 MAINTAINERS
-rw-r--r--   1 dunc users   50406 2007-10-10 22:29 Makefile
-rw-r--r--   1 dunc users  207333 2007-10-10 22:45 Module.symvers
lrwxrwxrwx   1 dunc users      27 2007-10-06 18:00 RCS -> /home/dunc/rcsdirs/linux_64
-rw-r--r--   1 dunc users   16930 2007-09-27 04:03 README
-rw-r--r--   1 dunc users    3119 2007-09-27 04:03 REPORTING-BUGS
drwxr-xr-x  28 dunc users    4096 2007-09-27 04:03 arch
drwxr-xr-x   2 dunc users    4096 2007-10-10 22:45 block
drwxr-xr-x   2 dunc users    4096 2007-10-10 22:45 crypto
drwxr-xr-x  67 dunc users    4096 2007-10-10 22:45 drivers
drwxr-xr-x  62 dunc users    8192 2007-10-10 22:45 fs
drwxr-xr-x  44 dunc users    4096 2007-10-10 22:35 include
drwxr-xr-x   2 dunc users    4096 2007-10-10 22:45 init
drwxr-xr-x   2 dunc users    4096 2007-10-10 22:45 ipc
drwxr-xr-x   5 dunc users    8192 2007-10-10 22:45 kernel
drwxr-xr-x   5 dunc users    8192 2007-10-10 22:45 lib
drwxr-xr-x   2 dunc users    4096 2007-10-10 22:45 mm
drwxr-xr-x  41 dunc users    4096 2007-10-10 22:45 net
drwxr-xr-x   9 dunc users    4096 2007-10-10 22:35 scripts
drwxr-xr-x   4 dunc users    4096 2007-10-10 22:45 security
drwxr-xr-x  18 dunc users    4096 2007-10-10 22:46 sound
drwxr-xr-x   2 dunc users    4096 2007-10-10 22:35 usr
-rwxr-xr-x   1 dunc users 7369124 2007-10-10 22:45 vmlinux

The makefile depends on the symlink /lib/modules/$(uname -r)/build pointing to the actual directory where the kernel was built. Your directory isn't that - there's no vmlinux or Kbuild (a necessary makefile).

I think you'd do best to get linux-2.6.17.12.tar.bz2 from ftp.kernel.org, rebuild and reinstall from that. With luck you can get the current .config from /proc/config.gz, or there may be one in your current "source" directory.
0
 
http:// thevpn.guruAuthor Commented:
hm..that makes a lot of sense..thanks duncan_roe I will try that and provide feedback..

I appreciate your help.
0
 
http:// thevpn.guruAuthor Commented:
I did the make oldconfig and it exited normally with onscreen display as shown below

Deflate compression algorithm (CRYPTO_DEFLATE) [M/y/?] m
  Michael MIC keyed digest algorithm (CRYPTO_MICHAEL_MIC) [M/y/?] m
  CRC32c CRC algorithm (CRYPTO_CRC32C) [M/y/?] m
  Testing module (CRYPTO_TEST) [M/n/y/?] m
*
* Hardware crypto devices
*
Support for VIA PadLock ACE (CRYPTO_DEV_PADLOCK) [M/n/y/?] m
Support for AES in VIA PadLock (CRYPTO_DEV_PADLOCK_AES) [Y/n/?] y

etc..

What struck me as very confusing is that my build dir contains total 340 while yours contains total 5752

I will try to build it myself as suggested..I just want to ask you if this could be because the headers were isntalled using apt-get ?
thx
0
 
Duncan RoeSoftware DeveloperCommented:
Your build dir isn't your build dir, if you see what I mean.
All the symbolic links point to /usr/src/linux-headers-2.6.17-12, so that is where the building really gets done, not /usr/src/linux-headers-2.6.17-12-386.
The lack of the top-level Kbuild concerns me a bit but I can't see where the Makefile uses it so that may be OK.
By all means go ahead and build - if it works and problems persist it will be time for a rethink
0
 
Duncan RoeSoftware DeveloperCommented:
As an extra test, you could verify the same modules go built and built the same:

Rename the old 2.6.17-12-386 in /lib/modules (to 2.6.17-12-386.orig say)

In the build dir, assuming "make" ran to completion, do (as root):

make modules_install

Now cd back to /lib/modules and do

diff -r 2.6.17-12-386.orig 2.6.17-12-386

Expect some differences due to date/time, but the .ko files should compare equal - AFAIK they have no date/time stuff in them. If any binary files compare different, compare them with "cmp -l" and make sure only a few locations are changed.
0
 
http:// thevpn.guruAuthor Commented:
Thanks that did it...you helped me quite a lot thanks
0
 
http:// thevpn.guruAuthor Commented:
Excellent high technical help from duncan thx
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 7
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now