# ndiswrapper and kernel recompile

## nanoo

Hi,

I've just put Gentoo on a new system, and I have run into a problem with my wireless. Basically, I initially compiled the kernel with what I thought was everything that I would need. I emerged ndiswrapper, wrapped the windows drivers, and everything went fairly smoothly - I had no problems at all with the wireless. 

Then, when I got around to sorting out ALSA, I realized that while I had built support for ALSA in the kernel, I hadn't built support for my particular sound card... so I recompiled the kernel making that one adjustment (just that one adjustment - nothing else was changed), and booted into the new kernel. When I did this, my wireless device was not found (wlan0 does not exist). Interestingly, ndiswrapper still seemed to think everything was fine, as when I ran 'ndiswrapper -l' it gave back

 *Quote:*   

> 
> 
> 2802w       drivers present, hardware present
> 
> 

 

So I booted into the old kernel, and I found that I had wireless without any problems, but of course no ALSA. So now I am in the awkward position in which I can have either wireless (old kernel) or ALSA (new kernel), but not both at once...

In searching these forms and google, I found that people who have had similar problems have resolved them just by running:

```

# emerge ndiswrapper

```

after booting into the new kernel, however I have tried this, and the problem remains. 

Has anyone has a similar situation, or think of any ideas I might try? 

Thanks,

nanoo

----------

## BoNd60

Is the module correctly started (take a look with lsmod and with dmesg for errors) ?

----------

## nanoo

Right, I should have mentioned that when I boot into the new kernel, it says that ndiswrapper was autoloaded as normal. But I hadn't looked with lsmod, and I forget what dmesg told me... I will try both those things when I get back from work. 

Thanks for the help - I'll post back once I check on those,

nanoo

----------

## nanoo

So lsmod and dmesg don't seem to come up with any errors:

```

blurn ~# lsmod

Module                Size      Used by

ndiswrapper          177968     -

```

and dmesg only had one line that seemed relevant:

```

blurn ~# dmesg | grep ndiswrapper

ndiswrapper version 1.8 loaded (preempt=yes,smp=yes)

```

It's kind of a strange problem... I don't know where else to look for errors....

Any help, or hints on where else to look would be much appreciated. 

Thanks,

nanoo

----------

## nanoo

Just posting back to say that removing the ndiswrapper driver and then reinstalling it didn't do anything... 

Not that I necessarily thought that it would resolve the issue, but I'm all out of ideas at this point. 

As before, any help is greatly appreciated!

nanoo

----------

## majin_boy

nanoo, I had a similar problem to yours when I upgraded from 2.6.12 to 2.6.15, ndiswrapper 'failed" to load and wpa_supplicant threw some errors. The way it was fixed was emerging a newer version of baselayout 1.12 instead of the 1.11 series.

otherwise, are there any errors in dmesg or /var/log/messages regardingthe wireless?

----------

## nanoo

Interesting - I will definately try emerging a newer baselayout, and see whether that can solve it. 

In terms of errors, dmesg has nothing suspicious (just that line saying that ndswrapper loaded), however I hadn't taken a look at /var/log/messages. I'll do that when I get from work, and see whether it has anything promising. 

Thanks for help,

nanoo

----------

## nanoo

Sorry for the delay in posting back - I was caught up with other things... However I am now back to trying to solve what has happened to ndiswrapper on this system. 

I emerged the newest baselayout that I could (1.12.0_pre15-r1), and ran dispatch-conf to update all the appropriate config files. However, this doesn't seem to have changed the situation... I still can connect on the originial kernel config (although I had to manually connect the first time before it would do so automatically), but when I boot into the new kernel config with ALSA support I am told wlan0 does not exist. As before, dmesg gives nothing with respect to wlan0, and only one line with respect to ndiswrapper, saying that it loaded without any problems. Reemerging ndiswrapper again failed to solve the solution again. 

I did check /var/log/everything/current after booting into the new kernel, however it doesn't provide many clues. The only relevant line is:

```

[rc-scripts] network interface wlan0 does not exist

```

The other errors are to do with problems starting sshd, vsftpd, and netmount, because of the inability to start net.wlan0...

I still can't really figure out why this problem would come up.... Is it possible that it's not an error with ndiswrapper, or is there anything else I should check? 

Thanks for the help,

nanoo

----------

## Allochtoon

nice avatar. try disabling smp and (maybe?) preempt.

----------

## nanoo

Well ordinarily I wouldn't be happy to see errors when trying to recompile the kernel, but in this case it might actually help me sort out what's wrong  :Smile: 

So I recompiled the kernel without support for smp and preempt, and everything was going fine until the very end, when this came up:

```

   INSTALL net/ipv4/netfilter/iptable_raw.ko

if [ -r System.map -a -x /sbin/depmod ]; then /sbin/depmod -ae -F System.map 2.6.15-gentoo-r1; fi

WARNING: /lib/modules/2.6.15-gentoo-r1/misc/ndiswrapper.ko needs uknown symbol _spin_lock_bh

WARNING: /lib/modules/2.6.15-gentoo-r1/misc/ndiswrapper.ko needs uknown symbol __per_cup_offset

WARNING: /lib/modules/2.6.15-gentoo-r1/misc/ndiswrapper.ko needs uknown symbol del_timer_sync

blurn linux #

```

I have to admit, those warnings don't mean much to me... can anybody help me out as to what they mean?

