NDIS problems with pfSense



  • I'm trying to get a Realtek RTL8191SE card working on a nanoPC with pfSense, and through the magic of Google, stumbled across using Project Evil to wrap Windows drivers; however, I'd found and was following this documentation.

    Since I can't seem to find the "developer" version of pfSense (the downloads/developers mirrors just seem to give me empty directories ???) I loaded up a VM with a vanilla install of FreeBSD 8.1 (that's what 2.0.1 is based on right?), installed libiconv, and cranked out my rtl8192se_sys.ko and ndis.ko modules.

    Continuing to follow the instructions (from the first link in this post), I sneakernetted the modules to my pfSense box and dumped them in /boot/modules/ . Attempting to kldload them gives me an error regarding ndis, something to the effect of a "version mismatch" and another message about "file not found" (if i attempt to load rtl8192se_sys first) or about "file exists" (when attempting to load rtl8192se_sys after loading ndis first).  Unfortunately I'm at work right now and don't have the box with me, but does anyone have any thoughts as to what these errors might indicate?  Is the problem as simple as putting one or both modules in /boot/kernel instead (as I read about on the wiki), or do these errors possibly indicate a deeper issue?  Where can I get the developer version of pfSense?

    When I get home I'll post some more specific messages, but I won't be getting home until late tonight so I figured I'd make an initial inquiry and see if the information I have at hand is enough to tell someone more experienced with pfSense what's going on and possibly elicit some useful advice :)

    TIA!


  • Netgate Administrator

    There is no developer version of pfSense any more just use FreeBSD 8.1 as you correctly assumed.

    I've never tried ndisulator, it is evil after all.  ;)

    Is it a 32bit 64bit mismatch?

    Steve



  • Nah, I'd run into that initially, as I have a VPS that runs FreeBSD 8.1-amd64 and tried there first.  Then I realized that was a very silly thing to do, and got the x86 ISO and spun up a local VM based on that.

    Thanks for the info regarding the developer version.  Maybe someone should post a README in the /developers directory of the downloads that says there is no such thing any more, and to just use the appropriate vanilla FreeBSD release instead?



  • Okay, so I'm back home now… moved the ndis.ko and rtl8192se_sys.ko to /boot/kernel .  Rebooted, and tried loading the modules... here are the exact errors:

    
    [2.0.1-RELEASE][root@pfSense.localdomain]: kldload rtl8192se_sys
    KLD rtl8192se_sys.ko: depends on ndis - not available or version mismatch
    kldload: can't load rtl8192se_sys: No such file or directory
    
    [2.0.1-RELEASE][root@pfSense.localdomain]: kldload ndis
    
    [2.0.1-RELEASE][root@pfSense.localdomain]: kldload rtl8192se_sys
    KLD rtl8192se_sys.ko: depends on ndis - not available or version mismatch
    kldload: can't load rtl8192se_sys: File exists
    
    

    I compiled ndis.ko on the same system that I compiled the driver on, so I don't know why it would be complaining about a version mismatch; also, can't it make up its mind?  First it complains that the file doesn't exist, then it complains that it does.  What's that about?



  • I don't know the relationship between the two modules but I suspect
    @Doktor:

    
    [2.0.1-RELEASE][root@pfSense.localdomain]: kldload rtl8192se_sys
    KLD rtl8192se_sys.ko: depends on ndis - 
    

    means ndis should have been loaded BEFORE rtl8192se_sys. Sometimes its best to go back and correct the first mistake so I suggest you try (after rebooting)```

    $ kldload ndis
    $ kldstat
    $ kldload rtl8192se_sys
    $ kldstat


  • Netgate Administrator

    Probably just a typo but I notice you say you have an rtl8191se based card but are generating rtl8192se modules. They use the same driver anyway but does ndis know that?

    Steve

    Edit: I see the page you linked to also does this. What driver are you actually using? Have you checked the hardware IDs against your own?



  • Hmmm, I thought I'd already replied… my computer must've eaten it.  Anyways...

    wallabybob, I'll try it as you suggested when I get home tonight, but I do believe I already tried that at one point -- just throws the same error (second one) as when i do rtl>ndis>rtl

    stephenw10, the Realtek site takes me to the drivers called "8192SE" when I select the driver download for the 8191SE; I'm guessing they probably use the same chipset and thus same driver (the Linux driver source calls it "819x").  Of note though, I am using the Windows XP version of the driver -- I was doing so on the belief that ndisgen could only handle NDIS 5.x (I read that somewhere during my Googling), but more recently I seem to recall reading documentation where someone used a Vista driver... is there a chance that I might be able to get FreeBSD to play better with a wrapped Vista or Win7 driver?

    WRT the hardware ID, how would I determine the hardware ID in FreeBSD?  I used to bash video driver INFs to play with my laptop video cards, so it wouldn't be a large stretch for me to sub my card's hardware ID into this driver's INF to make it play nice.  This is a built-in card, so dropping it in a Windows system to determine the ID isn't really an option, and I don't know where my WinPE boot CDs are.


  • Netgate Administrator

    This driver:
    http://www.realtek.com.tw/downloads/downloadsView.aspx?Langid=1&PNid=21&PFid=48&Level=5&Conn=4&DownTypeID=3&GetDown=false&Downloads=true
    has win2K drivers as recommended on the page you linked to.

    You can find the pci vendor and device ids with:

    
    [2.0.1-RELEASE][root@pfsense.fire.box]/root(3): pciconf -lv
    hostb0@pci0:0:0:0:	class=0x060000 card=0x25788086 chip=0x25788086 rev=0x02 hdr=0x00
        class      = bridge
        subclass   = HOST-PCI
    pcib1@pci0:0:1:0:	class=0x060400 card=0x00000000 chip=0x25798086 rev=0x02 hdr=0x01
        class      = bridge
        subclass   = PCI-PCI
    pcib2@pci0:0:3:0:	class=0x060400 card=0x00000000 chip=0x257b8086 rev=0x02 hdr=0x01
        class      = bridge
        subclass   = PCI-PCI
    
    

    Steve



  • The 2K drivers are for the 8191SU, which if I'm not mistaken is their USB device.

    "pciconf -lv" yields the following:

    none2@pci0:2:0:0:       class=0x028000 card=0x817110ec chip=0x817110ec rev=0x10 hdr=0x00
       class      = network
    re0@pci0:3:0:0: class=0x020000 card=0x0d77105b chip=0x816810ec rev=0x06 hdr=0x00
       class      = network
       subclass   = ethernet

    with the former device being the wireless adapter.  Inside the INF file I used, the first line under the [Realtek.NTx86] header is
    %RTL8191seva.DeviceDesc% = RTL8192se.ndi, PCI\VEN_10EC&DEV_8171&SUBSYS_817110EC

    If I had to guess, I'd say "card" from pciconf represents the VENdor+DEVice (apparently in reverse order?) and chip represents the SUBSYStem?

    With regards to loading ndis > rtl8192se_sys directly after a fresh boot, I still get the error.  The exact output is as follows:

    [2.0.1-RELEASE][root@pfSense.localdomain]/root(3): kldload ndis
    [2.0.1-RELEASE][root@pfSense.localdomain]/root(4): kldstat
    Id Refs Address    Size     Name
    1    4 0xc0400000 1178ad8  kernel
    2    1 0xc6646000 19000    ndis.ko
    [2.0.1-RELEASE][root@pfSense.localdomain]/root(5): kldload rtl8192se_sys
    kldload: can't load rtl8192se_sys: File exists
    [2.0.1-RELEASE][root@pfSense.localdomain]/root(6): kldstat
    Id Refs Address    Size     Name
    1    4 0xc0400000 1178ad8  kernel
    2    1 0xc6646000 19000    ndis.ko


    EDIT: I just found a Win2K folder in the driver package I was using, and tried building that one instead… I get the same result.  However, attempting to load it in my FreeBSD VM spews some stuff but seems to load it fine anyways:

    bsdFu# kldload rtl8192se_sys
    no match for NdisMCreateLog
    no match for NdisMCloseLog
    no match for NdisMWriteLogData
    no match for ExCreateCallback
    no match for ExNotifyCallback
    bsdFu# kldstat
    Id Refs Address    Size    Name
    1  18 0xc0400000 bb5504  kernel
    4    1 0xc5988000 108000  rtl8192se_sys.ko
    5    1 0xc5a90000 d000    if_ndis.ko
    6    2 0xc5a9d000 19000    ndis.ko

    Of note (to me) is that there is an "if_ndis.ko" module loaded, which I don't have on my pfSense box.  Could this be causing the trouble?



  • Okay, so I tried adding the if_ndis.ko from my VM… it happily loaded up, so I attempted to load my Win2K driver again.  SSH just went kaput on me, so I flipped over to the screen and see the following (so close!  so damn close!)

    no match for ExCreateCallback
    no match for ExNotifyCallback
    no match for IoWMIQueryAllData
    no match for IoWMIOpenBlock
    ndis0: <realtek rtl8191se="" wireless="" lan="" 802.11n="" pci-e="" nic="">port 0xd800-0xd8ff mem
    0xfebfc000-0xfebfffff irq 17 at device 0.0 on pci2
    ndis0: [ITHREAD]
    ndis0: NDIS API version: 5.1
    NDIS dummy called…

    Fatal trap 12: page fault while in kernel mode
    cpuid = 0; apic id = 00
    fault virtual address   = 0x0
    fault code              = supervisor read, page not present
    instruction pointer     = 0x20:0x0
    stack pointer           = 0x28:0xc691e60c
    frame pointer           = 0x28:0xeebab890
    code segment            = base 0x0, limit 0xfffff, type 0x1b
                           = DPL 0, pres 1, def32 1, gran 1
    processor eflags        = interrupt enabled, resume, IOPL = 0
    current process         = 54195 (kldload)</realtek>



  • Don't have any suggestions to fix your issue, but wanted to offer some advice from experience with NDIS - I wouldn't bother. Your chances of ending up with something that works highly reliably are slim to none. At best you may end up with something that functions but stops working at random and requires a kick on occasion (ifconfig down && up). At worst, you may never get it to work, or may end up with something that kernel panics randomly. You can get Atheros wireless cards that work well for $5-10 on ebay, IMO it's not worth messing with something that you probably won't be able to get working reliably. Don't mean to rain on your parade, just offering advice from experience that you're probably wasting your time, unless you just want to do it for kicks anyway and like the learning experience.


  • Netgate Administrator

    The Realtek website seems incredibly flaky, I've clicked in the link in my post several times and ended up at different pages each time! the 'SU' is, as you say, a USB model.  ::)

    Steve



  • I'll have to crack open the case again and see how the wifi is done in this box.  I seem to recall it just being mini-PCIe, and if the antenna connectors are standard, maybe I can go ahead and get an Atheros card for it.  Can you recommend any model in particular that's good (emphasis primarily on stability, then performance, then ease of setup – in that order)?  I will need AP functionality with it -- I am aware some cards don't support AP mode.


  • Netgate Administrator

    I am using  an Atheros card, which I happened to have already, which is reported as:

    [2.0.1-RELEASE][root@pfsense.fire.box]/root(2): cat /var/log/dmesg.boot | grep ath
    ath0: <atheros 2413="">mem 0xfdbe0000-0xfdbeffff irq 18 at device 6.0 on pci4
    ath0: [ITHREAD]
    ath0: AR2413 mac 7.8 RF2413 phy 4.5</atheros> 
    

    Interestingly this isn't listed on the ath(4) man page

    Apart from the occasional missed beacon warning in the logs (which doesn't actually cause a problem) it has worked perfectly.
    It's miniPCI though so probably not suitable for you.  ::)

    Steve

    Edit: A better list of cards is on the ath_hal(4) page. I'm fairly confident that any of these would support access point mode but probably best to double check that.



  • Hmmm, once upon a time, I stumbled across a spreadsheet someone had made, indicating what cards support what modes, blah blah blah… I think it was a Google doc spreadsheet.  Does anyone know what I'm referring to?  That might be a handy reference at this point :)


  • Netgate Administrator

    You are reffering to JimP's excellent research effort:
    https://spreadsheets.google.com/ccc?key=0AojFUXcbH0ROdHgwYkFHbkRUdV9hVWljVWl5SXkxbFE&hl=en

    Problem is it doesn't help much with Atheros since there are too many to list!
    The one card that is listed has today been reported as not working though it was in an unusual config.  ::)

    Steve



  • Excellent, thanks!  That's the one I was looking for.  "Multi" sounds interesting… is there a feature in the pfSense UI somewhere to set up multiple access points or will I have to do that from the shell?  I was looking at the tutorial -- would I create new interfaces and assign them the same adapter?


  • Netgate Administrator

    I've never tried it and it looks like there's nothing in the wiki. I believe it's done through the GUI in Interfaces: (assign): Wireless:

    Here you can configure clones of wireless interfaces, which can be assigned as separate independent interfaces. Only available on wireless chipsets that support this, with limitations on the number that can be created in each mode.

    I assume it has to be on the same channel.

    Steve



  • So… I ordered this particular card, and just snapped it in tonight.  Hop onto the web config interface, add an interface, and get ath0 :)

    Within half an hour, I've gotten an 802.11g access point up and running with WPA2-AES, and have successfully connected and gotten online with it (its WAN port is actually connected via ethernet to my current router, which is connected to the internet on its WAN port).

    pfSense FTW!


Log in to reply