Skip to contentSkip to conversation

wl1251 build woes (compat-wireless 3.3.1-1, 3.1.1 as well as 2.6.39)

DISCUSSION Mr Dash Four 2 participants 4 messages Apr 21, 2012 – Apr 24, 2012

lore
Share & tools
lore
#0 lore raw

I am trying to build the wl1251 driver from compat-wireless 3.3.1-1, using a separate (Android-based) kernel as a base, but I am encountering a few snags:

Quoted 1 line

From the base compat-wireless-3.3.1-1 (CCOMPILER environemnt variable is set to the toolchain directory prefix I use for ARM):

[mockbuild@test1 compat-wireless-3.3.1-1]$ ./scripts/driver-select wl1251
[mockbuild@test1 compat-wireless-3.3.1-1]$ make ARCH=arm CROSS_COMPILE=$CCOMPILER KLIB=<android_kernel_dir> KLIB_BUILD=<android_kernel_dir>
/builddir/compat-wireless-3.3.1-1/config.mk:212: "WARNING: CONFIG_CFG80211_WEXT will be deactivated or not working because kernel was compiled with CONFIG_WIRELESS_EXT=n. Tools using wext interface like iwconfig will not work. To activate it build your kernel e.g. with CONFIG_LIBIPW=m." [...]
Building modules, stage 2.
MODPOST 3 modules

  CC      /builddir/compat-wireless-3.3-1/compat/compat.mod.o
  LD [M]  /builddir/compat-wireless-3.3-1/compat/compat.ko
  CC      /builddir/compat-wireless-3.3-1/net/mac80211/mac80211.mod.o
  LD [M]  /builddir/compat-wireless-3.3-1/net/mac80211/mac80211.ko
  CC      /builddir/compat-wireless-3.3-1/net/wireless/cfg80211.mod.o
  LD [M]  /builddir/compat-wireless-3.3-1/net/wireless/cfg80211.ko

make[1]: Leaving directory `<android_kernel_dir>'

Should I be worried about the above warning? I do *not* have "CONFIG_WIRELESS_EXT" anywhere in my (android kernel) .config, but do have CONFIG_WIRELESS=y as well as CONFIG_CFG80211_WEXT=y. Also, I can't see any of the wl1251 drivers from compat-wireless (located in drivers/net/wireless/wl1251) being built at all! Am I missing something?

On a slightly different note, I also tried to use previous versions of compat-wireless - 3.1.1 as well as 2.6.39-1 - but things got even more hairy. After executing make, I got this:

make[3]: *** No rule to make target /builddir/compat-wireless-3.1.1-1/net/wireless/db.txt', needed by /builddir/compat-wireless-2.6.39-1/net/wireless/regdb.c'. Stop.

After the above error I just copied db.txt from wireless-regdb-2011.04.28.tar.bz2 to net/wireless, but then got this next:

make[3]: *** No rule to make target /builddir/compat-wireless-3.1.1-1/net/wireless/genregdb.awk', needed by /builddir/compat-wireless-3.1.1-1/net/wireless/regdb.c'. Stop.

So, again, I copied genregdb.awk from the 3.3.1-1 version of compat-wireless, but that wasn't enough, unfortunately:

WARNING: "reg_regdb_size" [/builddir/compat-wireless-3.1.1-1/net/wireless/cfg80211.ko] undefined!
WARNING: "reg_regdb" [/builddir/compat-wireless-3.1.1-1/net/wireless/cfg80211.ko] undefined!

The wl1251 drivers are not built here either - drivers/net/wireless/wl1251 is untouched! Any help or advice as to how can I resolve this would very much appreciated, thanks!

#1 lore raw
Quoted 16 lines · Mr Dash Four

I am trying to build the wl1251 driver from compat-wireless 3.3.1-1, using a separate (Android-based) kernel as a base, but I am encountering a few snags:

From the base compat-wireless-3.3.1-1 (CCOMPILER environemnt variable is set to the toolchain directory prefix I use for ARM):

[mockbuild@test1 compat-wireless-3.3.1-1]$ ./scripts/driver-select wl1251
[mockbuild@test1 compat-wireless-3.3.1-1]$ make ARCH=arm CROSS_COMPILE=$CCOMPILER KLIB=<android_kernel_dir> KLIB_BUILD=<android_kernel_dir>
/builddir/compat-wireless-3.3.1-1/config.mk:212: "WARNING: CONFIG_CFG80211_WEXT will be deactivated or not working because kernel was compiled with CONFIG_WIRELESS_EXT=n. Tools using wext interface like iwconfig will not work. To activate it build your kernel e.g. with CONFIG_LIBIPW=m." [...]
Building modules, stage 2.
MODPOST 3 modules

  CC      /builddir/compat-wireless-3.3-1/compat/compat.mod.o
  LD [M]  /builddir/compat-wireless-3.3-1/compat/compat.ko
  CC      /builddir/compat-wireless-3.3-1/net/mac80211/mac80211.mod.o
  LD [M]  /builddir/compat-wireless-3.3-1/net/mac80211/mac80211.ko
  CC      /builddir/compat-wireless-3.3-1/net/wireless/cfg80211.mod.o
  LD [M]  /builddir/compat-wireless-3.3-1/net/wireless/cfg80211.ko
Quoted 3 lines

make[1]: Leaving directory `<android_kernel_dir>'

