Wednesday, October 29, 2014

Broadcom brcmsmac without channel 12 & 13 - they did it again...

Just updated my EeePC to Ubuntu 14.10 and - bam: no wireless network connection anymore. Channels 12 & 13 are gone again.

This time we take the module parameter approach as in The missing Atheros channels to override the regulatory domain setting read from SPROM (which is US in my case where only 11 channels are allowed), because setting the regulatory domain with

iw reg set <regdom>
 
does not work.

diff -ru brcm80211.orig/brcmsmac/channel.c brcm80211/brcmsmac/channel.c
--- brcm80211.orig/brcmsmac/channel.c    2014-10-15 12:05:43.000000000 +0200
+++ brcm80211/brcmsmac/channel.c    2014-10-25 14:26:51.667082058 +0200
@@ -323,6 +323,8 @@
     return;
 }

+extern const char * get_param_regdom(void);
+
 struct brcms_cm_info *brcms_c_channel_mgr_attach(struct brcms_c_info *wlc)
 {
     struct brcms_cm_info *wlc_cm;
@@ -330,6 +332,20 @@
     struct ssb_sprom *sprom = &wlc->hw->d11core->bus->sprom;
     const char *ccode = sprom->alpha2;
     int ccode_len = sizeof(sprom->alpha2);
+    const char *regdom = get_param_regdom();
+    char regdom_sprom[3];
+    char regdom_param[3];
+
+    strncpy((char *)&regdom_sprom, ccode, 2);
+    regdom_sprom[2] = '\0';
+    brcms_info(wlc->hw->d11core, "Regulatory domain from SPROM: %s\n", regdom_sprom);
+
+    if (strlen(regdom) > 0) {
+        strncpy((char *)&regdom_param, regdom, 2);
+        regdom_param[2] = '\0';
+        brcms_info(wlc->hw->d11core, "Overriding regulatory domain from %s to %s\n" , regdom_sprom, regdom_param);
+        ccode = regdom;
+    }

     wlc_cm = kzalloc(sizeof(struct brcms_cm_info), GFP_ATOMIC);
     if (wlc_cm == NULL)
diff -ru brcm80211.orig/brcmsmac/mac80211_if.c brcm80211/brcmsmac/mac80211_if.c
--- brcm80211.orig/brcmsmac/mac80211_if.c    2014-10-15 12:05:43.000000000 +0200
+++ brcm80211/brcmsmac/mac80211_if.c    2014-10-25 14:20:46.158547508 +0200
@@ -112,6 +112,15 @@
 module_param_named(debug, brcm_msg_level, uint, S_IRUGO | S_IWUSR);
 #endif

+static char *regdom = "";
+module_param(regdom, charp, S_IRUGO);
+MODULE_PARM_DESC(regdom, "Override the regulatory domain from SPROM");
+
+const char * get_param_regdom(void)
+{
+    return regdom;
+}
+
 static struct ieee80211_channel brcms_2ghz_chantable[] = {
     CHAN2GHZ(1, 2412, IEEE80211_CHAN_NO_HT40MINUS),
     CHAN2GHZ(2, 2417, IEEE80211_CHAN_NO_HT40MINUS),


This adds the module parameter regdom to brcmsmac. To set this parameter persistently create /etc/modprobe.d/brcmsmac.conf with 

options brcmsmac regdom=<insert your regdom here>

Also it's a good idea to create /etc/modprobe.d/cfg80211.conf with

options cfg80211 ieee80211_regdom=<insert your regdom here>

Have fun!

Saturday, January 21, 2012

AMIGA Intro Gallery

The AMIGA Intro Gallery that existed since 2001 at http://www.geocities.com/amigaintros/ is back online again!

The gallery went offline when GeoCities closed on October, 26th 2009.

It can now be found at http://amigaintros.altervista.org/

Saturday, December 31, 2011

The missing channels - this time: Broadcom brcmsmac

In my article The missing Atheros channels I described how to hack the ath5k driver to support the wifi channels 12 and 13. This time I'll show you how to enable the two channels for the Linux Broadcom brcmsmac driver.

The brcmsmac driver sets up the available 2.4 GHz (802.11 b/g) channels with flag

LOCALE_RESTRICTED_SET_2G_SHORT

All you have to do is to change it to

LOCALE_RESTRICTED_NONE

in brcmsmac/channel.c and recompile the driver.

--- brcm80211/brcmsmac/channel.c.orig   2011-12-31 17:25:12.081733667 +0100
+++ brcm80211/brcmsmac/channel.c        2011-12-31 17:25:26.549801913 +0100
@@ -418,7 +418,7 @@
 static const struct locale_info locale_i = {   /* locale i. channel 1 - 13 */
        LOCALE_CHAN_01_11 | LOCALE_CHAN_12_13,
        LOCALE_RADAR_SET_NONE,
-       LOCALE_RESTRICTED_SET_2G_SHORT,
+       LOCALE_RESTRICTED_NONE,
        {QDB(19), QDB(19), QDB(19),
         QDB(19), QDB(19), QDB(19)},
        {20, 20, 20, 0},


After loading the new kernel modules brcmutil & brcmsmac you have to set the regulatory domain with

iw reg set <regdomain>


In dmesg instead of

[...]
cfg80211: Updating information on frequency 2462 MHz for a 20 MHz width channel with regulatory rule:
cfg80211: 2402000 KHz - 2472000 KHz @  KHz), (300 mBi, 2700 mBm)
cfg80211: Disabling freq 2467 MHz
cfg80211: Disabling freq 2472 MHz
cfg80211: Disabling freq 2484 MHz
cfg80211: Regulatory domain changed to country: US
[...]
cfg80211: Found new beacon on frequency: 2472 MHz (Ch 13) on phy3
wlan0: authenticate with xx:xx:xx:xx:xx:xx (try 1)
wlan0: authenticate with xx:xx:xx:xx:xx:xx (try 2)
wlan0: authenticate with xx:xx:xx:xx:xx:xx (try 3)
wlan0: authentication with xx:xx:xx:xx:xx:xx timed out
wlan0: authenticate with xx:xx:xx:xx:xx:xx (try 1)
wlan0: authenticate with xx:xx:xx:xx:xx:xx (try 2)
wlan0: authenticate with xx:xx:xx:xx:xx:xx (try 3)
wlan0: authentication with xx:xx:xx:xx:xx:xx timed out
[...]


you should now see something like

[...]
cfg80211: Updating information on frequency 2467 MHz for a 20 MHz width channel with regulatory rule:
cfg80211: 2400000 KHz - 2483500 KHz @ KHz), (N/A mBi, 2000 mBm)
cfg80211: Updating information on frequency 2472 MHz for a 20 MHz width channel with regulatory rule:
cfg80211: 2400000 KHz - 2483500 KHz @ KHz), (N/A mBi, 2000 mBm)
cfg80211: Disabling freq 2484 MHz
cfg80211: Regulatory domain changed to country: DE
[...]
cfg80211: Found new beacon on frequency: 2472 MHz (Ch 13) on phy4
wlan0: authenticate with xx:xx:xx:xx:xx:xx (try 1)
wlan0: authenticated
wlan0: associate with xx:xx:xx:xx:xx:xx (try 1)
wlan0: RX AssocResp from xx:xx:xx:xx:xx:xx (capab=0x431 status=0 aid=1)
wlan0: associated
[...]


