Problem compiling BCM Wireless driver on 2.6.37 (lib80211 symbol issue)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear List,

I recently compiled and booted up the 2.6.37 kernel on my Ubuntu
(10.04), from 2.6.36.1. I have been trying to compile the Broadcom
Wireless driver on 2.6.37, after making some changes in the source
code. Just to add, this driver has been working fine on 2.6.36.1 which
my machine ran earlier.

---8<---
$> uname -a
Linux Tiger-L 2.6.37 #2 SMP Thu Mar 3 22:45:04 IST 2011 i686 GNU/Linux
$> lspci | grep Broadcom
03:00.0 Network controller: Broadcom Corporation BCM4312 802.11b/g (rev 01)
---8<---

I have been trying to compile the Broadcom driver
hybrid-portsrc-x86_32-v5.60.48.36.tar.gz, which I got from Broadcom
website. [ It is quite possible that newer version is available on the
same website, but I intend to get this version up, if possible.]

This driver requires the 80211 Library kernel module (lib80211.ko) to
be loaded as it accesses the security (crypto) algo functions which
are available in this library. Thus:

---8<---
$> modprobe lib80211
$> lsmod | grep lib80211
lib80211                5058  0
---8<---

Then, I made some changes in the code (as the code base was not
getting directly compiled on this new kernel). I have attached the
patch with this email in case that is required. Furtheron, on
compiling the module, following is what I get:

---8<--- (in the driver directory)
$> make clean
KBUILD_NOPEDANTIC=1 make -C /lib/modules/`uname -r`/build M=`pwd` clean
make[1]: Entering directory `/opt/kernels/linux-2.6.37'
  CLEAN   /home/shrey/work/Things_for_Wifi_on_Linux/wifi_driver_broadcom_2.6.37/.tmp_versions
  CLEAN   /home/shrey/work/Things_for_Wifi_on_Linux/wifi_driver_broadcom_2.6.37/Module.symvers
make[1]: Leaving directory `/opt/kernels/linux-2.6.37'
$> make
KBUILD_NOPEDANTIC=1 make -C /lib/modules/`uname -r`/build M=`pwd`
make[1]: Entering directory `/opt/kernels/linux-2.6.37'
  LD      /home/shrey/work/Things_for_Wifi_on_Linux/wifi_driver_broadcom_2.6.37/built-in.o
  CC [M]  /home/shrey/work/Things_for_Wifi_on_Linux/wifi_driver_broadcom_2.6.37/src/shared/linux_osl.o
  CC [M]  /home/shrey/work/Things_for_Wifi_on_Linux/wifi_driver_broadcom_2.6.37/src/wl/sys/wl_linux.o
  CC [M]  /home/shrey/work/Things_for_Wifi_on_Linux/wifi_driver_broadcom_2.6.37/src/wl/sys/wl_iw.o
  LD [M]  /home/shrey/work/Things_for_Wifi_on_Linux/wifi_driver_broadcom_2.6.37/wl.o
  Building modules, stage 2.
  MODPOST 1 modules
WARNING: "lib80211_get_crypto_ops"
[/home/shrey/work/Things_for_Wifi_on_Linux/wifi_driver_broadcom_2.6.37/wl.ko]
undefined!
  CC      /home/shrey/work/Things_for_Wifi_on_Linux/wifi_driver_broadcom_2.6.37/wl.mod.o
  LD [M]  /home/shrey/work/Things_for_Wifi_on_Linux/wifi_driver_broadcom_2.6.37/wl.ko
make[1]: Leaving directory `/opt/kernels/linux-2.6.37'
---8<---

On searching for the lib80211_get_crypto_ops symbol:

---8<---
$> cat /proc/kallsyms | grep lib80211_get_crypto_ops
f826273c r __ksymtab_lib80211_get_crypto_ops	[lib80211]
f82627b4 r __kstrtab_lib80211_get_crypto_ops	[lib80211]
f826278c r __kcrctab_lib80211_get_crypto_ops	[lib80211]
f8262020 T lib80211_get_crypto_ops	[lib80211] <<<#####
$>
$> zcat /proc/config.gz | grep -i lib80211
CONFIG_LIB80211=m                                             <<<#####
CONFIG_LIB80211_CRYPT_WEP=m
CONFIG_LIB80211_CRYPT_CCMP=m
CONFIG_LIB80211_CRYPT_TKIP=m
# CONFIG_LIB80211_DEBUG is not set
$>
---8<---

This is what I get when I inserted the kernel:

