# ndiswrapper configuration probs [solved]

## Valhalla

```

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

```

What could be causing this?

----------

## GordSki

Have you rebuilt your kernel or upgraded your kernel recently?

I've seen this kind of message when modules don't match version of the kernel running.

If you have try remerging ndiswrapper.

G.

----------

## Generation 2

Im not sure about this but last time i tried ndiswrapper was masked... maybe they havent fixd it completely yet. Try using the original code instead if the ebuild. It worked for me. the source code can be found at http://ndiswrapper.sourceforge.net

----------

## Valhalla

I didn't upgrade my kernel, that was the problem.  My version magic wasn't jiving.  I recompiled my system with gcc 3.4, but never recompiled the kernel.  So I just recompiled my kernel and ndiswrapper and the module loads now.  Thx. :Cool: 

I am however getting some wierd output from ndiswrapper -l

```

Unknown line at line 5583

Unknown line at line 5584

Unknown line at line 5585

Unknown line at line 5586

Unknown line at line 5587

Unknown line at line 5588

Unknown line at line 5589

Unknown line at line 5590

Unknown line at line 5591

Unknown line at line 5592

Unknown line at line 5593

Unknown line at line 5594

Unknown line at line 5595

Unknown line at line 5596

Unknown line at line 5597

Unknown line at line 5598

Unknown line at line 5599

Unknown line at line 5600

Unknown line at line 5601

Unknown line at line 5602

Unknown line at line 5603

Installed ndis drivers:

wusb54g driver present 

```

Is that bad?  I haven't been able to test if the driver works yet, since I'm doing this in preparation of when I get home from college where there is only a wireless network.

----------

## GordSki

Glad you solved the module format thing  :Very Happy: 

I've come across driver from manufacturers where they put their entire product base in one driver file. It could be that this is the case for yours and ndiswrapper doesn't like the inf file lines for the other products, this is probably not going to affect the driver as it seems to be picking a good driver. You can check out the files in '/etc/ndiswrapper/' to be sure that you've not got any other windows drivers installed that ndiswrapper doesn't like.

The other thing to do is to check the website for which driver they recommend for the adaptor you have, here's the URL: http://ndiswrapper.sourceforge.net/. The important thing with this is to find out what chipset you have and use the recommended driver for that, it may not be from the company that made your card  :Very Happy: 

G.

----------

## Valhalla

That makes sense.  I followed the link from the sourceforge site to the linksys driver downloads page, so I assume thats their recommended driver.  The proper files seem to be installed for the driver I have.  As for the actually internet devices, if I have the ndiswrapper installed, will eth0 or eth1 appear once I have the usb antennae plugged in?

----------

## Valhalla

So, I am now attempting to get my wireless working using the wpa_supplicant.  Ndiswrapper is now properly loaded, and ndiswrapper -l yeilds

```

installed ndis drivers:

wusb54gv2 driver present, hardware present

```

note: I discovered I needed to use the v2 drivers.

dmesg shows that the ndiswrapper module is in the kernel, and it tells me its loaded as a usb driver, but I don't get a message telling me that it is at net.wlan0/ some other interface.

I've tried starting wpa_supplicant.  That tanks with

eth1: no interface: no such device

even though I could have sworn I set my conf.d/net to use wlan0

I've tried starting both eth1 and wlan0 with the symlinks

neither of those works, error messages about no such device.

I'm using a linksys base and antennae.

p.s. I've never set up a wireless network for linux before, and I had a little trouble following some of the documentation.  Its entirely possible that I missed a critical and rather obvious step.  Oh, and the little light for the wireless antennae lights up while its plugged in, which I take as a good sign.

----------

## GordSki

Try running the following command:

```

/sbin/ifconfig -a

```

This should list all the network devices on the machine.

G.

----------

## Valhalla

All I have is eth0 and lo.

eth0 should be my ethernet card, which I was using at college up until now.

----------

## GordSki

Can you post the section of the kernel that refers to ndiswrapper?

