# WF721-AEX R, uses Realtek rtl8180 chipset, cannot insmod

## kc8tbe

Short story:

---------------------------

Built kernel 2.4.20-gentoo-r6 off of livecd.

Built pcmcia-cs.

Emerged "wireless-tools".

Downloaded the rtl8180 drivers off of Realtek's website.

Did some tweaking, built the drivers, edited the wlanup and wlandown scripts to my liking (removing the "-f" from "insmod -f rtl8180_24x.o".

Inserted my card.

Ran "/etc/init.d/wlanup infra"

Got:

```

rtl8180_24x.o: init_modules: No such device

Hint: insmod errors can be caused by incorrect modules parameters, incuding invalid IO or IRQ parameters.

   You may find more information in syslog or the output from dmesg

infra

wlan0   no private ioctls.

wlan0   no private ioctls.

wlan0   no private ioctls.

wlan0   no private ioctls.

wlan0   no private ioctls.

wlan0   no private ioctls.

wlan0: error fetching interface information: Device not found

```

Obviously insmod can load the modules but cannot find the appropriate device. My post is different from past posts on this forum because:

"cardctl ident"

Yields:

```

Socket 0:

   no product info available

Socket 1:

   product info: "Realtek", "Rtl8139"

   manfid: 0x0000, 0x024c

   function: 6 (network)

   PCI id: 0c10ec, 0c8180

```

Like the forum says, I'm a n00b - especially at pcmcia. But I'd venture a guess that if the device were properly identified by the card manager the modules *might* recognize the device. Help anyone?

---------------------------

Long story:

(see above for more information)

I am using an HP omnibook 4150, PII 366 MHz processor.

I bought a WF721-AEX S/N: R343010947. The card is sold by Gigafast Ethernet, but probably manufactured by someone else. The Gigafast people confirmed that it uses the rtl8180 chipset.

I have had no success getting the card to work with the Gentoo LiveCD or with Knoppix. "cardctl ident" on both of those systems identify the card as an rtl8139 - which it obviously isn't. 

Not having a network connection, I basically did a GRP install off of the Gentoo LiveCD. Here are some relevant portions of my kernel config (kernel 2.4.20-gentoo-r6):

```

#

# General setup

#

CONFIG_HZ=100

CONFIG_NET=y

CONFIG_X86_IO_APIC=y

CONFIG_C75_LOACL_APIC=y

CONFIG_PCI=y

# CONFIG_PCI_GOBIOS is not set

# CONFIG_PCI_GODIRECT is not set

CONFIG_PCI_GOANY=y

CONFIG_PCI_BIOS=y

CONFIG_PCI_DIRECT=y

# CONFIG_ISA is not set

CONFIG_PCI_NAMES=y

# CONFIG_EISA is not set

# CONFIG_MCA is not set

CONFIG_HOTPLUG=y

#

# PCMCIA/Cardbus support

#

# CONFIG_PCMCIA is not set

#

# PCI Hotplug Support

#

# CONFIG_HOTPLUG_PCI is not set

# CONFIG_HOTPLUG_PCI_COMPAQ is not set

# CONFIG_HOTPLUG_PCI_NVRAM is not set

# CONFIG_HOTPLUG_PCI_IBM is not set

# CONFIG_HOTPLUG_PCI_ACPI is not set

CONFIG_SYSVIPC=y

CONFIG_BSD_PROCESS_ACCT=y

CONFIG_SYSCTL=y

CONFIG_KCORE_ELF=y

# CONFIG_KCORE_AOUT is not set

CONFIG_BINFMT_AOUT=y

CONFIG_BINFMT_ELF=y

CONFIG_BINFMT_MISC=y

# CONFIG_SYSTRACE is not set

CONFIG_PM=y

CONFIG_APM=y

# CONFIG_APM_IGNORE_USER_SUSPEND is not set

# CONFIG_APM_DO_ENABLE is not set

CONFIG_APM_CPU_IDLE=y

CONFIG_APM_DISPLAY_BLANK=y

CONFIG_APM_RTC_IS_GMT=y

# CONFIG_APM_ALLOW_INTS is not set

# CONFIG_APM_REAL_MODE_POWER_OFF is not net

#

# ACPI Support

#

# CONFIG_ACPI is not set

#

# Memory Technology Devices (MTD)

#

# CONFIG_MTD is not set

#

# Plug and Play configuration

#

CONFIG_PNP=y

# CONFIG_ISAPNP is not set

#

# Network device support

#

CONFIG_NETDEVICES=y

#

# ARCnet devices

#

# CONFIG_ARCNET is not set

CONFIG_DUMMY=m

# CONFIG_BONDING is not set

# CONFIG_EQUALIZER is not set

# CONFIG_TUN is not set

# CONFIG_ETHERTAP is not set

#

# Ethernet (10 or 100Mbit)

#

# CONFIG_NET_ETHERNET is not set

#

# Ethernet (1000 Mbit)

#

[none of this stuff is set]

#

# Wireless LAN (non-hamradio)

#

CONFIG_NET_RADIO=y

# CONFIG_STRIP is not set

# CONFIG_WAVELAN is not set

# CONFIG_ARLAN is not set

# CONFIG_AIRONET4500 is not set

# CONFIG_AIRONET4500_NONCS is not set

# CONDIG_AIRONET4500_PROC is not set

# CONFIG_AIRO is not set

# CONFIG_HERMES is not set

# CONFIG_PLX_HERMES is not set

# CONFIG_PCI_HERMES is not set

CONFIG_NET_WIRELESS=y

#

# Token Ring devices

#

[none of this is set]

#

# Wan interfaces

#

# COFIG_WAN is not set

#

# ISDN subsystem

#

# CONFIG_ISDN is not set

#

# Sound

#

# CONFIG_SOUND is not set

#

# USB support

#

# CONFIG_USB is not set

#

# Bluetooth support

#

# CONFIG_BLUEZ is not set

#

# Grsecurity

#

# CONFIG_GRKERNSEC is not set

```

I then ran /sbin/lilo, etc, etc, rebooted fine. Unzipped the rtl8180 code to /usr/src/linux/drivers/net/rtl8180. I modified the makefile so that:

"INSTALLPATH=/lib/modules/$(KERNELRELEASE)/kernel/drivers/net/wireless"

reads: "INSTALLPATH=/lib/modules/$(KERNELRELEASE/kernel/drivers/net"

And so that:

```

install:

   cp $(RTL8180_TARGET) $(INSTALLPATH)

```

Reads:

```

install:

   mkdir $(INSTALLPATH)/wireless

   cp $(RTL8180_TARGET) $(INSTALLPATH)/wireless

```

Compiled and installed the driver with "make && make install". Then copied wlanup and wlandown to /etc/init.d. There, I edited both files to replace "/sbin/iwpriv" with "/usr/sbin/iwpriv".

Then I did "emerge pcmcia-cs" followed by "rc-update add pcmcia boot". I editied /etc/pcmcia/config.opts to include "exclude irq 5" in order to avoid a conflict with the sound card on the Omnibook 4150. I've also tried loading the modules without that line - with no change in luck.

Did "emerge -k wireless-tools" and "emerge -k pci-utils". Then rebooted the machine without the card in the slot. I've also tried rebooting with the card in the slot, in which case I get this message during startup:

```

cardmgr[508]: watching 2 sockets

cardmgr[508]: starting, version is 3.2.4

cardmgr[508]: unsupported card in socket 1

cardmgr[508]:   product info "Realtek", "Rtl8139"

cardmgr[508]:   function: 6 (network)

cardmgr[508]:   PCI id: 0x10ec, 0x8180

```

Either way, I end up getting the error I described in "Short story:" (above). Here is the relevant output of "lspci -v" for those who care:

```

00:04.0 Carbus bridge: Texas Instruments PCI1220 (rev 02)

   Subsystem: Hewlett-Packard Company: Uknown device 0007

   Flags: bus master, medium devsel, latency 64, IRQ 10

   Memory at 10000000 (32-bit, not prefetchable) [size=4k]

   Bus: primary=00, secondary=02, subordinate=05, sec-latency=32

   I/O window 0: 00000000-00000003

   I/O window 1: 00000000-00000003

   16-bit legacy interface ports at 0001

00:04.0 Carbus bridge: Texas Instruments PCI1220 (rev 02)

   Subsystem: Hewlett-Packard Company: Uknown device 0007

   Flags: bus master, medium devsel, latency 64, IRQ 10

   Memory at 10000000 (32-bit, not prefetchable) [size=4k]

   Bus: primary=00, secondary=06, subordinate=09, sec-latency=32

   I/O window 0: 00000000-00000003

   I/O window 1: 00000000-00000003

   16-bit legacy interface ports at 0001

```

Thanks for any help you can provide!

----------

## kc8tbe

EDIT: an error in my previous post.

"insmod rtl8180_24x.o" should read "insmod rtl8180_24x"

----------

## FreeFly42

I'm so happy you managed to return your other card!  :Very Happy: 

All the data you get from the 'pcmcia ident' is delivered to the OS as part of the PCMCIA standard, and that is the data the PCMCIA system uses to identify the card and load the driver.  You can manually edit /etc/pcmcia/ so it will recognize the card and load the module properly, apparently there is no existing entry for your card.  However, this data is what the device is reporting itself to be, so in spite of what you've been told the card itself (not Linux) thinks it's an 8139, so it's quite likely that it is (or it should work with) the 8139 driver.  I'd try that myself, before trying to figure out IRQ conflicts.  Here's a nice page with a lot of documentation and source for the 8139 driver.  (I'm sure you've already been there for the 8180).

Unfortunately I'm not sure how to get it to load a module which wasn't compiled as part of the kernel.  If you can run "modprobe module" (not module.o) then the PCMCIA system will be able to find and load the module.  I've taken third party modules before and copied the source into a sub dir of the kernel source and hacked up the Makefiles to make the kernel compile it and include it in its modules dependencies so PCMCIA can auto load it.  Works nicely, but I haven't done it recently enough to lead you through the process.  (Well, I can give you help if you want to try it....)  

No matter what, though, if you can't modprobe/insmod and get a working driver nothing else will work, so focus on getting the module loaded, and then work on having it done automatically.

----------

## kc8tbe

 *Quote:*   

> so it's quite likely that it is (or it should work with) the 8139 driver

 

Not really. rtl8139 is an ethernet driver, rtl8180 is a wireless driver. However I have tried "modprobe -k 8319too" and "modprobe -k 8319cp" from the Gentoo LiveCD and from Knoppix. Both return the same sort of error that I get from the rtl8180_24x module when I boot from my HD (no such device). Is there something else I can try to get an 8139 modules working?

Also, review the output of "cardctl ident". Note that the number "8180" is in there.

 *Quote:*   

>  (Well, I can give you help if you want to try it....) 

 

Please! This would be my first time patching the kernel. Give me a few basics about how to work with the Makefiles, and I'll try to figure it out.

Also, I am recompiling the kernel with pcmcia built in (after running "emerge -C pcmcia-cs"). Maybe this will help.

----------

## kc8tbe

Finished compiling witt pcmcia in the kernel and without pcmcia-cs. Also did "rc-update del pcmcia boot".

Now "/etc/init.d/wlanup infra" yields:

```

Using /lib/modules/2.4.20-gentoo-r6/kernel/drivers/net/wireless/rtl8180_24x.o

infra

Oops: 0002

CPU:   0

EIP:   0010:[<c8f0d434>]   Not tainted

EFLAGS:   00010286

eax: 9001f000   ebx: 00000000   ecx: 00000000   edx: 00000001

esi: c8f2fc60   edi: 00004800   ebp: c76d5d24   esp: c76d5d1c

ds: 0018   es: 0018   ss: 0018

Process iwpriv (pid: 715, stackpage=c76d5000)

Stack:   c796a960 c796a800 c76d5d54 c8f0e52b 0000001f 00000000 7ce28968 0000000a

   c76796f0 c7660000 0b6d5d84 c796a960 c7660000 00004800 c76d5d84 c8f0da96

   c796a800 0000000b 00004800 c8efbc37 000b1260 c1525db8 c150b360 3014f40e

Call Trace:   [<c8f052b>] [<c8f0da96>] [<c8efbc37>] [<c8efaa63>] [<c8ef8c26>]

  [<c8f1258a>] [<c0239515>] [<c024b89e>] [<c0233ff6>] [<c024b89e>] [<c02341ad>]

  [<c021803c>] [<c0382650>] [<c03808f7>] [<c0382928>] [<c03794cc>] [<c0261196>]

  [<c02047ff>]

Code: a3 80 00 40 bd 5b 5e c9 c3 8d 76 00 55 89 e5 57 56 53 83 ec

 /etc/init.d/wlanup: line27:   715 Segmentation fault       /usr/sbin/iwpriv wlan0 enable

```

At which point the terminal hangs. Other VTs are still accessible. Ctrl+c has no effect on the frozen VT, and dhcpcd won't die - even with "kill -9".

Well, I guess that's a step in the right directions. I'm still interested in patching my kernel source tree.

btw, how do I get stuff like cardctl and that beep when I insert cards without pcmcia-cs?

----------

## kc8tbe

Also, all the VT's hang after Ctrl+Alt+Delete when the system tries to take lo down.

----------

## FreeFly42

Ah well.  Yes (duh) it's obviously not an 8139.

You need to get this card working before you can worry about getting it automated, so let's take it one step at a time.  I've downloaded the driver from realtek, and looked around at some of the support pages.  Very interesting driver.  Since you are using the realtek script you are no doubt using the private interface, etc.  But we need to figure out what is going wrong, so let's run the setup steps one at a time manually and see where it is failing.

So start with the insmod.  You shouldn't need the -f since you compiled the module yourself so it should match your kernel version, as long as you edited the Makefile with your current kernel information.  So tail your logfile, insert the module, check dmesg and post what happens.

Assuming that is ok, manually run the commands from your script, one at a time, while tailing your syslog and looking at dmesg and see what you can glean.

Edit:  here's a nice little link, probably information you already have, though.

I don't think the card conflicts with pcmcia so much as it isn't integrated with it.  I have a bit of experience getting things which weren't designed for pcmcia-cs to work with it, but you won't get the nice little beeps without it.  Unless you write something yourself....

----------

## kc8tbe

Still no luck with the card, but I finally managed to get my little paws on an orinoco card, so my troubles are over   :Cool:  .

For those not so fortunate, know that your only hope of getting your card to work (at the time of this writing) is to:

1. Use 2.4.x sources (gentoo, vanilla... didn't matter for me).

2. Enable pcmcia support in the kernel

3. NOT emerge pcmcia-cs

4. Emerge wireless-tools (you'll be using iwpriv a lot)

5. Get a hold of the redhat or suse version of the rtl8180 driver. You'll have to google around for these, but know that the generic driver on Realtek's website doesn't work.

I managed to get as far as making the card's light blink for about three seconds, but dmesg pretty much summed things up when my card scanned all 15 channels without finding an access point (even though I was physically two feet away from one).

For more fun and games, visit this monster thread:

http://www.linuxquestions.org/questions/showthread.php?s=&threadid=61832

And if there's any way my experience with the rtl8180 chipset can save you a headache, don't hesitate to post to this thread!

----------

