Saturday, September 28, 2013

[Linux] HOW TO: Atheros AR8162, linux drivers. (ALX - Ethernet)


Hi guys! Maybe some of you had problem that your ethernet connection didn't show up in network connection. This should fix it :)

(Tested on Linux MINT 15 - MATE 64bit edition)

Update 6.2.2014: As I noticed that from kernel version 3.10+ drivers not work anymore, I had to update them. In my opinion, those are the ONLY working drivers on kernel > 3.10 at this time! Not found any other fix, or working drivers...

1) Download those drivers.

wget -O- http://ge.tt/api/1/files/5b6OjGt/2/blob?download | tar -xz
cd compat-drivers-3.9-rc4-2-su

2) Blacklist old drivers.

sudo sh -c "echo \"blacklist atl1c\" > /etc/modprobe.d/blacklist-ethernet.conf"

3) Select alx driver.

./scripts/driver-select alx

4) Compile and load!

make
sudo make install
sudo make unload
sudo modprobe alx

5) If not sure, reboot ;)

21 comments :

  1. this command

    sudo modprobe alx

    show this error:
    FATAL: Module alx not found

    ReplyDelete
    Replies
    1. That can mean only one thing... Installation was not succesfull, Check for errors when you run the "make" command.

      Delete
  2. Thnaks, It worked for me on ubuntu 13.04

    ReplyDelete
  3. I've seen this solution posted in several places but I can't seem to get it to work.

    When I try to run the Make command, I get this:

    abdulhakim@ilmstation-LM ~/compat-drivers-2013-03-04-u $ make
    make -C /lib/modules/3.13.0-24-generic/build M=/home/abdulhakim/compat-drivers-2013-03-04-u modules
    make[1]: Entering directory `/usr/src/linux-headers-3.13.0-24-generic'
    CC [M] /home/abdulhakim/compat-drivers-2013-03-04-u/drivers/net/ethernet/atheros/alx/alx_main.o
    /home/abdulhakim/compat-drivers-2013-03-04-u/drivers/net/ethernet/atheros/alx/alx_main.c: In function ‘alx_dispatch_skb’:
    /home/abdulhakim/compat-drivers-2013-03-04-u/drivers/net/ethernet/atheros/alx/alx_main.c:700:4: error: too few arguments to function ‘__vlan_hwaccel_put_tag’
    __vlan_hwaccel_put_tag(skb, ntohs(tag));
    ^
    In file included from /home/abdulhakim/compat-drivers-2013-03-04-u/drivers/net/ethernet/atheros/alx/alx_main.c:22:0:
    include/linux/if_vlan.h:337:31: note: declared here
    static inline struct sk_buff *__vlan_hwaccel_put_tag(struct sk_buff *skb,
    ^
    /home/abdulhakim/compat-drivers-2013-03-04-u/drivers/net/ethernet/atheros/alx/alx_main.c: In function ‘alx_set_vlan_mode’:
    /home/abdulhakim/compat-drivers-2013-03-04-u/drivers/net/ethernet/atheros/alx/alx_main.c:1141:17: error: ‘NETIF_F_HW_VLAN_RX’ undeclared (first use in this function)
    if (features & NETIF_F_HW_VLAN_RX)
    ^
    /home/abdulhakim/compat-drivers-2013-03-04-u/drivers/net/ethernet/atheros/alx/alx_main.c:1141:17: note: each undeclared identifier is reported only once for each function it appears in
    /home/abdulhakim/compat-drivers-2013-03-04-u/drivers/net/ethernet/atheros/alx/alx_main.c: In function ‘alx_fix_features’:
    /home/abdulhakim/compat-drivers-2013-03-04-u/drivers/net/ethernet/atheros/alx/alx_main.c:1158:17: error: ‘NETIF_F_HW_VLAN_RX’ undeclared (first use in this function)
    if (features & NETIF_F_HW_VLAN_RX)
    ^
    /home/abdulhakim/compat-drivers-2013-03-04-u/drivers/net/ethernet/atheros/alx/alx_main.c:1159:15: error: ‘NETIF_F_HW_VLAN_TX’ undeclared (first use in this function)
    features |= NETIF_F_HW_VLAN_TX;
    ^
    /home/abdulhakim/compat-drivers-2013-03-04-u/drivers/net/ethernet/atheros/alx/alx_main.c: In function ‘alx_set_features’:
    /home/abdulhakim/compat-drivers-2013-03-04-u/drivers/net/ethernet/atheros/alx/alx_main.c:1176:18: error: ‘NETIF_F_HW_VLAN_RX’ undeclared (first use in this function)
    if (!(changed & NETIF_F_HW_VLAN_RX))
    ^
    /home/abdulhakim/compat-drivers-2013-03-04-u/drivers/net/ethernet/atheros/alx/alx_main.c: In function ‘alx_probe’:
    /home/abdulhakim/compat-drivers-2013-03-04-u/drivers/net/ethernet/atheros/alx/alx_main.c:2637:10: error: ‘NETIF_F_HW_VLAN_RX’ undeclared (first use in this function)
    NETIF_F_HW_VLAN_RX |
    ^
    /home/abdulhakim/compat-drivers-2013-03-04-u/drivers/net/ethernet/atheros/alx/alx_main.c:2640:43: error: ‘NETIF_F_HW_VLAN_TX’ undeclared (first use in this function)
    netdev->features = netdev->hw_features | NETIF_F_HW_VLAN_TX;
    ^
    make[4]: *** [/home/abdulhakim/compat-drivers-2013-03-04-u/drivers/net/ethernet/atheros/alx/alx_main.o] Error 1
    make[3]: *** [/home/abdulhakim/compat-drivers-2013-03-04-u/drivers/net/ethernet/atheros/alx] Error 2
    make[2]: *** [/home/abdulhakim/compat-drivers-2013-03-04-u/drivers/net/ethernet/atheros] Error 2
    make[1]: *** [_module_/home/abdulhakim/compat-drivers-2013-03-04-u] Error 2
    make[1]: Leaving directory `/usr/src/linux-headers-3.13.0-24-generic'
    make: *** [modules] Error 2

    ReplyDelete
    Replies
    1. Maybe thats because you have bad version downloaded...
      As I can see, you are in compat-drivers-2013-03-04-u directory.
      Compilation of compat-drivers-3.9-rc4-2-su works well.
      Just download it from here: http://ge.tt/api/1/files/5b6OjGt/2/blob?download
      or try to find compat-drivers-3.9-rc4-2-su anywhere else.

      Delete
  4. i have too the problem where i digit make or sudo make :(
    i cant compille the drive

    ReplyDelete
    Replies
    1. Can you too send me output of make command?

      Delete
  5. cant get it to work either, Deb ver:
    Distributor ID: Debian
    Description: Debian GNU/Linux 6.0.10 (squeeze)
    Release: 6.0.10
    Codename: squeeze

    Make:
    ./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

    make install:
    make install
    Warning:
    You may or may not need to update your initramfs, you should if
    any of the modules installed are part of your initramfs. To add
    support for your distribution to do this automatically send a
    patch against ./scripts/update-initramfs. If your distribution does not require this
    send a patch against the '/usr/bin/lsb_release -i -s':
    tag for your distribution to avoid this warning.

    ./scripts/gen-compat-autoconf.sh /root/compat-drivers-3.9-rc4-2-su/.config /root/compat-drivers-3.9-rc4-2-su/config.mk > include/linux/compat_autoconf.h
    make -C /lib/modules/2.6.32-5-686/build M=/root/compat-drivers-3.9-rc4-2-su modules
    make: *** /lib/modules/2.6.32-5-686/build: Bestand of map bestaat niet. Gestopt.
    make: *** [modules] Fout 2

    ReplyDelete
    Replies
    1. Sorry man. I can't help you with that one. I don't understand that language. Maybe if you translate "Bestand of map bestaat niet. Gestopt." for me?

      Did you run "make" before running "make install" ?

      Delete
    2. Hehe, yeah i can imagine, personally i have never installed a system configured as being dutch but this system is ;-)

      Bestand of map bestaat niet. Gestopt = file or folder does not exist, Stopped.
      fout = error

      Delete
    3. yes i ran in the order that was advised.

      make
      make install

      If i go look in the /lib/modules/2.6.32-5-686 dir i cant find the build dir either.

      Delete
    4. OK. Let's try this:

      1) First of all, try to switch system language to English for a moment.

      2) Try to delete everything and go through all steps again.

      3) After reaching error copy everything from the terminal to pastebin.com, and post me a link here, so I can check it out.

      Delete
  6. Thanks for the walkthrough. However, I may have applied your solution rashly, because my problem originally was that the cabled internet regularly broke down. After going through the steps, the connection is not even listed any more when plugging the cable in - I must have done something wrong :) Maybe you can imagine what happened? The commands uname -r and lspci -nn | grep 0200 give me the following information:
    02:00.0 Ethernet controller [0200]: Qualcomm Atheros AR8162 Fast Ethernet [1969:1090] (rev 08)
    3.13.0-45-generic
    I should mentioned that after your second step, blacklisting, a couple of errors were listed. However, these seemed to apply only to the points under "bluetooth" and others, so I figured the procedure might work anyway, and so it seemed. Do have an idea what to do? Suggestions are greatly appreciated, thanks again ;)
    Oh, and please note that I am a beginner, so if you need me to add information, please be precise with respect to what commands I should type in order to provide it.

    ReplyDelete
    Replies
    1. Howdy,

      It would be great if you would go through all steps again, and then posted whole terminal output to something like pastebin.com and after that posted the link here.

      From that I will be possibly able to say what went wrong.

      Delete
    2. As you see, I was wrong, the errors occurred during unloading, not blacklisting. Any ideas?

      Delete
    3. Did you try to reboot your computer?

      Delete
    4. I did, the changes I described set in after that.

      Delete
    5. 1) sudo modprobe alx

      2) sudo modprobe mac80211

      Command 1) should turn on your ethernet and command 2) should tun on your wifi. If you still behave as there is now wifi, try:

      3) sudo modprobe b43

      If it won't help, please give me output of those commands.

      Delete
    6. Fortunately, the wifi works fine. It is merely the LAN that troubles me, and it does not behave as if there was no wifi but as if there was no cable plugged in.

      However, modprobe alx changed this in the way that now, I just could connect to the internet using LAN, but sadly I returned back to the old problem and the internet connection broke down again quickly. Even more quickly this time than it had before. There are no outputs, as the command seems to have worked, just my internet connection doesn't.

      Delete
    7. I am sorry to hear that.

      I guess I won't be able to help you more with that. Sorry.

      Delete
    8. Oh, that is slightly disappointing but okay. Well, thank you anyway.

      Delete