G.

----------

## Valhalla

```

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

usbcore: registered new driver ndiswrapper

```

----------

## GordSki

Here's the output of my ndiswrapper:

```

ndiswrapper version 1.1 loaded (preempt=no,smp=no)

ndiswrapper: driver netgtks (Sitecom,11/20/2001,1.0.0.9) loaded

PCI: Enabling device 0000:00:13.0 (0004 -> 0006)

ACPI: PCI interrupt 0000:00:13.0[A] -> GSI 18 (level, low) -> IRQ 18

ndiswrapper: using irq 18

wlan0: ndiswrapper ethernet device 00:90:4b:22:5c:28 using driver netgtks, configuration file 14E4:4320:182D:906E.5.conf

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

usbcore: registered new driver ndiswrapper

```

Mine isn't a USB device but I still get the message at the end there.....

Which device is it your using?

G.

----------

## Valhalla

I'm using a linksys WUSB54Gv2.  I currently have reason to beleive that inside router something, somewhere is misconfigured or broken.  I tried to establish a connection using the same antennae using a windows machine, manual failed to connect and the setup wizard told me it couldn't find compatible hardware.

sigh...

----------

## GordSki

The output you posted looks a little short.... I don't think ndiswrapper is spotting your device when it is loaded......

If you manage to get it working under windows, post a message to the ndiswrapper mailing list  ndiswrapper-general@lists.sourceforge.net. The developers monitor the mailing list quite closely and you should get a quick response.

Sorry I can't be of more help....

G.

----------

## Valhalla

So I got the device working under windows, apparently I had an incorrect install CD.  I looked into it somemore, and the provided antennae is the speedbooster model.  I was under the impression it was the same chipset as the standard, although there is actually a different driver.  However, I downloaded the new driver and upacked it with unzip, I couldn't find an .inf file anywhere.  Anyone know where that would be.

----------

## GordSki

If the zip file contains a setup.exe and a few .cab files, the acutal driver should be in the cabs.

Try using "unshield" to upack the cabs, if that doesn't work try "cabextract".

Edit: Both are in portage by the way.

G.

----------

## Valhalla

cabextract tells me that Its an unsheild file.  However, I currently don't have an internet connection, I have a related question.  If I download the unsheild tarball from a portage mirror and put it in distfiles, will it install properly?

----------

## GordSki

Yes, should do. Just make sure you get the version that matches the version portage wants to install.

G.

----------

## Valhalla

Ok, so I successfully unpacked the data1.cab and data2.cab and that created about 50000000000 new directories.  In the process of wading through them I found a WUSB54GS.inf in TARGETDIR.

So, I 

ndiswrapper -i WUSB54GS.inf

and did ndiswrapper -l and I got

```

installed ndis drivers:

wusb54gs invalid driver!

```

I'm assuming this is because there are no .sys files in same directory as the .inf.  Do I need to find the .sys files and put the .inf with them before installing, or did I maybe overwrite them when I unpacked the 2nd .cab?

----------

## GordSki

I think this is the problem:

```

; Windows XP specific sections -----------------------------------

[RNDIS.NT.5.1]

Characteristics = 0x84   ; NCF_PHYSICAL + NCF_HAS_UI

BusType         = 15

DriverVer       = 06/18/2004,1.0.0.1

AddReg          = RNDIS_AddReg_NT, RNDIS_AddReg_Common,ABer.reg

; no copyfiles - the files are already in place <-------- THIS LINE HERE

```

It seems to suggest that XP already has the required files for the driver. ndiswrapper use the XP section of the inf file to get the drivers, which means that it isn't getting any of the files in this case. I would post the inf file to the mailing list I mentioned above and ask if anyone can help you there. I've tried hacking the inf a bit but I didn't get anywhere  :Rolling Eyes: 

G.

----------

## Logge

 *Valhalla wrote:*   

> All I have is eth0 and lo.
> 
> eth0 should be my ethernet card, which I was using at college up until now.

 