Should I be worried about the above warning? I do *not* have "CONFIG_WIRELESS_EXT" anywhere in my (android kernel) .config, but do have CONFIG_WIRELESS=y as well as CONFIG_CFG80211_WEXT=y. Also, I can't see any of the wl1251 drivers from compat-wireless (located in drivers/net/wireless/wl1251) being built at all! Am I missing something?

No, don't worry. This is harmless if you don't use WEXT. Just remove the CONFIG_CFG80211_WEXT from your .config and the warning should go away.

Quoted 4 lines

On a slightly different note, I also tried to use previous versions of compat-wireless - 3.1.1 as well as 2.6.39-1 - but things got even more hairy. After executing make, I got this:

make[3]: *** No rule to make target /builddir/compat-wireless-3.1.1-1/net/wireless/db.txt', needed by /builddir/compat-wireless-2.6.39-1/net/wireless/regdb.c'. Stop.

Quoted 8 lines

After the above error I just copied db.txt from wireless-regdb-2011.04.28.tar.bz2 to net/wireless, but then got this next:

make[3]: *** No rule to make target /builddir/compat-wireless-3.1.1-1/net/wireless/genregdb.awk', needed by /builddir/compat-wireless-3.1.1-1/net/wireless/regdb.c'. Stop.

So, again, I copied genregdb.awk from the 3.3.1-1 version of compat-wireless, but that wasn't enough, unfortunately:

WARNING: "reg_regdb_size" [/builddir/compat-wireless-3.1.1-1/net/wireless/cfg80211.ko] undefined!
WARNING: "reg_regdb" [/builddir/compat-wireless-3.1.1-1/net/wireless/cfg80211.ko] undefined!

Sometimes compat-wireless breaks, when syncing with the latest upstream sourcers. If the newest works for you, use that. ;)

Quoted 1 line

The wl1251 drivers are not built here either - drivers/net/wireless/wl1251 is untouched! Any help or advice as to how can I resolve this would very much appreciated, thanks!

If this is a recent compat-wireless, then the wl1251 driver was moved to drivers/net/wireless/ti/wl1251. Can you check that?

Signature · 2 lines
Cheers,
Luca.
#2 lore raw
Quoted 8 lines
Quoted 3 lines

Should I be worried about the above warning? I do *not* have "CONFIG_WIRELESS_EXT" anywhere in my (android kernel) .config, but do have CONFIG_WIRELESS=y as well as CONFIG_CFG80211_WEXT=y. Also, I can't see any of the wl1251 drivers from compat-wireless (located in drivers/net/wireless/wl1251) being built at all! Am I missing something?

No, don't worry. This is harmless if you don't use WEXT. Just remove the CONFIG_CFG80211_WEXT from your .config and the warning should go away.

OK, I'll do that, thanks!

Quoted 7 lines
Quoted 3 lines

