I installed the Debian 3.1 sarge distribution using the Netinstall. My kernel version at that time was 2.6.8-2-386
non#uname -r
2.6.8-2-386

Then I recompiled my kernel as I had to modify some soruce code in one of the driver files, but this time I used the kernel source 2.6.8 as when I did apt-get install kernel-source, by default it took 2.6.8. So now I am running this new kernel:
non#uname -r
2.6.8

Then I decided to install the ndiswrapper, so I did
apt-get install ndiswrapper* and this is the out put I got.

non:~/Wireless_drivers/wpc54g# apt-get install ndiswrapper*
Reading Package Lists... Done
Building Dependency Tree... Done
Note, selecting ndiswrapper-modules-2.6.8-2-k7 for regex 'ndiswrapper*'
Note, selecting ndiswrapper-utils for regex 'ndiswrapper*'
Note, selecting ndiswrapper-source for regex 'ndiswrapper*'
Note, selecting ndiswrapper-modules-2.6.8-2-386 for regex 'ndiswrapper*'
Note, selecting ndiswrapper-modules-2.6.8-2-686 for regex 'ndiswrapper*'
Note, selecting ndiswrapper-modules-2.6.8-2-686-smp for regex 'ndiswrapper*'
Note, selecting ndiswrapper-modules-2.6.8-2-k7-smp for regex 'ndiswrapper*'
Note, selecting ndiswrapper-modules-1.1 for regex 'ndiswrapper*'
The following extra packages will be installed:
debconf-utils debhelper gettext html2text intltool-debian module-assistant
ndiswrapper-modules-2.6.8-2-386 ndiswrapper-modules-2.6.8-2-686
ndiswrapper-modules-2.6.8-2-686-smp ndiswrapper-modules-2.6.8-2-k7
ndiswrapper-modules-2.6.8-2-k7-smp ndiswrapper-source ndiswrapper-utils
po-debconf
Suggested packages:
dh-make cvs gettext-doc build-essential dialog
Recommended packages:
curl libterm-size-perl libterm-readkey-perl kernel-image-2.6.8-2-686
kernel-image-2.6.8-2-686-smp kernel-image-2.6.8-2-k7
kernel-image-2.6.8-2-k7-smp libmail-sendmail-perl libcompress-zlib-perl
The following NEW packages will be installed:
debconf-utils debhelper gettext html2text intltool-debian module-assistant
ndiswrapper-modules-2.6.8-2-386 ndiswrapper-modules-2.6.8-2-686
ndiswrapper-modules-2.6.8-2-686-smp ndiswrapper-modules-2.6.8-2-k7
ndiswrapper-modules-2.6.8-2-k7-smp ndiswrapper-source ndiswrapper-utils
po-debconf
0 upgraded, 14 newly installed, 0 to remove and 21 not upgraded.
Need to get 2839kB of archives.
After unpacking 8765kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://mirrors.kernel.org stable/main debconf-utils 1.4.30.13 [33.0kB]
Get:2 http://mirrors.kernel.org stable/main html2text 1.3.2a-2 [92.6kB]
Get:3 http://mirrors.kernel.org stable/main gettext 0.14.4-2 [1718kB]
Get:4 http://mirrors.kernel.org stable/main intltool-debian 0.30+20040213 [23.5kB]
Get:5 http://mirrors.kernel.org stable/main po-debconf 0.8.23 [78.0kB]
Get:6 http://mirrors.kernel.org stable/main debhelper 4.2.32 [362kB]
Get:7 http://mirrors.kernel.org stable/main module-assistant 0.9 [72.8kB]
Get:8 http://mirrors.kernel.org stable/main ndiswrapper-modules-2.6.8-2-k7-smp 1.1-2 [66.8kB]
Get:9 http://mirrors.kernel.org stable/main ndiswrapper-modules-2.6.8-2-k7 1.1-2 [66.3kB]
Get:10 http://mirrors.kernel.org stable/main ndiswrapper-modules-2.6.8-2-686-smp 1.1-2 [68.2kB]
Get:11 http://mirrors.kernel.org stable/main ndiswrapper-modules-2.6.8-2-686 1.1-2 [67.9kB]
Get:12 http://mirrors.kernel.org stable/main ndiswrapper-utils 1.1-4 [25.2kB]
Get:13 http://mirrors.kernel.org stable/main ndiswrapper-modules-2.6.8-2-386 1.1-2 [59.4kB]
Get:14 http://mirrors.kernel.org stable/main ndiswrapper-source 1.1-4 [106kB]
Fetched 2839kB in 18s (151kB/s)
Selecting previously deselected package debconf-utils.
(Reading database ... 36526 files and directories currently installed.)
Unpacking debconf-utils (from .../debconf-utils_1.4.30.13_all.deb) ...
Selecting previously deselected package html2text.
Unpacking html2text (from .../html2text_1.3.2a-2_i386.deb) ...
Selecting previously deselected package gettext.
Unpacking gettext (from .../gettext_0.14.4-2_i386.deb) ...
Selecting previously deselected package intltool-debian.
Unpacking intltool-debian (from .../intltool-debian_0.30+20040213_all.deb) ...
Selecting previously deselected package po-debconf.
Unpacking po-debconf (from .../po-debconf_0.8.23_all.deb) ...
Selecting previously deselected package debhelper.
Unpacking debhelper (from .../debhelper_4.2.32_all.deb) ...
Selecting previously deselected package module-assistant.
Unpacking module-assistant (from .../module-assistant_0.9_all.deb) ...
Selecting previously deselected package ndiswrapper-modules-2.6.8-2-k7-smp.
Unpacking ndiswrapper-modules-2.6.8-2-k7-smp (from .../ndiswrapper-modules-2.6.8-2-k7-smp_1.1-2_i386.deb) ...
Selecting previously deselected package ndiswrapper-modules-2.6.8-2-k7.
Unpacking ndiswrapper-modules-2.6.8-2-k7 (from .../ndiswrapper-modules-2.6.8-2-k7_1.1-2_i386.deb) ...
Selecting previously deselected package ndiswrapper-modules-2.6.8-2-686-smp.
Unpacking ndiswrapper-modules-2.6.8-2-686-smp (from .../ndiswrapper-modules-2.6.8-2-686-smp_1.1-2_i386.deb) ...
Selecting previously deselected package ndiswrapper-modules-2.6.8-2-686.
Unpacking ndiswrapper-modules-2.6.8-2-686 (from .../ndiswrapper-modules-2.6.8-2-686_1.1-2_i386.deb) ...
Selecting previously deselected package ndiswrapper-utils.
Unpacking ndiswrapper-utils (from .../ndiswrapper-utils_1.1-4_i386.deb) ...
Selecting previously deselected package ndiswrapper-modules-2.6.8-2-386.
Unpacking ndiswrapper-modules-2.6.8-2-386 (from .../ndiswrapper-modules-2.6.8-2-386_1.1-2_i386.deb) ...
Selecting previously deselected package ndiswrapper-source.
Unpacking ndiswrapper-source (from .../ndiswrapper-source_1.1-4_all.deb) ...
Setting up debconf-utils (1.4.30.13) ...