Try iwconfig. It creates a wlanX device for You to conf with ifconfig.

Well, It works for me...

// Logge

----------

## Valhalla

When I try iwconfig, I'm told that neither eth0 or lo have wireless extensions.

I tried reading the .inf file for the files it seems to need.  I put usb8023k.sys and rndismk.sys in the directory created by the install and I get driver present, hardware present now.  However, when I load the ndiswrapper module dmesg gives me this now.

```

ndiswrapper version 1.1 loaded (preemt=yes.smp=yes)

ndiswrapper: driver wusb54gs (Linksys, 06/18/2004,1.0.0.1) loaded

ndiswrapper (ndiswrapper_add_one_dev:317): Windows driver couldn't initialize the device (C0010006)

ndiswrapper: probe of 1-8:1.0 failed with error -22

ndiswrapper (ndiswrapper_add_one_dev:317): Windows driver couldn't initialize the device (C0010006)

ndiswrapper: probe of 1-8:1.1 failed with error -22

usbcore: registered new driver ndiswrapper

```

I feel like I'm getting closer, because now its actually loading a driver.

----------

## GordSki

I've just checked and XP comes with both these files already installed. It appears to be a generic NDIS interface for USB network devices. If you have access to a windows XP machine, try copying the files from it. They're in "WINDOWS\SYSTEM32\DRIVERS" and don't have 'k's on the end of the names.

G.

----------

## Valhalla

GordSki you are me new favorite person, cuz I'm typing this on my newly networked box.

 :Very Happy:   :Very Happy:   :Very Happy:   :Very Happy:   :Very Happy:   :Very Happy:   :Very Happy:   :Very Happy:   :Very Happy:   :Very Happy:   :Very Happy:   :Very Happy: 

That worked like a charm, and I just had to iron out a few configuration problems, and now I'm up and running.

----------

## GordSki

Glad to hear it!  :Very Happy: 

You should let the ndiswrapper guys know what you did so they can add the card to their list.

It's always good when these things work out  :Wink: 

G.

----------

## Valhalla

One last question.  Periodically, I now seem to get hard locks at random intervals.  When I check the logs, they seem to contain a whole lot of call traces from [ndiswrapper].  Do you know what could be happening?

----------

## Logge

Hard locks as in computer-locks-nothing-else-but-powerbutton type of thing?? I got them too but havent checked logs...

// Logge

----------

## Valhalla

Yeah, that kind of lock.  And I tried recompiling ndiswrapper w/ no optimizations, and now it is all kinds of screwed up.  dmesg shows a wlan0 device using the ndiswrapper driver, but ndiswrapper -l is insisting that the hardware isn't there, and I can't start net.wlan0 anymore.  Sigh...

----------

## GordSki

Can you post the section of log?

I've been running the current version of nidswrapper for months and haven't had any hangs..... I guess it probably to do with the windows part of the driver.

G.

----------

## Valhalla

Thats really weird, because even when I don't have the antennae plugged in, I get lockups reliable after about 30 minutes.  I modprobe -r ndiswrapper, and the system ran fine for 18+ hours.  And I did a stage 3 install back in the day, and just left the CFLAGS the way they were.  Generally though these lockups seem to occur when I'm typing in an xterm or when I just leave the system sitting for a long time.

----------

## GordSki

One thing to check is that you don't have "CONFIG_4KSTACKS" set in your kernel config.

G.

----------

## Valhalla

So, I've decided my box is on crack, anyway...

CONFIG_4KSTACKS is not set.

Here is the relevant parts of log, it is hand transcribed, so it isn't complete.

