Solved

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

Posted on 2007-11-22
12
1,305 Views
Last Modified: 2013-12-16
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
Comment
Question by:http:// thevpn.guru
  • 7
  • 5
12 Comments
 
LVL 34

Expert Comment

by:Duncan Roe
ID: 20336184
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
 
LVL 19

Author Comment

by:http:// thevpn.guru
ID: 20336352
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
 
LVL 19

Author Comment

by:http:// thevpn.guru
ID: 20336689
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
 
LVL 34

Expert Comment

by:Duncan Roe
ID: 20337911
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
 
LVL 19

Author Comment

by:http:// thevpn.guru
ID: 20338111
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
 
LVL 34

Expert Comment

by:Duncan Roe
ID: 20338304
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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 19

Author Comment

by:http:// thevpn.guru
ID: 20338501
hm..that makes a lot of sense..thanks duncan_roe I will try that and provide feedback..

I appreciate your help.
0
 
LVL 19

Author Comment

by:http:// thevpn.guru
ID: 20338626
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
 
LVL 34

Accepted Solution

by:
Duncan Roe earned 500 total points
ID: 20341033
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
 
LVL 34

Expert Comment

by:Duncan Roe
ID: 20341084
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
 
LVL 19

Author Comment

by:http:// thevpn.guru
ID: 20348638
Thanks that did it...you helped me quite a lot thanks
0
 
LVL 19

Author Closing Comment

by:http:// thevpn.guru
ID: 31410598
Excellent high technical help from duncan thx
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now