Hi,

With your patch (ie when enabling cfg80211), I get a lot of syslog messages 
like these :
ERROR @wl_cfg80211_get_station : Could not get rssi (-1)
ERROR @wl_cfg80211_get_station : Could not get rate (-1) 

After reading a thread[1] from ArchLinux users and having a look at the code 
of brcm80211 driver[2], I think we (need to|can safely) remove the capable() 
call made in function wl_ioctl() from file wl_linux.c.

Oddly, ioctl call sometimes returns an EINVAL error when getting RSSI value, 
the test is:

iwconfig wlan0 # No error / bit rate value is displayed
iwconfig        # EINVAL error / bit rate value is missing

Error also occurs when I activate my network monitoring applet (kde, but same 
behaviour with Conky, see[1]).

So could you please test attached patch and tell me if it's ok for you ?

Kind regards, 
Cyril Lacoux


[1]: http://aur.archlinux.org/packages.php?ID=19514&comments=all
[2]: http://git.kernel.org/?p=linux/kernel/git/stable/linux-
stable.git;a=tree;f=drivers/net/wireless/brcm80211/brcmfmac;h=255de2482b15350b48b385c90b44a31a0247321f;hb=76e10d158efb6d4516018846f60c2ab5501900bc
 file: wl_cfg80211.c, function brcmf_cfg80211_get_station
 file: dhd_linux.c, function brcmf_exec_dcmd
Description: Use cfg80211 with 3.0 kernels / allow normal users to send ioctl requests
Author: Jacopo Corbetta <jacopo.corbe...@gmail.com>
Author: Cyril Lacoux <clac...@easter-eggs.com>
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=672677
Last-Update: 2012-05-24

Index: broadcom-sta-5.100.82.112/amd64/Makefile
===================================================================
--- broadcom-sta-5.100.82.112.orig/amd64/Makefile	2012-05-24 09:44:35.748118341 +0400
+++ broadcom-sta-5.100.82.112/amd64/Makefile	2012-05-24 09:45:35.040119858 +0400
@@ -16,7 +16,7 @@
 ifneq ($(KERNELRELEASE),)
 
   LINUXVER_GOODFOR_CFG80211:=$(strip $(shell \
-    if [ "$(VERSION)" -ge "2" -a "$(PATCHLEVEL)" -ge "6" -a "$(SUBLEVEL)" -ge "32" ]; then \
+    if [ "$(VERSION)" -ge "3" -o "$(VERSION)" -ge "2" -a "$(PATCHLEVEL)" -ge "6" -a "$(SUBLEVEL)" -ge "32" ]; then \
       echo TRUE; \
     else \
       echo FALSE; \
@@ -24,7 +24,7 @@
   ))
 
     LINUXVER_WEXT_ONLY:=$(strip $(shell \
-    if [ "$(VERSION)" -ge "2" -a "$(PATCHLEVEL)" -ge "6" -a "$(SUBLEVEL)" -ge "17" ]; then \
+    if [ "$(VERSION)" -ge "3" -o "$(VERSION)" -ge "2" -a "$(PATCHLEVEL)" -ge "6" -a "$(SUBLEVEL)" -ge "17" ]; then \
       echo FALSE; \
     else \
       echo TRUE; \
Index: broadcom-sta-5.100.82.112/amd64/src/wl/sys/wl_linux.c
===================================================================
--- broadcom-sta-5.100.82.112.orig/amd64/src/wl/sys/wl_linux.c	2012-05-24 09:45:02.520119025 +0400
+++ broadcom-sta-5.100.82.112/amd64/src/wl/sys/wl_linux.c	2012-05-24 09:46:52.116121834 +0400
@@ -1581,11 +1581,7 @@
 	}
 
 	WL_LOCK(wl);
-	if (!capable(CAP_NET_ADMIN)) {
-		bcmerror = BCME_EPERM;
-	} else {
-		bcmerror = wlc_ioctl(wl->wlc, ioc.cmd, buf, ioc.len, wlif->wlcif);
-	}
+	bcmerror = wlc_ioctl(wl->wlc, ioc.cmd, buf, ioc.len, wlif->wlcif);
 	WL_UNLOCK(wl);
 
 done1:
Index: broadcom-sta-5.100.82.112/amd64/src/wl/sys/wl_cfg80211.c
===================================================================
--- broadcom-sta-5.100.82.112.orig/amd64/src/wl/sys/wl_cfg80211.c	2012-05-24 09:45:33.268119813 +0400
+++ broadcom-sta-5.100.82.112/amd64/src/wl/sys/wl_cfg80211.c	2012-05-24 09:55:30.184135098 +0400
@@ -1466,7 +1466,10 @@
 		scb_val.val = 0;
 		err = wl_dev_ioctl(dev, WLC_GET_RSSI, &scb_val, sizeof(scb_val_t));
 		if (err) {
-			WL_ERR(("Could not get rssi (%d)\n", err));
+			if (err != -EINVAL) {
+				// Don't fill syslog with EINVAL error
+				WL_ERR(("Could not get rssi (%d)\n", err));
+			}
 			return err;
 		}
 		rssi = dtoh32(scb_val.val);

Reply via email to