---8<---
$> sudo insmod ./wl.ko
[sudo] password for shrey:
insmod: error inserting './wl.ko': -1 Invalid parameters
shrey@Tiger-L:~/work/Things_for_Wifi_on_Linux/wifi_driver_broadcom_2.6.37$
dmesg | tail | grep wl
[ 1025.190669] wl: no symbol version for lib80211_get_crypto_ops
[ 1025.190674] wl: Unknown symbol lib80211_get_crypto_ops (err -22)
$>
---8<---

As far as I understand the symbol for lib80211_get_crypto_ops function
is available is exported:

---8<---
251     return alg->ops;
252 }
253 EXPORT_SYMBOL(lib80211_get_crypto_ops);
254
255 static void *lib80211_crypt_null_init(int keyidx)
256 {
257     return (void *)1;
"net/wireless/lib80211.c" 284 lines --89%--
---8<---

and hence, it should be available to my module on request. I am not
sure what is happening or where should I look next. Can anyone on the
list point me out as to what I could be missing. Also, initially the
compilation was giving issues about MODULE_LICENSE not being GPL,
which I explicitly did by adding in the code (that is not part of the
patch I have attached). I don't think that would affect this situation
as the symbol lib80211_get_crypto_ops is not restricted to GPL modules
only.

Any help would be deeply appreciated.

TIA,
Shreyansh
diff -urp a/src/shared/linux_osl.c b/src/shared/linux_osl.c
--- a/src/shared/linux_osl.c	2010-02-06 07:29:15.000000000 +0530
+++ b/src/shared/linux_osl.c	2011-03-20 14:45:23.000000000 +0530
@@ -24,6 +24,7 @@
 #include <pcicfg.h>
 
 #include <linux/fs.h>
+#include <linux/sched.h>
 
 #define PCI_CFG_RETRY 		10
 
diff -urp a/src/wl/sys/wl_iw.h b/src/wl/sys/wl_iw.h
--- a/src/wl/sys/wl_iw.h	2010-02-06 07:29:15.000000000 +0530
+++ b/src/wl/sys/wl_iw.h	2011-03-20 14:45:23.000000000 +0530
@@ -20,6 +20,7 @@
 #include <typedefs.h>
 #include <proto/ethernet.h>
 #include <wlioctl.h>
+#include <linux/semaphore.h>
 
 #define	WL_IW_RSSI_MINVAL		-200	
 #define	WL_IW_RSSI_NO_SIGNAL	-91	
diff -urp a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c
--- a/src/wl/sys/wl_linux.c	2010-02-06 07:29:15.000000000 +0530
+++ b/src/wl/sys/wl_linux.c	2011-03-20 14:48:39.000000000 +0530
@@ -59,6 +59,8 @@
 #include <wlioctl.h>
 #include <wlc_key.h>
 
+#include <net/lib80211.h>
+
 typedef const struct si_pub	si_t;
 
 typedef void wlc_info_t;
@@ -1416,7 +1418,9 @@ static void
 _wl_set_multicast_list(struct net_device *dev)
 {
 	wl_info_t *wl;
-	struct dev_mc_list *mclist;
+	/* struct dev_mc_list *mclist; */
+	struct netdev_hw_addr *ha;
+	int mc_count = netdev_mc_count(dev);
 	int i;
 
 	if (!dev)
@@ -1429,8 +1433,20 @@ _wl_set_multicast_list(struct net_device
 
 	if (wl->pub->up) {
 		wl->pub->allmulti = (dev->flags & IFF_ALLMULTI)? TRUE: FALSE;
+		i = 0;
+		netdev_for_each_mc_addr(ha, dev) {
+			if (i >= mc_count)
+				break;
+			if (i >= MAXMULTILIST) {
+				wl->pub->allmulti = TRUE;
+				i = 0;
+				break;
+			}
+			wl->pub->multicast[i] = *((struct ether_addr*) ha->addr);
+			i++;
+		}
 
-		for (i = 0, mclist = dev->mc_list; mclist && (i < dev->mc_count);
+	/*	for (i = 0, mclist = dev->mc_list; mclist && (i < mc_count);
 			i++, mclist = mclist->next) {
 			if (i >= MAXMULTILIST) {
 				wl->pub->allmulti = TRUE;
@@ -1438,7 +1454,7 @@ _wl_set_multicast_list(struct net_device
 				break;
 			}
 			wl->pub->multicast[i] = *((struct ether_addr*) mclist->dmi_addr);
-		}
+		} */
 		wl->pub->nmulticast = i;
 		wlc_set(wl->wlc, WLC_SET_PROMISC, (dev->flags & IFF_PROMISC));
 	}
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux