{"id":681,"date":"2009-07-18T00:22:36","date_gmt":"2009-07-17T21:22:36","guid":{"rendered":"http:\/\/www.void.gr\/kargig\/blog\/?p=681"},"modified":"2010-01-14T20:16:39","modified_gmt":"2010-01-14T18:16:39","slug":"trying-to-achieve-a-more-stable-hybrid-broadcom-wl-kernel-module-for-broadcom-4328","status":"publish","type":"post","link":"https:\/\/www.void.gr\/kargig\/blog\/2009\/07\/18\/trying-to-achieve-a-more-stable-hybrid-broadcom-wl-kernel-module-for-broadcom-4328\/","title":{"rendered":"Trying to achieve a more stable hybrid (broadcom-wl) kernel module for broadcom 4328"},"content":{"rendered":"<p>On my <a href=\"http:\/\/support.apple.com\/kb\/SP5\">Macbook (4,1)<\/a> I am currently using Debian with kernel 2.6.30-1-686-bigmem. This Macbook has Broadcom 4328 wireless chipset installed (02:00.0 Network controller: Broadcom Corporation BCM4328 802.11a\/b\/g\/n (rev 03)) and unfortunately the necessary <a href=\"http:\/\/www.broadcom.com\/support\/802.11\/linux_sta.php\">kernel module provided by Broadcom<\/a> is pretty unstable. Or very unstable. Oh well&#8230;it&#8217;s totally unstable.<\/p>\n<p>I had random freezes, usually when I first booted and tried to modprobe the module. After some searching around the net and a lot of experiments I&#8217;ve managed to create a kernel module that looks quite stable. At least I stopped getting any more lockups and freezes&#8230;To reproduce the module with the patches I&#8217;ve used follow the directions bellow step by step.<\/p>\n<p><em>Find your kernel version<\/em>:<br \/>\n<code>mybox:~# uname -r<br \/>\n2.6.30-1-686-bigmem<\/code><\/p>\n<p><em>Install kernel header files related to the kernel version you found (on the above example it is: 2.6.30-1-686-bigmem)<\/em>:<br \/>\n<code>mybox:~# aptitude install linux-headers-2.6.30-1-686-bigmem<\/code><\/p>\n<p>Remember to replace the version (2.6.30-1-6-bigmem) with the output of your <code>mybox:~# uname -r<\/code><\/p>\n<p><em>Create necessary dirs<\/em>:<br \/>\n<code>mybox:~# mkdir hybrid_wl<br \/>\nmybox:~# cd hybrid_wl<\/code><\/p>\n<p><em>Download Linux drivers package from Broadcom:<\/em><br \/>\n<a href=\"http:\/\/www.broadcom.com\/docs\/linux_sta\/hybrid-portsrc-x86_32-v5_10_91_9.tar.gz\">802.11 Linux STA 32-bit Driver<\/a><br \/>\n(Driver info site: <a href=\"http:\/\/www.broadcom.com\/support\/802.11\/linux_sta.php\">802.11 Linux STA driver<\/a>)<br \/>\n<code>mybox:~\/hybrid_wl# wget http:\/\/www.broadcom.com\/docs\/linux_sta\/hybrid-portsrc-x86_32-v5_10_91_9.tar.gz<\/p>\n<p><em>Download a few more patches from Archlinux and Gentoo:<\/em><br \/>\n<a href=\"http:\/\/aur.archlinux.org\/packages\/broadcom-wl\/broadcom-wl\/hidden-essid.patch\">hidden-essid patch<\/a><br \/>\n<a href=\"http:\/\/aur.archlinux.org\/packages\/broadcom-wl\/broadcom-wl\/broadcom-sta-5.10.91.9-linux-2.6.30.patch\">2.6.30 patch 1<\/a><br \/>\n<a href=\"http:\/\/aur.archlinux.org\/packages\/broadcom-wl\/broadcom-wl\/broadcom-sta-5.10.91.9-linux-2.6.30-2.patch\">2.6.30 patch 2 <\/a><br \/>\n<a href=\"http:\/\/bugs.gentoo.org\/attachment.cgi?id=195182\">hybrid-portsrc-x86_32-v5_10_91_9-convert_to_net_device_ops.diff<\/a><br \/>\n<\/code><code>mybox:~\/hybrid_wl# wget http:\/\/aur.archlinux.org\/packages\/broadcom-wl\/broadcom-wl\/hidden-essid.patch<br \/>\nmybox:~\/hybrid_wl# wget http:\/\/aur.archlinux.org\/packages\/broadcom-wl\/broadcom-wl\/broadcom-sta-5.10.91.9-linux-2.6.30.patch<br \/>\nmybox:~\/hybrid_wl# wget http:\/\/aur.archlinux.org\/packages\/broadcom-wl\/broadcom-wl\/broadcom-sta-5.10.91.9-linux-2.6.30-2.patch<br \/>\nmybox:~\/hybrid_wl# wget -O hybrid-portsrc-x86_32-v5_10_91_9-convert_to_net_device_ops.diff http:\/\/bugs.gentoo.org\/attachment.cgi?id=195182<\/code><\/p>\n<p><em>Extract package:<\/em><br \/>\n<code>mybox:~\/hybrid_wl# tar -xzf \/path\/to\/hybrid-portsrc-x86_32-v5_10_91_9.tar.gz<\/code><\/p>\n<p><em>Start Patching:<\/em><br \/>\n<code>mybox:~\/hybrid_wl# sed -i hidden-essid.patch -e 's|5.10.79.10|src\/wl\/sys|g'<br \/>\nmybox:~\/hybrid_wl# patch -p0 &lt; hidden-essid.patch<br \/>\npatching file src\/wl\/sys\/wl_iw.c<br \/>\nmybox:~\/hybrid_wl# sed -i broadcom-sta-5.10.91.9-linux-2.6.30.patch -e 's|hybrid-portsrc-x86_32-v5_10_91_9.orig\/||g'<br \/>\nmybox:~\/hybrid_wl# sed -i broadcom-sta-5.10.91.9-linux-2.6.30.patch -e 's|hybrid-portsrc-x86_32-v5_10_91_9\/||g'<br \/>\nmybox:~\/hybrid_wl# patch -p0 &lt;broadcom-sta-5.10.91.9-linux-2.6.30.patch<br \/>\npatching file src\/wl\/sys\/wl_iw.c<br \/>\nHunk #1 succeeded at 611 (offset 1 line).<br \/>\nHunk #2 succeeded at 640 (offset 1 line).<br \/>\nHunk #3 succeeded at 1119 (offset 1 line).<br \/>\nHunk #4 succeeded at 1147 (offset 1 line).<br \/>\nHunk #5 succeeded at 1807 (offset 1 line).<br \/>\nHunk #6 succeeded at 1942 (offset 1 line).<br \/>\npatching file src\/wl\/sys\/wl_linux.c<br \/>\npatching file src\/wl\/sys\/wl_linux.h<br \/>\nmybox:~\/hybrid_wl# patch -p0 &lt; broadcom-sta-5.10.91.9-linux-2.6.30-2.patch<br \/>\npatching file src\/wl\/sys\/wl_linux.c<br \/>\nmybox:~\/hybrid_wl# sed -i hybrid-portsrc-x86_32-v5_10_91_9-convert_to_net_device_ops.diff -e 's|a\/src\/|src\/|g'<br \/>\nmybox:~\/hybrid_wl# sed -i hybrid-portsrc-x86_32-v5_10_91_9-convert_to_net_device_ops.diff -e 's|b\/src\/|src\/|g'<br \/>\nmybox:~\/hybrid_wl# patch -p0 &lt; hybrid-portsrc-x86_32-v5_10_91_9-convert_to_net_device_ops.diff<br \/>\npatching file src\/wl\/sys\/wl_linux.c<br \/>\nHunk #1 succeeded at 225 (offset 6 lines).<br \/>\npatching file src\/wl\/sys\/wl_iw.c<\/code><\/p>\n<p><em>Compile the kernel module:<\/em><br \/>\n<code>mybox:~\/hybrid_wl# make -C \/lib\/modules\/2.6.30-1-686-bigmem\/build M=`pwd` clean<br \/>\nmake: Entering directory `\/usr\/src\/linux-headers-2.6.30-1-686-bigmem'<br \/>\nmake: Leaving directory `\/usr\/src\/linux-headers-2.6.30-1-686-bigmem'<br \/>\nmybox:~\/hybrid_wl#  make -C \/lib\/modules\/2.6.30-1-686-bigmem\/build M=`pwd`<br \/>\nmake: Entering directory `\/usr\/src\/linux-headers-2.6.30-1-686-bigmem'<br \/>\n  LD      \/root\/hybrid_wl\/built-in.o<br \/>\n  CC [M]  \/root\/hybrid_wl\/src\/wl\/sys\/wl_linux.o<br \/>\n  CC [M]  \/root\/hybrid_wl\/src\/wl\/sys\/wl_iw.o<br \/>\n  CC [M]  \/root\/hybrid_wl\/src\/shared\/linux_osl.o<br \/>\n  LD [M]  \/root\/hybrid_wl\/wl.o<br \/>\n  Building modules, stage 2.<br \/>\n  MODPOST 1 modules<br \/>\nWARNING: modpost: missing MODULE_LICENSE() in \/root\/hybrid_wl\/wl.o<br \/>\nsee include\/linux\/module.h for more information<br \/>\n  CC      \/root\/hybrid_wl\/wl.mod.o<br \/>\n  LD [M]  \/root\/hybrid_wl\/wl.ko<br \/>\nmake: Leaving directory `\/usr\/src\/linux-headers-2.6.30-1-686-bigmem'<\/code><\/p>\n<p><em>Install the new module:<\/em><br \/>\n<code>mybox:~\/hybrid_wl# cp wl.ko \/lib\/modules\/2.6.30-1-686-bigmem\/kernel\/drivers\/net\/wireless\/<br \/>\nmybox:~\/hybrid_wl# depmod<br \/>\nmybox:~\/hybrid_wl# modprobe wl<\/code><\/p>\n<p><em>Check if everything loads correctly:<\/em><br \/>\n<code>mybox:~\/hybrid_wl# dmesg |tail<br \/>\n[   66.229797] lib80211: common routines for IEEE802.11 drivers<br \/>\n[   66.229805] lib80211_crypt: registered algorithm 'NULL'<br \/>\n[   66.301793] wl: module license 'unspecified' taints kernel.<br \/>\n[   66.301802] Disabling lock debugging due to kernel taint<br \/>\n[   66.305919] wl 0000:02:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16<br \/>\n[   66.305933] wl 0000:02:00.0: setting latency timer to 64<br \/>\n[   66.406146] lib80211_crypt: registered algorithm 'TKIP'<br \/>\n[   66.408646] eth1: Broadcom BCM4328 802.11 Wireless Controller 5.10.91.9<br \/>\n[   76.524135] eth1: no IPv6 routers present<\/code><\/p>\n<p>You can also chek the iwconfig output. Hopefully everything will be fine&#8230;<br \/>\nI hope this saves a few hours of searching and experimenting for some people&#8230;<\/p>\n<p>References:<br \/>\n1) <a href=\"http:\/\/www.broadcom.com\/support\/802.11\/linux_sta.php\">802.11 Linux STA driver <\/a><br \/>\n2) <a href=\"http:\/\/aur.archlinux.org\/packages.php?ID=19514\">AUR broadcom-wl 5.10.91.9-2<\/a><br \/>\n3) <a href=\"http:\/\/bugs.gentoo.org\/248450\">Gentoo Bug: 284450 (New ebuild: net\/wireless\/broadcom-sta)<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>On my Macbook (4,1) I am currently using Debian with kernel 2.6.30-1-686-bigmem. This Macbook has Broadcom 4328 wireless chipset installed (02:00.0 Network controller: Broadcom Corporation BCM4328 802.11a\/b\/g\/n (rev 03)) and unfortunately the necessary kernel module provided by Broadcom is pretty unstable. Or very unstable. Oh well&#8230;it&#8217;s totally unstable. I had random freezes, usually when I [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ep_exclude_from_search":false,"footnotes":""},"categories":[3],"tags":[162,156,160,37,150,33,601,158,595,159,157,161],"class_list":["post-681","post","type-post","status-publish","format-standard","hentry","category-linux","tag-2-6-30","tag-archlinux","tag-broadcom","tag-bug","tag-bugfix","tag-debian","tag-gentoo","tag-kernel","tag-linux","tag-module","tag-patch","tag-wireless"],"aioseo_notices":[],"views":32403,"_links":{"self":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts\/681","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/comments?post=681"}],"version-history":[{"count":23,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts\/681\/revisions"}],"predecessor-version":[{"id":718,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts\/681\/revisions\/718"}],"wp:attachment":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/media?parent=681"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/categories?post=681"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/tags?post=681"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}