```

EIP: 0060:[<c011a3e0>] Tainted: P VLI

EFLAGS:  00010206  (2.6.11.gentoo-r9)

EIP is at acquire_console_sem+0x10/0x40

eas: dff1e000 ebx:C0534060 exc:c14e1610

esi:c14e1600 edi:c0534064  edp:00000000

ds:007b es:007b ss:0068

Process events/0 (pid:6, threadinfo=dff1e000, task=c14e5a80)

Stack: c029370 0000202 c1ue1618 ...lots more hex numbers...

Call trace:

[<c029370c>] console_callback+0xc/0xf0

[<c012a579>] worker_thread+0x1b9/0x260

[<c0115980>] default_wake_function+0x0/0x20

[<c0115980>] default_wake_function+0x0/0x10

[<c012a3c0>] worker_thread+0x0/0x260

[<c012ea5a>] kthread+0xba/0xc0

[<c012ea5a>] kthread+0x0/0xc0

[<c01009f5>] kernel_thread_helper+0x5/0x10

Code: ff 80 7b02 3e0f85 12 ff ... more stuff like this...

          ... 08 <0f> 0b ...

          ... three lines total...

<0> Kernel Panic: not syncing: fatal exception in interrupt

```

This occurred immediately after an emerge --sync with X turned off.  Similar hardlocks occured with X running, usually when typing in firefox.  I wasn't able to find the exact log, cuz I'm not quite sure where they are stored in /var/log/  this is what printed on the screen.  I have lan connectivity back, apparently my baselayout downgraded after my last emerge -u world when I was trying to fix this... I'm so confused  :Confused: 

I am wondering if this has something to do with the ~x86 packages I had to use in order to get wireless working.  Since it occurs mostly in a shell, and I had to use base-3.0 from ~x86.  Thats just an association that clicked in my head as I was thinking about this.  I googled for Kernel Panic: not syncing and all the hits I got dealt with Gnome VFS, which I don't feel is really relevant.

----------

## GordSki

Which ~x86 packages do you have installed?

G.

----------

## Valhalla

sysvinit, baselayout, bash, and readline as per the wiki instructions at http://gentoo-wiki.com/HOWTO_Wireless_Configuration_and_Startup

I also have ~x86 for blender, cinelerra-cvs and jahshaka, but those aren't system related.

----------

## Valhalla

I have further experimented, this problem occurs with all of the kernels I have which include:

2.6.10-gentoo-r7

2.6.11-gentoo-r9

2.6.8-r1 

2.6.11-ck7-r1

Everytime I type in a a terminal windows after using the network, the computer locks up.  Everytime I type in firefox after using a terminal, the computer locks up.  If I leave the computer alone for more than two hours with ndiswrapper loaded and come back, 75%+ the computer is locked up.

----------

## GordSki

I don't think it's ndiswrapper itself that is causing the problem and the only one of the packages you mentioned that I think could cause a kernel panic is sysvinit. I'm guessing it's the windows wireless driver. To check this you could unintall the driver and load the ndiswrapper module and see if you still get the locks.

I haven't seen anyone using this driver with ndiswrapper, but I did come across people using Linuxant's DriverLoader: http://www.linuxant.com/driverloader/

EDIT: which you have to pay for by the way  :Crying or Very sad: 

G.

----------

## Valhalla

Hmmm..., I shall experiment further.  Just curious, is there any real difference between the Linuxant thing and ndiswrapper.  They seem to be the same thing, and ndiswrapper's card list seems longer...

----------

## Valhalla

Ok, so I was looking at linuxant's thing, and I figured that I would download the free trial and if at the end of say 25 days I hadn't had a kernel panic, I would just go ahead and buy it, when I came across something that said that some windows drivers require a 12k stack size.  Now, I know the standard kernel tree only seems to go up to 8K but I remember some of the nitro kernels had stacks that went all the way up to like 64K.  Would that be something that might aleviate the problem?

----------

## GordSki

It's worth looking at. That's the kind of thing that I think would cause the kernel to panic.....

What you could do is find the patch that allows for larger stacks and see if you can work it into the kernel source tree you've got from Gentoo. Save you having to go with a completely unsupported (from a gentoo point of view) kernel.  :Shocked: 

Good luck and let us know how it goes!  :Smile: 

G.

