Friday, August 23, 2013

Gentoo and Atheros QCA8172 Fast Ethernet

I mentioned in previous posts that wired ethernet was not working on my laptop when I booted the Ubuntu Live DVD and SystemRescueCD. It was working after I installed Ubuntu 12.04 LTS, but was not detected by Gentoo.

The hardware:

lspci -k : 02:00.0 Ethernet controller: Qualcomm Atheros QCA8172 Fast Ethernet (rev 10) Subsystem: Lenovo Device 3804
lspci -n : 02:00.0 0200: 1969:10a0 (rev 10)

According to the linuxfoundation website, the driver needed for this hardware is alx. However this driver is not available in the kernel in Gentoo.

For kernel 3.8.13:

1. Download the compat-driver.
2. Extract the file using tar -xjvf compat-drivers-2013-03-04-u.tar.bz2

Note: This is not the latest stable version available now. I just want to document here that this was the driver that I used when I initially installed it on my system running on kernel 3.8.13.

3. Enter the compat-drivers directory. Run:

./scripts/driver-select alx

make

make install

After I have done this, I encountered errors trying to load this module:
modprobe: ERROR: could not insert 'alx': Unknown symbol in module, or unknown parameter (see dmesg)
alx: Unknown symbol mdio_mii_ioctl (err 0) 

In order to resolve this error, I have to compile the module bnx2x in the kernel. (I cannot explain why that will resolve the matter.  I found the fix somewhere in the net. It does work.)

Device drivers >> Network device support >> Ethernet driver support >> Broadcom devices >>   Broadcom NetXtremeII 10Gb support

I compiled it as a module. Just for curiosity sake, I did try one kernel compile without this module. As a result, besides the modprobe error with alx, I also received this message at the end of the kernel compilation:
depmod: WARNING: /lib/modules/3.10.7-gentoo/updates/drivers/net/ethernet/atheros/alx/alx.ko needs unknown symbol mdio_mii_ioctl
After compiling the bnx2x module, the alx module could be loaded and ethernet was finally working.

After upgrading to kernel 3.10.7 I couldn't install the alx driver with the instructions from linuxfoundation anymore. There was an error during compilation: 

So I downloaded the latest compat-drivers file which has now been renamed to backports. The reason I didn't use the latest backport file in the first place was because I didn't know how to install the alx driver with backports. The instruction on the linuxfoundation website to use ./scripts/driver-select alx didn't work anymore. So I had to dig around for solutions. And here we go:

1. Download backports-3.11-rc3-1.tar.bz2
2. Untar using tar -xjvf backports-3.11-rc3-1.tar.bz2
3. Enter the backports directory. 
4. Do as you would when manually compiling a kernel:

Run make menuconfig

As I only needed the alx driver, I only chose that one and unselected the rest of the drivers.

Ethernet driver support >> Atheros device >>  Qualcomm Atheros AR816x/AR817x support (compiled as module)

Save the configuration.

Run make

and then make modules_install as root. 

Load the module modprobe alx and voila! Ethernet is working. 

Note: I still needed to compile bnx2x in the new kernel to prevent the mdio error.



5 comments:

Jake Foiles said...

Thank you very much, this saved my morning.

Anonymous said...

Glad that you found the post useful. :)

Unknown said...

Hey, i get errors when use "make menuconfig" command :((
Don't know why :(
Here is the terminal resuilt:
"""Generating local configuration database from kernel ... done.
cc -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -DCURSES_LOC="" -DLOCALE -c -o mconf.o mconf.c
In file included from mconf.c:23:0:
lxdialog/dialog.h:38:21: fatal error: ncurses.h: No such file or directory
compilation terminated.
make[2]: *** [mconf.o] Error 1
make[1]: *** [menuconfig] Error 2
make: *** [menuconfig] Error 2"""
Can you help me to get rid it?
(Sorry for my bad English)

Unknown said...

Nvm, i handle it!
Thanks for writing this post buddy!

rhwckl said...

Thanks a lot!!!