WARNING: "reg_regdb_size" [/builddir/compat-wireless-3.1.1-1/net/wireless/cfg80211.ko] undefined!
WARNING: "reg_regdb" [/builddir/compat-wireless-3.1.1-1/net/wireless/cfg80211.ko] undefined!

Sometimes compat-wireless breaks, when syncing with the latest upstream sourcers. If the newest works for you, use that. ;)

That doesn't appear to be the case, unfortunately - see below.

Quoted 6 lines
Quoted 2 lines

The wl1251 drivers are not built here either - drivers/net/wireless/wl1251 is untouched! Any help or advice as to how can I resolve this would very much appreciated, thanks!

If this is a recent compat-wireless, then the wl1251 driver was moved to drivers/net/wireless/ti/wl1251. Can you check that?

I initially used compat-wireless-3.3.1-1 as it was the latest "stable" kernel edition released. The wl1251 drivers are in net/wireless/wl1251, not drivers/net/wireless/ti/wl1251. That is also the case with the latest released compat-wireless - 3.4-rc3-1.

I did a bit of hacking/tweaking, but ran into much bigger problems and simply gave up in the end. When I looked at various compat-wireless makefiles I saw that, somehow the inclusion of wl1251 as well as wl12xx depends on CONFIG_CRC7 and CONFIG_WL12XX_PLATFORM_DATA being set (the latter also depends on wl12xx, so if I wanted it included, I had to switch to "wl12xx" instead of "wl1251"). So, I did the following:

./scripts/driver-select restore
./scripts/driver-select wl12xx
make ARCH=arm CROSS_COMPILE=$CCOMPILER KLIB=<android_kernel_dir> KLIB_BUILD=<android_kernel_dir> CONFIG_CRC7=y CONFIG_WL12XX_PLATFORM_DATA=y

I then get the following errors:

/builddir/compat-wireless-3.3-1/drivers/net/wireless/wl12xx/sdio.c: In function 'wl12xx_sdio_power_on':
/builddir/compat-wireless-3.3-1/drivers/net/wireless/wl12xx/sdio.c:126:2: error: implicit declaration of function 'pm_runtime_enabled' [-Werror=implicit-function-declaration] /builddir/compat-wireless-3.3-1/drivers/net/wireless/wl12xx/sdio.c:132:7: error: void value not ignored as it ought to be /builddir/compat-wireless-3.3-1/drivers/net/wireless/wl12xx/sdio.c: In function 'wl12xx_sdio_power_off':
/builddir/compat-wireless-3.3-1/drivers/net/wireless/wl12xx/sdio.c:153:6: error: void value not ignored as it ought to be
cc1: some warnings being treated as errors