2467 MHz = channel 12
2472 MHz = channel 13
2484 MHz = channel 14



Update May 12th, 2012:

The following linux kernel commit for 3.0.31, 3.3.4 & 3.2.17 is supposed to fix the
problems with channel 12 & 13:

brcm80211: smac: resume transmit fifo upon receiving frames

commit badc4f07622f0f7093a201638f45e85765f1b5e4 upstream.

There have been reports about not being able to use access-points on channel 12 and 13 or having connectivity issues when these channels were part of the selected regulatory domain. Upon switching to these channels the brcmsmac driver suspends the transmit dma fifos. This patch resumes them upon handing over the first received beacon to mac80211.

Tried this patch, but I still get
wlan0: authentication with xx:xx:xx:xx:xx:xx timed out 

Saturday, December 17, 2011

ReCAPTCHA For Dummies

Type the two words!

  (PS: It worked by typing only the first word.)

Thursday, March 3, 2011

The Microsoft Cloud(s)

That's what the Microsoft Cloud(s) look(s) like: ;-)


Colour: white
Size: ~3,5cm x 2cm
Weight: 6g (12g per package, one package contains 2 clouds!)

Facebook RL ;-)

.
K. gefällt das.
K. gefällt das nicht.

Friday, December 24, 2010

Serial level converter

Here are two pictures of a serial level converter I made. It uses the MAX3232 IC (Datasheet, PDF). Serial data with voltage levels between 3.3V and 5.0V are converted to symmetric RS-232 serial voltage levels.


Useful for hacking devices like routers, ... :)