nanoo

Edit: So I copied the kernel anyways, and booted into it to see what would happen, and in this case ndiswrapper didn't load. I got the following errors in dmesg:

```

ndiswrapper: version magic '2.6.15-gentoo-r1 SMP preempt PENTIUMIII gcc-3.3' should be '2.6.15-gentoo-r1 preempt PENTIUMIII gcc-3.3'

ndiswrapper: version magic '2.6.15-gentoo-r1 SMP preempt PENTIUMIII gcc-3.3' should be '2.6.15-gentoo-r1 preempt PENTIUMIII gcc-3.3'

```

modprobing ndiswrapper came up with the following error:

```

blurn ~# modprobe ndiswrapper

FATAL: Error inserting ndiswrapper (/lib/modules/2.6.15-gentoo-r1/misc/ndiswrapper.ko): Invalid module format

```

Update:

I tried removing just SMP from the kernel, and I got the same errors as above. I then tried removing just preempt, and I found that I was back to the first situation where I had no errors in the kernel recompile, and ndiswrapper autoloaded without any fuss, but wlan0 still doesn't exist...

----------

## xtaski

Getting same errors... arrghh...

----------

## nanoo

Out of curiosity, xtaski, did the errors only come up after recompiling the kernel? What confuses me with this problem is that with the original kernel configuration it still works...

----------

## xtaski

Yeah it was when I switched from 2.6.14-r5 to 2.6.15-r2 --> going to try 2.6.15-r4 now

----------

## nanoo

Ok - well post back when you move back to the old kernel, and let me know how that goes. I think, in some ways, my situation is more bizarre in that my kernel recompile didn't involve upgrading... it just involved building in support for my audio card. I keep looking for other people who have had this problem, but I haven't had any luck so far. I'm starting to think it's not an ndiswrapper thing...

nanoo

----------

## xtaski

I misspoke - I wasn't "upgrading" - just updating kernel.

2.6.15-gentoo-r4 works fine. I upgraded, removed ndiswrapper and all caches in /var/tmp/portage and distfiles and then re-emerged.

It works now just fine.

----------

## nanoo

Hmmm... that is very, very interesting. I hadn't removed the caches in /var/tmp/portage, so maybe that has an effect... I will certainly try that, and post back what the result is. 

nanoo

----------

## xtaski

Yeah; i did both at the same time so I'm not sure if it was the newer kernel or the cache that did the trick... let me know what you find.

----------

## nanoo

Well, I hate to post back with yet more bad news, but deleting distfiles and the caches in /var/tmp/portage did not seem to work, nor did updating the kernel...

I did find out one more (possibly) important piece of information though. I erased ndiswrapper from /etc/modules.autoload/kernel2.6, and manually modprobe'd ndiswrapper with the old (working) kernel and the new (not working) kernel, and took a look at what happened in dmesg. This is the result:

Working kernel:

```

ndiswrapper version 1.2 loaded (preempt=yes,smp=yes)

ndiswrapper: driver 2802w (SMC,04/29.2004), 3.0.11.1) loaded

ACPI: PCI Interrupt 0000:00:10.0[A] -> Link [LNKD] -> GSI 11 (level, low) -> IRQ 11

ndiswrapper: using irq 11

wlan0: ndiswrapper ethernet device 00:04:e2:bb:a3:ac using driver 2802w, configuration file 1260:3890:1115:EE03.5.conf

wlan0: encryption modes supported: WEP, WPA with TKIP, WPA with AES/CCMP

wlan0 (WE) : Driver using old /proc/net/wireless support, please fix driver!

ndiswrapper (iw_set_tx)power:421): setting tx_power failed (C00000BB)

```

To avoid any confusion, despite the errors that show up, ndiswrapper loads without any problems that I have noticed. 

Not-Working kernel:

```

ndiswrapper version 1.2 loaded (preempt=yes,smp=yes)

```

So is the problem that ndiswrapper loads, but then doesn't progress to the part where it sets all the info for wlan0?

I'm out of ideas... What's especially frustrating is that I need wireless and ALSA working on this machine - it's the only reason for it's existance (it will become a music server, if everything works out...). I'm thinking a re-install might be a final (desperate) solution. I know that ndiswrapper works on this machine, and I can't believe that adjusting the kernel to build in support for my sound card would get in the way of that...

nanoo

----------

## xtaski

Odd that you say this b/c with my new kernel ALSA is not working... I have the opposite problem now - ndiswrapper works, ALSA does not...

----------

## xtaski

ok, 2.6.15-r5 fixed all my troubles - ALSA and ndiswrapper - not sure what it was with the prior ones...

have you tried uninstalling the windows driver and then reinstall? I had to do that once - completely remove the driver then reinstall it.

----------

## nanoo

Just tried removing and then reinstalling the Windows driver: same result. It was worth a shot though...

nanoo

----------

## xtaski

that's crazy... sure you deleted the cached build and then redownloaded, compiled, etc??

----------

## nanoo

Yeah, earlier I removed the driver in ndiswrapper, unmerged ndiswrapper, removed everything to do with ndiswrapper from /var/tmp/portage and /usr/portage/distfiles, then remerged ndiswrapper, and installed the driver again. I think it's the same problem each time: when I modprobe ndiswrapper it loads ndiswrapper but doesn't setup wlan0...

----------