make[4]: *** [/builddir/compat-wireless-3.3-1/drivers/net/wireless/wl12xx/sdio.o] Error 1 make[3]: *** [/builddir/compat-wireless-3.3-1/drivers/net/wireless/wl12xx] Error 2 make[2]: *** [/builddir/compat-wireless-3.3-1/drivers/net/wireless] Error 2 make[1]: *** [_module_/builddir/compat-wireless-3.3-1] Error 2
make[1]: Leaving directory `<android_kernel_dir>'
make: *** [modules] Error 2

Apparently, "pm_runtime_enabled" is defined in include/linux/pm_runtime.h, but this is for the 3.0+ version of the kernel - I am using 2.6.37! Something seems to be seriously screwed up! The above is valid for all 3.x versions of compat-wireless I tried! I was under the impression that compat-wireless is backward-compatible with "older" kernel versions, like mine, is that not the case?!

When I tried the latest compat-wireless before 3.x (2.6.39-1) I don't get the first error, but get the other two, albeit with modified function names (wl1271_sdio_* instead of wl12xx_sdio_*).

In addition to the above, for some reason when I run compat-wireless for versions prior to 3.x (I tried 2 such versions - 2.6.39-1 and 2.6.38-2) I also get a weird error that "<android_kernel_dir>//builddir/compat-wireless-XXX/net/wireless/db.txt cannot be found" - the search path there is completely wrong, it should either be <android_kernel_dir>" or "/builddir/compat-wireless-XXX/net/wireless/db.txt" and not this weird concatenated path containing both!

Again, this only happens with the 2 releases prior to 3.x I tried and only when I have "db.txt" and "genregdb.awk" from 3.3.1-1 manually copied to net/wireless. Any help?

Luciano, seeing as you work for TI, I have one more query for you, if I may - the need for me to turn to build compat-wireless was borne out of my continuous, *completely fruitless* and *extremely frustrating* attempts for me to build a decent version of wpa_supplicant for my android device, which uses the "native" TI-supplied wireless driver for that device (tiwlan) - it proved an absolutely impossible task as the TI-supplied driver refuses to build with wpa_supplicant which has version any other than v5.11 (I have tried *all* released versions after this one - 6.11, 0.7.1, 0.7.3, 1.0-rc, 1.0 as well as the latest from git)! "Newer" TI-supplied drivers do *not* work with my TI-1251 device at all!

Is there a decent driver for TI-1251 which could be integrated with a relatively recent/decent version of the wpa_supplicant?

It is imperative that I build a decent version of wpa_supplicant for my device and it is the sole reason why I have chosen this route and turned to the Linux-based wireless stack, but unfortunately my assumption that the process there would be more straight-forward proved to be rather naive and my earlier optimism completely misplaced! :-(

#3 lore raw
Quoted 28 lines
Quoted 4 lines

If this is a recent compat-wireless, then the wl1251 driver was moved to drivers/net/wireless/ti/wl1251. Can you check that?

I initially used compat-wireless-3.3.1-1 as it was the latest "stable" kernel edition released. The wl1251 drivers are in net/wireless/wl1251, not drivers/net/wireless/ti/wl1251. That is also the case with the latest released compat-wireless - 3.4-rc3-1.

I did a bit of hacking/tweaking, but ran into much bigger problems and simply gave up in the end. When I looked at various compat-wireless makefiles I saw that, somehow the inclusion of wl1251 as well as wl12xx depends on CONFIG_CRC7 and CONFIG_WL12XX_PLATFORM_DATA being set (the latter also depends on wl12xx, so if I wanted it included, I had to switch to "wl12xx" instead of "wl1251"). So, I did the following:

./scripts/driver-select restore
./scripts/driver-select wl12xx
make ARCH=arm CROSS_COMPILE=$CCOMPILER KLIB=<android_kernel_dir> KLIB_BUILD=<android_kernel_dir> CONFIG_CRC7=y CONFIG_WL12XX_PLATFORM_DATA=y

I then get the following errors:

/builddir/compat-wireless-3.3-1/drivers/net/wireless/wl12xx/sdio.c: In function 'wl12xx_sdio_power_on':
/builddir/compat-wireless-3.3-1/drivers/net/wireless/wl12xx/sdio.c:126:2: error: implicit declaration of function 'pm_runtime_enabled' [-Werror=implicit-function-declaration] /builddir/compat-wireless-3.3-1/drivers/net/wireless/wl12xx/sdio.c:132:7: error: void value not ignored as it ought to be /builddir/compat-wireless-3.3-1/drivers/net/wireless/wl12xx/sdio.c: In function 'wl12xx_sdio_power_off':
/builddir/compat-wireless-3.3-1/drivers/net/wireless/wl12xx/sdio.c:153:6: error: void value not ignored as it ought to be
cc1: some warnings being treated as errors

make[4]: *** [/builddir/compat-wireless-3.3-1/drivers/net/wireless/wl12xx/sdio.o] Error 1 make[3]: *** [/builddir/compat-wireless-3.3-1/drivers/net/wireless/wl12xx] Error 2 make[2]: *** [/builddir/compat-wireless-3.3-1/drivers/net/wireless] Error 2 make[1]: *** [_module_/builddir/compat-wireless-3.3-1] Error 2
make[1]: Leaving directory `<android_kernel_dir>'
make: *** [modules] Error 2

Quoted 7 lines

Apparently, "pm_runtime_enabled" is defined in include/linux/pm_runtime.h, but this is for the 3.0+ version of the kernel - I am using 2.6.37! Something seems to be seriously screwed up! The above is valid for all 3.x versions of compat-wireless I tried! I was under the impression that compat-wireless is backward-compatible with "older" kernel versions, like mine, is that not the case?!