Setting up html2text (1.3.2a-2) ...

Setting up gettext (0.14.4-2) ...

Setting up intltool-debian (0.30+20040213) ...
Setting up po-debconf (0.8.23) ...
Setting up debhelper (4.2.32) ...
Setting up module-assistant (0.9) ...
Setting up ndiswrapper-source (1.1-4) ...
Setting up ndiswrapper-modules-2.6.8-2-k7-smp (1.1-2) ...

Setting up ndiswrapper-modules-2.6.8-2-k7 (1.1-2) ...

Setting up ndiswrapper-modules-2.6.8-2-686-smp (1.1-2) ...

Setting up ndiswrapper-modules-2.6.8-2-686 (1.1-2) ...

Setting up ndiswrapper-modules-2.6.8-2-386 (1.1-2) ...

Setting up ndiswrapper-utils (1.1-4) ...

After this I did the following:

non:~/Wireless_drivers/wpc54g# ndiswrapper -i lstinds.inf
Installing lstinds
non:~/Wireless_drivers/wpc54g# ndiswrapper -l
Installed ndis drivers:
lstinds driver present, hardware present
non:~/Wireless_drivers/wpc54g#

Everything looks ok at this point, but when I tried to do the following which was the final step to get the Wireless Card Up and running reality strikes.....

non:~/Wireless_drivers/wpc54g# modprobe ndiswrapper
FATAL: Module ndiswrapper not found.

I have been able to successfully load the ndiswrapper module with the original kernel that is installed i.e. 2.6.8-2-386 but I am not able to do so with 2.6.8

The output of my module direcotory is as follow:

non:~# ls -l /lib/modules/
total 6
drwxr-xr-x 4 root root 1024 2005-08-05 09:03 2.6.8
drwxr-xr-x 6 root root 1024 2005-08-05 08:52 2.6.8-2-386
drwxr-xr-x 3 root root 1024 2005-08-05 08:52 2.6.8-2-686
drwxr-xr-x 3 root root 1024 2005-08-05 08:52 2.6.8-2-686-smp
drwxr-xr-x 3 root root 1024 2005-08-05 08:52 2.6.8-2-k7
drwxr-xr-x 3 root root 1024 2005-08-05 08:51 2.6.8-2-k7-smp

Also I checked the /lib/modules/2.6.8-2-386/misc directory and I found ndiswrapper.ko module in there but there was nothing in /lib/modules/2.6.8/misc directory.

Then I copied the ndiswrapper.ko module from /lib/modules/2.6.8-2-386/misc
to /lib/modules/2.6.8/misc

non:~/Wireless_drivers/wpc54g# modprobe ndiswrapper
FATAL: Module ndiswrapper not found.

Then I ran depmod -a and tried again and now I get a different error message:

non:~# modprobe ndiswrapper
FATAL: Error inserting ndiswrapper (/lib/modules/2.6.8/ndiswrapper.ko): Invalidmodule format


Any ideas? I guess the problem is because I am using a different kernel version and the ndiswrapper is for 2.6.8-2-386 and not for 2.6.8.

How can I correct this error?

Thank you in advance.