Pages

Monday 30 January 2012

How to Configure bRoadcom on Linux

Since i am is Debian users as well, it's simple ways to setup broadcom sta bcm4313 :

On This Tutorial


Add a "non-free" component to /etc/apt/sources.list, for example:
# Debian Wheezy (testing)
deb http://ftp.us.debian.org/debian wheezy main contrib non-free

  1. # aptitude update
    # aptitude install firmware-brcm80211 wireless-tools
  2. As the driver may already be loaded, reinsert the module to access installed firmware:
    # modprobe -r brcmsmac ; modprobe brcmsmac
  3. Verify your device has an available interface:
    # iwconfig
    To find the Device ID's of Broadcom cards on your machines do:
    # lspci -n | grep 14e4
    # lsmod  | grep "b43\|ssb\|bcma\|wl"
    
    If you try to build this module but get an error message that looks like 
    this:
    
    make: *** /lib/modules/"release"/build: No such file or directory. Stop.
    
    Then you do not have the proper packages installed, since installing the 
    proper packages will create /lib/modules/"release"/build on your system.
    
    On Ubuntu, you will need headers and tools.  Try these commands:
    # apt-get install build-essential linux-headers-generic
    # apt-get build-dep linux
    
    To check to see if you have this directory do this:
    
    # ls /lib/modules/`uname -r`/build
    
    BUILD INSTRUCTIONS
    ------------------
    1. Setup the directory by untarring the proper tarball:
    
    For 32 bit:  hybrid-portsrc.tar.gz
    For 64 bit:  hybrid-portsrc-x86_64.tar.gz
    
    Example:
    # mkdir hybrid_wl
    # cd hybrid_wl
    # tar xzf <path>/hybrid-portsrc.tar or <path>/hybrid-portsrc-x86_64.tar.gz
    
    2. Build the driver as a Linux loadable kernel module (LKM):
    
    # make clean   (optional)
    # make
    
    When the build completes, it will produce a wl.ko file in the top level
    directory.
    This driver now supports the new linux cfg80211 wireless configuration API in
    addition to the older Wireless Extensions (Wext).  The makefile will
    automaticly build the right version for your system but it can be
    overridden if needed:
    
    # make API=WEXT
     or
    # make API=CFG80211
    
    # rmmod wl 
    # mv <path-to-prev-driver>/wl.ko <path-to-prev-driver>/wl.ko.orig
    # cp wl.ko <path-to-prev-driver>/wl.ko
    # depmod
    # modprobe wl
    
    The new wl driver should now be operational and your all done.
    
    Fresh installation:
    
    If any of these are installed, remove them:
    # rmmod b43
    # rmmod ssb
    # rmmod bcma
    # rmmod wl
    
    To blacklist these drivers and prevent them from loading in the future:
    # echo "blacklist ssb" >> /etc/modprobe.d/blacklist.conf
    # echo "blacklist bcma" >> /etc/modprobe.d/blacklist.conf
    # echo "blacklist b43" >> /etc/modprobe.d/blacklist.conf 
    # echo "blacklist b43legacy" >> /etc/modprobe.d/blacklist.conf
    # echo "blacklist brcmsmac" >> /etc/modprobe.d/blacklist.conf
    # echo "blacklist brcmfmac" >> /etc/modprobe.d/blacklist.conf
    # echo "blacklist brcm80211" >> /etc/modprobe.d/blacklist.conf
    
    # insmod <path-to-driver>/wl.ko
    # modprobe wl
    
    wl.ko is now operational.  It may take several seconds for the Network 
    Manager to notice a new network driver has been installed and show the
    surrounding wireless networks.
    
    If there was an error, see Common isstes below.
    
    Common issues:
    ----------------
    * After the insmod you may see this message:
      WARNING: modpost: missing MODULE_LICENSE()
      It is expected, not harmful and can be ignored.
    
    * If you see this message:
    
      "insmod: error inserting 'wl.ko': -1 Unknown symbol in module"
    
      Usually this means that one of the required modules (as mentioned above) is
      not loaded. Try this:
      # modprobe lib80211 or ieee80211_crypt_tkip (depending on your os)
      # modprobe cfg80211
        
      Now re-try to insmod the wl driver:
      # insmod wl.ko
      
    * If the wl driver loads but doesn't seem to do anything:
      the ssb module may be the cause.  Sometimes blacklisting ssb may not
      be enough to prevent it from loading and it loads anyway. (This is mostly
      seen on Ubuntu/Debian systems).
    
      Check to see if ssb, bcma, wl or b43 is loaded:
      # lsmod | grep "ssb\|wl\|b43\|bcma"
    
      If any of these are installed, remove them:
      # rmmod ssb
      # rmmod bcma
      # rmmod wl
      # insmod wl
    
      Back up the current boot ramfs and generate a new one:
      # cp /boot/initrd.img-`uname -r` somewheresafe
      # update-initramfs -u
      # reboot