When I tried the latest compat-wireless before 3.x (2.6.39-1) I don't get the first error, but get the other two, albeit with modified function names (wl1271_sdio_* instead of wl12xx_sdio_*).

In addition to the above, for some reason when I run compat-wireless for versions prior to 3.x (I tried 2 such versions - 2.6.39-1 and 2.6.38-2) I also get a weird error that "<android_kernel_dir>//builddir/compat-wireless-XXX/net/wireless/db.txt cannot be found" - the search path there is completely wrong, it should either be <android_kernel_dir>" or "/builddir/compat-wireless-XXX/net/wireless/db.txt" and not this weird concatenated path containing both!

Again, this only happens with the 2 releases prior to 3.x I tried and only when I have "db.txt" and "genregdb.awk" from 3.3.1-1 manually copied to net/wireless. Any help?

I've had somewhat limited success with this - I was able to build 2.6.38-2 compat-wireless by manually copying "db.txt" as well as "genregdb.awk" to <android_kernel_dir>//builddir/compat-wireless-XXX/net/wireless (yeah, I created it manually) as well as forcing CONFIG_CRC7=y and CONFIG_WL12XX_PLATFORM_DATA=y.

"make modules-install" gives me 6 modules: compat, cfg80211, mac80211, wl1251, wl12xx_platform_data and wl1251_sdio. I "modprobe" them in that order, but then I get this error:

Compat-wireless backport release: compat-wireless-2.6.38.2-2 Backport based on linux-2.6-allstable.git v2.6.38.2

cfg80211: Calling CRDA to update world regulatory domain
cfg80211: World regulatory domain updated:
cfg80211:     (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
cfg80211:     (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
cfg80211:     (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
cfg80211:     (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
cfg80211:     (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
cfg80211:     (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)

***1 wl12xx_platform_data: module license 'unspecified' taints kernel. ***1 Disabling lock debugging due to kernel taint

***1 - this happens when I execute "modprobe wl12xx_platform_data". As evident from the above also, the firmware does not load either. Here is what I have:

localhost ~ # lsmod
Module Size Used by Tainted: P wl1251_sdio 3315 0
wl12xx_platform_data 540 1 wl1251_sdio

wl1251                 67238  1 wl1251_sdio
mac80211              199498  2 wl1251_sdio,wl1251
cfg80211              140370  2 wl1251,mac80211
compat                  3729  2 mac80211,cfg80211

localhost ~ # ls -las /etc/firmware/

    2 drwxr-xr-x    1 root     root          2048 Apr 22 00:18 .
    2 drwxr-xr-x    1 root     root          2048 Mar 28 00:33 ..
   14 -rw-r--r--    1 root     root         14087 Aug  1  2008 brf6300.bin
  190 -rw-r--r--    1 root     root        194188 Apr 21 23:07 
wl1251-fw.bin
    1 -rw-r--r--    1 root     root           752 Apr 21 23:07 

wl1251-nvs.bin

localhost ~ # iwconfig wlan0
wlan0 No such device

localhost ~ # iwconfig wlan0 power on
Error for wireless request "Set Power Management" (8B2D) :
GET failed on device wlan0 ; No such device.

I have also tried to build the latest snapshot (tried the one from 21 April 2012), but things there got a bit more messy - the ti drivers were indeed moved to the ti/ directory, the Makefile, however, after selecting "ti" (or any of the TI drivers - TI1251 or TI12XX) is completely empty. I did a bit of investigation and it turns out that the offending part of the code is in the select-driver script, which executes "egrep WL1251|WL12XX" on the original Makefile and since the Makefile CONFIG_* setting does not contain either of these values for the ti/ directory (it has something like CONFIG_TI_*) that results in an empty Makefile.

Even if I correct this and leave just the ti-related settings in that Makefile, I am still faced with my original problem I already pointed out above - wl1251, wl1251_sdio and wl12xx are not built - just compat, mac80211 and cfg80211 are compiled, so I am stuck - good and proper, again.

Luciano, anyone?