Cette page existe aussi en français (fr)

TEW-226PC on Linux

Install Trendnet TEW-226PC wireless lan card under Mandrake Linux 9.2

Dernière modification le Dimanche 01 Mai 2005 à 21h47

Important: You wouldn't need these these steps if you run a newer distribution (linux kernel 2.6 and WLAN support included in configuration tools).

Table of Contents

  1. Card Features
  2. What you need
  3. Linux kernel sources
  4. ARC4 cypher module
  5. rtl8180 driver
  6. Wireless lan interface configuration
  7. Links

Card Features

Trendnet TEW-226PC Trendnet TEW-226PC

What you need

You will need the following things:

Insert the card in a free slot. Check that the card is seen by the system using command lspci.

[eric@rose eric]$ lspci | grep 8180
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd.: Unknown device 8180 (rev 20)

Linux kernel sources

kernel-sources package does not contain some elements needed to build external module as a regular user. To be able to build module without being root, issue the following commands:

[eric@rose eric]$ su -
Password: XXX
[root@rose root]# cd /lib/modules/`uname -r`/build
[root@rose build]# cd scripts && make TOPDIR=.. split-include
cc     split-include.c   -o split-include
[root@rose scripts]# cd .. && mkdir -p include/config
[root@rose build]# touch include/config/MARKER
[root@rose build]# exit

ARC4 cypher module

This cypher module allows you to use WEP encryption. Indeed, hardware does not provide WEP support. The encrytion is done by the host processor.

ARC4 support is available from 2.4.26 kernel. Then you'll have to include it to the 2.4.22 kernel coming in the Mandrake 9.2 distribution. You'll find there an archive with Jon Oberheide's module bundled with a simple Makefile.

Building ARC4 module

[eric@rose tmp]$ bunzip2 -c crypto-arc4.tar.bz2 | tar xf -
[eric@rose tmp]$ cd crypto-arc4
[eric@rose crypto-arc4]$ make
...building...
[eric@rose crypto-arc4]$ /sbin/modinfo ./arc4.o
filename:    ./arc4.o
description: "ARC4 Cipher Algorithm"
author:      "Jon Oberheide <jon@focalhost.com>"
license:     "GPL"

Install ARC4 module

[eric@rose crypto-arc4]$ su
Password: XXX
[root@rose crypto-arc4]# make install
...installing...
install -p -m 644 arc4.o /lib/modules/2.4.22-10mdk/kernel/crypto
[root@rose crypto-arc4]# depmod -a

Check ARC4 module

[root@rose crypto-arc4]# modprobe arc4
[root@rose crypto-arc4]# lsmod | grep arc4
arc4                    1136   0  (unused)

rtl8180 driver

You'll find two different drivers for Realtek 8180 chip. One is provided by Realtek (téléchargements RTL8180L), but I didn't manage to get it works.
The second one is a GPL driver from Andrea Merello available at http://rtl8180-sa2400.sourceforge.net.

Building rtl8180 driver

[eric@rose tmp]$ gunzip -c rtl8180-0.21.tar.gz | tar xf -
[eric@rose tmp]$ cd rtl8180-0.21
[eric@rose rtl8180-0.21]$ make
...compilation...
[eric@rose rtl8180-0.21]$ /sbin/modinfo r8180.o
filename:    r8180.o
description: "Linux driver for Realtek RTL8180 WiFi cards"
author:      "Andrea Merello <andreamrl@tiscali.it>"
license:     "GPL"
parm:        ifname string
parm:        hwseqnum int, description " Try to use hardware 802.11 header sequence numbers. Zero=default"
parm:        hwwep int, description " Try to use hardware WEP support. Still broken and not available on all cards"
parm:        channels int, description " Channel bitmask for specific locales. NYI"

Check rtl8180 driver

[eric@rose rtl8180-0.21]$ su  
Password: XXX
[root@rose rtl8180-0.21]# ./module_load24
[root@rose rtl8180-0.21]# ifconfig -a | grep wlan
wlan0     Link encap:Ethernet  HWaddr 00:40:F4:FF:2E:FF  
[root@rose rtl8180-0.21]# iwconfig wlan0
Warning: Driver for device wlan0 recommend version 16 of Wireless Extension,
but has been compiled with version 15, therefore some driver features
may not be available...

wlan0     IEEE 802.11b  Mode:Managed  Frequency:2.462GHz  
          Access Point: 00:00:00:00:00:00  Bit Rate=11Mb/s   
          Fragment thr:off
          Encryption key:off
          Link Quality:0  Signal level:0  Noise level:0
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

At this point, you can use your 802.11b interface. You could try it by following ifconfig/iwconfig sequence in the README file provided with the driver. Once you finish the tests, you could unload all modules related to the wireless interface with the following command:

[root@rose rtl8180-0.21]# ./module_unload24

Install rtl8180 driver

[eric@rose rtl8180-0.21]$ su
Password: 
[root@rose rtl8180-0.21]# make install
...installation...
[root@rose rtl8180-0.21]# depmod -a

Wireless lan interface configuration

To set up your interface automatically, you'll have to create the file /etc/sysconfig/network-scripts/ifcfg-wlan0.

[eric@rose rtl8180-0.21]$ cat /etc/sysconfig/network-scripts/ifcfg-wlan0 
DEVICE=wlan0
BOOTPROTO=dhcp
ONBOOT=no            # /sbin/hotplug will handle it
MII_NOT_SUPPORTED=yes
MODE=Managed
ESSID="My ssid"                 # your wireless lan identifier
KEY=1a2b3c4d5e6f7a8b9c0f1a2b3c  # your WEP key in hexadecimal (26 digits)

You must also add to /etc/modules.conf:

# Realtek 8180
alias wlan0 r8180

Links