Page 1 of 2 12 LastLast
Results 1 to 10 of 55

Thread: Fixing ndiswrapper invalid cmd 12

Hybrid View

  1. #1
    Join Date
    Feb 2005
    Beans
    100

    Fixing ndiswrapper invalid cmd 12

    The latest ndiswrapper will not work with WEP or WPA due to (as I understand) this bug:



    If dmesg returns several lines like these:

    [ 227.277096] ndiswrapper (iw_set_auth:1602): invalid cmd 12
    then you're affected.

    I got it to work on Karmic by building my own ndiswrapper - here's a brief howto for those who, like me, are new to the compiling business. It requires that you know how to use a terminal.

    I used these instructions, slightly modified:
    https://help.ubuntu.com/community/Wi...%20ndiswrapper

    First off, if the computer (computer A) does not have the internet connexion required to install the various tools for building ndiswrapper, the required packages can very easily be downloaded on a different computer (computer B from now on) and transferred by means of USB memory, CD, Bluetooth, avian carrier..
    This assumes both computers are running exactly the same version of Ubuntu. If not, you shall have to find another way of downloading the required packages. In theory, I presume this method would also work in that case:
    1. copy /etc/apt/sources.list from the computer A, to computer B (back up the current sources.list on computer B!)
    2. run sudo apt-get update on computer B
    3. download the packages as instructed below
    4. restore the old sources.list on computer B

    If computer A has indeed a working connexion, just run
    Code:
    sudo apt-get install linux-headers-$(uname -r) dh-make fakeroot gcc-4.4 build-essential
    and skip to step 5.

    On computer B:

    1. Empty your /var/cache/apt/archives directory. This seems to be where aptitude keeps installation files, so emptying it appears harmless, but you must be root:

    Code:
    sudo rm /var/cache/apt/archives/*.deb
    Do not delete *, as this dir contains the file lock and the dir partial!

    2. Find out which kernel computer A has by executing..

    Code:
    uname -r
    which will return something like..

    2.6.31-15-generic
    3. Download the packages required to install the build environment. Insert computer A's kernel version into the linux-headers- package name, as below:

    Code:
    sudo apt-get -d --reinstall install linux-headers-2.6.31-15-generic dh-make fakeroot gcc-4.4 build-essential
    The -d switch will instruct aptitude to just download the files, and not install them. Not sure whether --reinstall is actually needed, but I assumed that if computer B already has any of these packages or dependencies installed, then it wouldn't download them again. The wiki instructions says to use gcc-3.4, but this is not available so 4.4 will have to do.

    4. When apt is done downloading, transfer all the .deb files in /var/cache/apt/archives to computer A. To install, run this from within the directory you placed the .deb files:

    Code:
    sudo dpkg -i ./*
    Once done, you will have your build environment set up.

    5. Get ndiswrapper 1.55 (currently the latest exhibiting the aforementioned bug) here: http://sourceforge.net/projects/ndis...ar.gz/download

    6. Unpack the downloaded tar on computer A and change directory:

    Code:
    tar xvfz ndiswrapper-1.55.tar.gz
    cd ndiswrapper-1.55/driver
    7. Get the patch by Rene van Paassen:
    http://sourceforge.net/tracker/?func...82&atid=604450
    (click Attached file and download iw_ndis.c.diff)

    Place this file in ndiswrapper-1.55/driver and run:

    Code:
    patch < iw_ndis.c.diff
    8. I encountered yet another bug with this version, which prevented me from compiling, with the error:
    error: implicit declaration of function 'cmpxchg8b'
    Perhaps it would be wise to try steps 9 and onwards and see if it works, and only apply this patch if you encounter the same bug!
    There's a patch though.. http://bugs.gentoo.org/show_bug.cgi?id=280057
    Right click and save ndiswrapper-2.6.31.patch and place this in ndiswrapper-1.55/driver as well and run:

    Code:
    patch < ndiswrapper-2.6.31.patch
    9. Clean up your current system (cd out of drivers!):

    Code:
    cd ..
    sudo make uninstall
    As it instructs you, keep running it until it does not output any more lines beginning with "removing".

    10. Then:

    Code:
    sudo make
    followed by

    Code:
    fakeroot
    and

    Code:
    sudo make install
    11. The wiki instructions aren't clear on this, but I believe you need to run exit at this point to get out of fakeroot, so run:

    Code:
    exit
    You should now have a working version of ndiswrapper.
    Have I missed anything?
    Last edited by W. Irving; December 2nd, 2009 at 05:44 PM.

  2. #2
    Join Date
    Oct 2009
    Beans
    3

    Re: Fixing ndiswrapper invalid cmd 12

    Thanks for this excellent description. Everything worked like described. Even the error in step 8 occured and could be fixed.

    /Claus

  3. #3
    Join Date
    Feb 2005
    Beans
    100

    Re: Fixing ndiswrapper invalid cmd 12

    Quote Originally Posted by clausfse View Post
    Thanks for this excellent description. Everything worked like described. Even the error in step 8 occured and could be fixed.

    /Claus
    Glad it worked! Hope the repo version will patched soon.

  4. #4
    Join Date
    Apr 2005
    Beans
    1,377

    Re: Fixing ndiswrapper invalid cmd 12

    Strangely enough it has fixed the problem with cmd 12, but I still could not connect to the network which uses WPA encryption
    ASUS K53S UbuntuGnome 17.04 64-bit
    Two Dell laptops with 16.04

  5. #5
    Join Date
    Oct 2007
    Beans
    333

    Re: Fixing ndiswrapper invalid cmd 12

    i did the following patch on two ubuntu PCs that have the dmesg error.

    Following your tutorial (which installed perfectly) the dmesg error went.

    However this did not solve the issue of ndiswrapper not working correctly on secured networks.

    Hopefully a patch will come out soon!
    Intel Core 2 Duo 2x 2.33Ghz, FP-IN9 SLI mobo, 2Gb 800Mhz RAM, 256mb GeForce 7300 LE graphics, 120Gb IDE HD, 400Gb IDE HD,

  6. #6
    Join Date
    Feb 2005
    Beans
    100

    Re: Fixing ndiswrapper invalid cmd 12

    Thanx to all for posting back your results!

    While the procedure worked for me, I could not, as you, get my device to work with encrypted networks. I attributed this issue to wpa_supplicant instead, but now it would seem ndiswrapper is in fact to blame after all..

    Has anyone actually got ndiswrapper 1.55 to work with WEP or WPA?

  7. #7
    Join Date
    Mar 2009
    Beans
    141

    Re: Fixing ndiswrapper invalid cmd 12

    Thank you so much for this how to. It solved a problem that was driving me crazy!

  8. #8
    Join Date
    Mar 2008
    Beans
    4

    Re: Fixing ndiswrapper invalid cmd 12

    Thank you very much I have now successfully installed ndiswrapper1.55 , hurrrayy

  9. #9
    Join Date
    Jan 2010
    Beans
    3

    Re: Fixing ndiswrapper invalid cmd 12

    I followed the instructions from the original post and that fix the "invalid cmd 12 error", but I still was unable to connect to my access point.

    I also tried the following command, but was still unable to connect.
    sudo renice +19 $(pidof wpa_supplicant)

    After some searching I found another thread pointing to the kernel as the problem http://ubuntuforums.org/showthread.php?t=1284891

    In short it was stating that kernel 2.6.31-10 was working and kernel 2.6.31-11 + was not. I thought that I would just downgrade to the older kernel, but I was unable to locate the headers for 2.6.31-10. I looked in the ubuntu repository to see was was available and found 2.6.32-10. This kernel isn't seen by the update manager, so I thought that I would try this newer kernel first.

    I downloaded and installed the kernel and headers for 2.6.32-10 manually.

    After installing 2.6.32-10 I rebooted and was connected to my wireless network without the need to renice. I have rebooted several times to make sure it wasn't a one off, so far so good.

    I hope this helps those that are still having problems connecting.

  10. #10
    Join Date
    Aug 2007
    Beans
    73

    Re: Fixing ndiswrapper invalid cmd 12

    Quote Originally Posted by brocie View Post
    In short it was stating that kernel 2.6.31-10 was working and kernel 2.6.31-11 + was not. I thought that I would just downgrade to the older kernel, but I was unable to locate the headers for 2.6.31-10. I looked in the ubuntu repository to see was was available and found 2.6.32-10. This kernel isn't seen by the update manager, so I thought that I would try this newer kernel first.

    I downloaded and installed the kernel and headers for 2.6.32-10 manually.

    After installing 2.6.32-10 I rebooted and was connected to my wireless network without the need to renice. I have rebooted several times to make sure it wasn't a one off, so far so good.

    I hope this helps those that are still having problems connecting.
    Brocie,

    Where did you find the kernel and how did you install it? I have the same problem and I'd like to try this method. But I couldn't find the kernel anywhere. This is on MythBuntu 9.10 so I'm hoping everything will work with the new kernel.

    Thanks

    IceCap

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •