After rooting the kindle being bugging me whole day yesterday, it’s time to deal with Atheros ar8161 ethernet driver. This ethernet chipset were used on axioo komodo model and some asus laptop. Once, I remember have to deal with atheros ethernet chipset in past, not clearly remember the chipset code, but for so long the atheros driver was maintained very well with atl modules in kernel tree.

Here is the long story short,
This is what lspci gives :

[root@komodo compat-wireless-2012-03-12-p]# lspci
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port (rev 09)
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
00:14.0 USB Controller: Intel Corporation Panther Point USB xHCI Host Controller (rev 04)
00:16.0 Communication controller: Intel Corporation Panther Point MEI Controller #1 (rev 04)
00:1a.0 USB Controller: Intel Corporation Panther Point USB Enhanced Host Controller #2 (rev 04)
00:1b.0 Audio device: Intel Corporation Panther Point High Definition Audio Controller (rev 04)
00:1c.0 PCI bridge: Intel Corporation Panther Point PCI Express Root Port 1 (rev c4)
00:1c.1 PCI bridge: Intel Corporation Panther Point PCI Express Root Port 2 (rev c4)
00:1c.2 PCI bridge: Intel Corporation Panther Point PCI Express Root Port 3 (rev c4)
00:1d.0 USB Controller: Intel Corporation Panther Point USB Enhanced Host Controller #1 (rev 04)
00:1f.0 ISA bridge: Intel Corporation Panther Point LPC Controller (rev 04)
00:1f.2 SATA controller: Intel Corporation Panther Point 6 port SATA AHCI Controller (rev 04)
00:1f.3 SMBus: Intel Corporation Panther Point SMBus Controller (rev 04)
03:00.0 Network controller: Atheros Communications Inc. Device 0037 (rev 01)
04:00.0 Ethernet controller: Atheros Communications Device 1091 (rev 10)
[root@komodo compat-wireless-2012-03-12-p]#

No indicated network devices on ubuntu networkmanager neither on net_applet on KLIXs. My first thought, it must be supported on newer kernel and directly gives a shot on oneiric with my 3.2.0-16-jf2-generic and also on KLIXs with my brand new kernel-3.2.15-jf2-bfs … and … it returns nothing ;D … even with my latest build linux-image 3.3.0-994-jf1-generic with intel-drm-fix on ubuntu still cannot fire up the ethernet device.
Whooah … this must be an interesting hardware devices …

Googling around the net found some clue on linux.kernel mailing list … Apparently the new atheros module alx wasn’t accepted yet to kernel tree (maybe because hand over on atheros company … dunno … but my bookmark on atheros repository download page giving 404). The original maintainer handed over the alx driver module to the other guy and the other guy deprecated the old atl1c module. 😀 ;D
But, fortunately, now alx supports these two chipsets additionally :
* 1961:1091 – AR8161
* 1969:1090 – AR8162

You may get the latest compat-wireless from linux wireless download page. Extract them to your like folder and cd into it.


EDIT 062512 :

You may read the below comments since latest compat wireless package was obsoletes the alx driver module.

Here we go, To only compile the needed module alx for ar8161 :

[root@komodo compat-wireless-2012-03-12-p]# ./scripts/driver-select alx
Processing new driver-select request…
Backup exists: Makefile.bk
Backup exists: Makefile.bk
Backup exists: drivers/net/ethernet/broadcom/Makefile.bk
Backup exists: drivers/net/ethernet/atheros/Makefile.bk
Backup exists: Makefile.bk
Backup exists: Makefile.bk
Backup exists: drivers/net/ethernet/broadcom/Makefile.bk
[root@komodo compat-wireless-2012-03-12-p]#

Make sure you’re working on clean table :

[root@komodo compat-wireless-2012-03-12-p]# make clean
make[1]: Entering directory `/usr/src/linux-headers-3.3.0-994-generic’
CLEAN /usr/src/compat-wireless-2012-03-12-p
CLEAN /usr/src/compat-wireless-2012-03-12-p/.tmp_versions
make[1]: Leaving directory `/usr/src/linux-headers-3.3.0-994-generic’
[root@komodo compat-wireless-2012-03-12-p]#

then compile and install with : make and make install

[root@komodo compat-wireless-2012-03-12-p]# make
./scripts/gen-compat-autoconf.sh /usr/src/compat-wireless-2012-03-12-p/.config /usr/src/compat-wireless-2012-03-12-p/config.mk > include/linux/compat_autoconf.h
make -C /lib/modules/3.3.0-994-generic/build M=/usr/src/compat-wireless-2012-03-12-p modules
make[1]: Entering directory `/usr/src/linux-headers-3.3.0-994-generic’
CC [M] /usr/src/compat-wireless-2012-03-12-p/compat/main.o
CC [M] /usr/src/compat-wireless-2012-03-12-p/compat/compat_atomic.o
LD [M] /usr/src/compat-wireless-2012-03-12-p/compat/compat.o
CC [M] /usr/src/compat-wireless-2012-03-12-p/drivers/net/ethernet/atheros/alx/alx_main.o
CC [M] /usr/src/compat-wireless-2012-03-12-p/drivers/net/ethernet/atheros/alx/alx_ethtool.o
CC [M] /usr/src/compat-wireless-2012-03-12-p/drivers/net/ethernet/atheros/alx/alc_cb.o
CC [M] /usr/src/compat-wireless-2012-03-12-p/drivers/net/ethernet/atheros/alx/alc_hw.o
CC [M] /usr/src/compat-wireless-2012-03-12-p/drivers/net/ethernet/atheros/alx/alf_cb.o
CC [M] /usr/src/compat-wireless-2012-03-12-p/drivers/net/ethernet/atheros/alx/alf_hw.o
LD [M] /usr/src/compat-wireless-2012-03-12-p/drivers/net/ethernet/atheros/alx/alx.o
Building modules, stage 2.
MODPOST 2 modules
CC /usr/src/compat-wireless-2012-03-12-p/compat/compat.mod.o
LD [M] /usr/src/compat-wireless-2012-03-12-p/compat/compat.ko
CC /usr/src/compat-wireless-2012-03-12-p/drivers/net/ethernet/atheros/alx/alx.mod.o
LD [M] /usr/src/compat-wireless-2012-03-12-p/drivers/net/ethernet/atheros/alx/alx.ko
make[1]: Leaving directory `/usr/src/linux-headers-3.3.0-994-generic’
[root@komodo compat-wireless-2012-03-12-p]#
[root@komodo compat-wireless-2012-03-12-p]# make install

make -C /lib/modules/3.3.0-994-generic/build M=/usr/src/compat-wireless-2012-03-12-p modules
make[1]: Entering directory `/usr/src/linux-headers-3.3.0-994-generic’
Building modules, stage 2.
MODPOST 2 modules
make[1]: Leaving directory `/usr/src/linux-headers-3.3.0-994-generic’
make -C /lib/modules/3.3.0-994-generic/build M=/usr/src/compat-wireless-2012-03-12-p “INSTALL_MOD_DIR=updates”
modules_install
make[1]: Entering directory `/usr/src/linux-headers-3.3.0-994-generic’
INSTALL /usr/src/compat-wireless-2012-03-12-p/compat/compat.ko
INSTALL /usr/src/compat-wireless-2012-03-12-p/drivers/net/ethernet/atheros/alx/alx.ko
DEPMOD 3.3.0-994-generic
make[1]: Leaving directory `/usr/src/linux-headers-3.3.0-994-generic’
Updating Ubuntu’s initramfs for 3.3.0-994-generic under /boot/ …
Will now run update-grub to ensure grub will find the new initramfs …
Generating grub.cfg …
Found background: /usr/share/grub/splash/splash.png
Found background image: /usr/share/grub/splash/splash.png
Found linux image: /boot/vmlinuz-3.3.0-994-generic
Found initrd image: /boot/initrd.img-3.3.0-994-generic
Found linux image: /boot/vmlinuz-3.0.0-17-generic
Found initrd image: /boot/initrd.img-3.0.0-17-generic
Found memtest86+ image: /boot/memtest86+.bin
Found KLIXs on /dev/sda6
Found KLIXs on /dev/sda7
done

Note: iwl4965 detected, we’re going to disable it. If you would like to enable it later you can run:
sudo iwl-load iwl4965

Running iwl-enable iwlagn…
Disabling iwl4965 … [OK] Module disabled:
kernel/drivers/net/wireless/iwlegacy/iwl4965.ko

Note: atl1c detected, we’re going to disable it. If you would like to enable it later you can run:
sudo alx-load atl1c

Running alx-enable alx…
Disabling atl1c … [OK] Module disabled:
kernel/drivers/net/ethernet/atheros/atl1c/atl1c.ko
depmod will prefer updates/ over kernel/ — OK!

Now run:

sudo make unload to unload all: wireless, bluetooth and ethernet modules
sudo make wlunload to unload wireless modules
sudo make btunload to unload bluetooth modules

Run sudo modprobe driver-name to load your desired driver.
If unsure reboot.

[root@komodo compat-wireless-2012-03-12-p]#

Here is ifconfig before loading the alx module :

[root@komodo compat-wireless-2012-03-12-p]# ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:240 (240.0 B) TX bytes:240 (240.0 B)

[root@komodo compat-wireless-2012-03-12-p]#

and after loading the alx module :

[root@komodo compat-wireless-2012-03-12-p]# modprobe alx
[root@komodo compat-wireless-2012-03-12-p]# ifconfig
eth0 Link encap:Ethernet HWaddr e8:40:f2:86:df:91
inet6 addr: fe80::ea40:f2ff:fe86:df91/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1 errors:0 dropped:0 overruns:0 frame:0
TX packets:3 errors:0 dropped:0 overruns:0 carrier:1
collisions:0 txqueuelen:1000
RX bytes:60 (60.0 B) TX bytes:510 (510.0 B)
Interrupt:18

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:240 (240.0 B) TX bytes:240 (240.0 B)

[root@komodo compat-wireless-2012-03-12-p]#

the NetworkManager on ubuntu (and also net_applet on KLIXs) immediately detecting there is a new network devices and automatically connecting to my router.

Happy hacking !