Page 1 of 6 123 ... LastLast
Results 1 to 10 of 55

Thread: Fixing ndiswrapper invalid cmd 12

  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,395

    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 Zenbook 14 Ubuntu 22.10

  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
    Oct 2007
    Beans
    333

    Re: Fixing ndiswrapper invalid cmd 12

    Update: I have got my WPA connections to work after reading this:

    http://ubuntuforums.org/showthread.php?t=1284891

    So in short if you are using ndiswrapper with WPA connection and are unable to connect. Follow the above tutorial.


    However if you are still unable to connect. Then try running the command below when trying to connect.

    Code:
     sudo renice +19 $(pidof wpa_supplicant)
    worked for me on x2 computers.
    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,

  8. #8
    Join Date
    Feb 2005
    Beans
    100

    Re: Fixing ndiswrapper invalid cmd 12

    After a bit more fiddling about, I've tried compiling ndiswrapper versions 1.53 & 1.54.
    My conclusions are as follows..

    1.53 and earlier will not work, due to the switch to a more recent kernel which drops support for some ancient network API:
    /home/elias/Skrivbord/ndiswrapper-1.53/driver/ntoskernel_io.c: In function ‘IoConnectInterrupt’:
    /home/elias/Skrivbord/ndiswrapper-1.53/driver/ntoskernel_io.c:566: warning: passing argument 2 of ‘request_irq’ from incompatible pointer type
    include/linux/interrupt.h:116: note: expected ‘irq_handler_t’ but argument is of type ‘void (*)(int, void *)’
    /home/elias/Skrivbord/ndiswrapper-1.53/driver/wrapndis.c: In function ‘notifier_event’:
    /home/elias/Skrivbord/ndiswrapper-1.53/driver/wrapndis.c:1693: error: ‘struct net_device’ has no member named ‘open’
    /home/elias/Skrivbord/ndiswrapper-1.53/driver/wrapndis.c: In function ‘ndis_start_device’:
    /home/elias/Skrivbord/ndiswrapper-1.53/driver/wrapndis.c:1749: error: ‘struct net_device’ has no member named ‘open’
    /home/elias/Skrivbord/ndiswrapper-1.53/driver/wrapndis.c:1750: error: ‘struct net_device’ has no member named ‘hard_start_xmit’
    /home/elias/Skrivbord/ndiswrapper-1.53/driver/wrapndis.c:1751: error: ‘struct net_device’ has no member named ‘stop’
    /home/elias/Skrivbord/ndiswrapper-1.53/driver/wrapndis.c:1752: error: ‘struct net_device’ has no member named ‘get_stats’
    /home/elias/Skrivbord/ndiswrapper-1.53/driver/wrapndis.c:1753: error: ‘struct net_device’ has no member named ‘change_mtu’
    /home/elias/Skrivbord/ndiswrapper-1.53/driver/wrapndis.c:1754: error: ‘struct net_device’ has no member named ‘do_ioctl’
    /home/elias/Skrivbord/ndiswrapper-1.53/driver/wrapndis.c:1758: error: ‘struct net_device’ has no member named ‘set_multicast_list’
    /home/elias/Skrivbord/ndiswrapper-1.53/driver/wrapndis.c:1759: error: ‘struct net_device’ has no member named ‘set_mac_address’
    /home/elias/Skrivbord/ndiswrapper-1.53/driver/wrapndis.c:1774: error: ‘struct net_device’ has no member named ‘poll_controller’
    (required patching with http://connie.slackware.com/~alien/s...l_2.6.27.patch)

    1.54 is will not compile unless line 1747 of driver/wrapndis.c is changed from
    Code:
    .poll_controller = ndis_poll_controller;
    into
    Code:
    .ndo_poll_controller = ndis_poll_controller,
    While make succeeds, this happens:
    /home/elias/Skrivbord/ndiswrapper-1.54/driver/ntoskernel_io.c: In function ‘IoConnectInterrupt’:
    /home/elias/Skrivbord/ndiswrapper-1.54/driver/ntoskernel_io.c:566: warning: passing argument 2 of ‘request_irq’ from incompatible pointer type
    include/linux/interrupt.h:116: note: expected ‘irq_handler_t’ but argument is of type ‘void (*)(int, void *)’
    And the results are the same as with 1.55.

    While I can't be certain ndiswrapper is actually at fault, and not wpa_supplicant, the number of reports here pointing to ndiswrapper being the culprit makes it seem likely.

  9. #9
    Join Date
    Feb 2005
    Beans
    100

    Re: Fixing ndiswrapper invalid cmd 12

    Quote Originally Posted by hellomoto View Post
    Update: I have got my WPA connections to work after reading this:

    http://ubuntuforums.org/showthread.php?t=1284891

    So in short if you are using ndiswrapper with WPA connection and are unable to connect. Follow the above tutorial.


    However if you are still unable to connect. Then try running the command below when trying to connect.

    Code:
     sudo renice +19 $(pidof wpa_supplicant)
    worked for me on x2 computers.

    Didn't work for me, but thanx for the suggestion! Might be of use to someone else.

  10. #10
    Join Date
    Apr 2009
    Beans
    2,601

    Re: Fixing ndiswrapper invalid cmd 12

    Quote Originally Posted by W. Irving View Post
    Didn't work for me, but thanx for the suggestion! Might be of use to someone else.



    The cmd 12's are gone, but that patch didn't work for me either with WPA2.

Page 1 of 6 123 ... 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
  •