----------

## Valhalla

I don't suppose you know where I could get either a patch or a patched  kernel.  I've spent about 2 hours going through google trying to find one, and all I find are a bunch of kernel rpm's.  I tried the current nitro sources, just to see if I could get a working kernel with larger stacks, but the latest version doesn't support it, and the one I know had it is taken down...

...at this point I'm about ready to go change the #define THREAD_SIZE myself and hope for the best.

----------

## GordSki

Here's a thread that contains what looks like a patch to 16K.

http://www.ussg.iu.edu/hypermail/linux/kernel/0202.1/0087.html

I doubt you'll be able to apply the patch directly..... Have a look and see how it compares to the current kernel sources.

EDIT: Here's the reponse from the ndiswrapper guys.

 *Quote:*   

> 
> 
> RNDIS (I guess that is what you are describing) doesn't work with
> 
> ndiswrapper. The last time I checked, ndiswrapper didn't crash kernel, it just
> ...

 

G.

----------

## Valhalla

So, after wading through sites, I found a noarch source rpm for a patched FC2 kernel hiding on linuxant's website.  I installed it, and...

      it crashes just like the 8K stack one, though not quite as quickly.

 :Crying or Very sad: 

----------

## GordSki

Well, it looks like DriverLoader is the only option.....

At least you tried  :Very Happy: 

G.

----------

## Valhalla

Yeah, thanks for the help.

----------

## GordSki

No problem. It's been interesting finding out about this mystery Windows XP driver  :Shocked: 

G.

----------

## Valhalla

Yeah, so as a last ditch effort to not use driver loader, I dug out an old dell truemobile 1180 802.11b,  I now have it "installed"  ndiswrapper lists it as driver present, hardware present, but when I load the ndiswrapper module it doesn't give me an interface.  It doesn't even say anything about the device, period.  

If you know whats wrong, great, if you don't, don't stress, I'll just go with DriverLoader.

----------

## GordSki

All the sites seem to say it works.... Check that the driver dir created by ndiswrapper has a sys file in it.

I've just tried installing the latest driver from dell and it does copy a sys file, so if yours doesn't try the latest.

G.

----------

## Valhalla

Been on vacation...  :Very Happy: 

So, the newest Dell drivers solved that, just have to reconfigure to use wep, which brings me to my next problem.  Initializing the wireless interface fails with unable to set wep in the driver.  The wireless driver/card don't support wep, and I thought I set wpa_supplicant to use a wep network, but it just isn't working.

On a side not, the windows drivers for the wusb54g are insanely bootleg, because I get kernel panics using driverloader as well.  I'll just hope the prism guys get usb support working in the not too distant future.

----------

## GordSki

I glad the Dell card works. Unfortunatly I know next to nothing about wpa_supplicant..... However, I don't think you can use it to manage straight WEP, but I could be wrong.  :Very Happy: 

G.

----------

## Valhalla

Oh, bummer...

----------

## Logge

I've read somewhere tha wpa_supplicant supports wep-key's.

Should be in the manual or something...

//Logge

----------

## Valhalla

I just configured it with iwconfig, suprisingly, both seem to be working with the 8K stacks using just wep.  As far as I can tell, right now, I'm using the older antennae, but for 5 hours the new antannae worked fine.

 :Cool: 

----------

## GordSki

Well fingers crossed  :Very Happy: 

G.

----------

## Valhalla

I pronounced it fixed.  It has a few odd bugs:

after a while the terminal windows stop responding properly, typing single letters results in 20+ of the same letter

name resolution fails on the internet after extended periods of use...

other minor annoyances.

Reloading the ndiswrapper module seems to solve all these problems, so I wrote a script that does it for me, and set fcron to run it ever 3 hours, so I just don't have to deal with it.  

On a side not, the old antennae I got working is listed as incompatible with SP2, and I was gonna throw it out.  I find it hilarious that a piece of hardware built for windows works in linux and not windows  :Wink: 

----------

