Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fix SD WLAN to compile against new kernels (2.6.35 - 3.1)
diff -Naur a/SD_WLAN/SD-WLAN-BT-8688-LINUX2625-SAAR-10.49.3.p70-26609.P64_B1/wlan_src/Makefile b/SD_WLAN/SD-WLAN-BT-8688-LINUX2625-SAAR-10.49.3.p70-26609.P64_B1/wlan_src/Makefile
--- a/SD_WLAN/SD-WLAN-BT-8688-LINUX2625-SAAR-10.49.3.p70-26609.P64_B1/wlan_src/Makefile 2010-07-13 22:08:32.000000000 +0200
+++ b/SD_WLAN/SD-WLAN-BT-8688-LINUX2625-SAAR-10.49.3.p70-26609.P64_B1/wlan_src/Makefile 2011-11-10 11:11:37.288408994 +0100
@@ -89,7 +89,7 @@
# ARCH specifies the architecture of the target processor, this kernel
# module will run.
# ARCH can be set on the command line
-# make ARCH=<arm/i386>
+# make ARCH=<arm/x86>
# Alternatively ARCH can be set in the environment
# Default values of ARCH for specific platform are set below.
ARCH ?= arm
diff -Naur a/SD_WLAN/SD-WLAN-BT-8688-LINUX2625-SAAR-10.49.3.p70-26609.P64_B1/wlan_src/wlan/wlan_drv.h b/SD_WLAN/SD-WLAN-BT-8688-LINUX2625-SAAR-10.49.3.p70-26609.P64_B1/wlan_src/wlan/wlan_drv.h
--- a/SD_WLAN/SD-WLAN-BT-8688-LINUX2625-SAAR-10.49.3.p70-26609.P64_B1/wlan_src/wlan/wlan_drv.h 2010-07-13 22:08:32.000000000 +0200
+++ b/SD_WLAN/SD-WLAN-BT-8688-LINUX2625-SAAR-10.49.3.p70-26609.P64_B1/wlan_src/wlan/wlan_drv.h 2011-11-10 11:11:37.288408994 +0100
@@ -727,11 +727,12 @@
wlan_copy_mcast_addr(wlan_adapter * Adapter, struct net_device *dev)
{
int i = 0;
- struct dev_mc_list *mcptr = dev->mc_list;
+ struct netdev_hw_addr *ha;
- for (i = 0; i < dev->mc_count; i++) {
- memcpy(&Adapter->MulticastList[i], mcptr->dmi_addr, ETH_ALEN);
- mcptr = mcptr->next;
+ netdev_for_each_mc_addr(ha, dev)
+ {
+ memcpy(&Adapter->MulticastList[i], ha->addr, ETH_ALEN);
+ i++;
}
return i;
diff -Naur a/SD_WLAN/SD-WLAN-BT-8688-LINUX2625-SAAR-10.49.3.p70-26609.P64_B1/wlan_src/wlan/wlan_headers.h b/SD_WLAN/SD-WLAN-BT-8688-LINUX2625-SAAR-10.49.3.p70-26609.P64_B1/wlan_src/wlan/wlan_headers.h
--- a/SD_WLAN/SD-WLAN-BT-8688-LINUX2625-SAAR-10.49.3.p70-26609.P64_B1/wlan_src/wlan/wlan_headers.h 2010-07-13 22:08:32.000000000 +0200
+++ b/SD_WLAN/SD-WLAN-BT-8688-LINUX2625-SAAR-10.49.3.p70-26609.P64_B1/wlan_src/wlan/wlan_headers.h 2011-11-10 11:12:58.048412861 +0100
@@ -53,6 +53,7 @@
#include <linux/proc_fs.h>
#include <linux/ptrace.h>
#include <linux/string.h>
+#include <linux/hardirq.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
#include <linux/config.h>
diff -Naur a/SD_WLAN/SD-WLAN-BT-8688-LINUX2625-SAAR-10.49.3.p70-26609.P64_B1/wlan_src/wlan/wlan_linux.h b/SD_WLAN/SD-WLAN-BT-8688-LINUX2625-SAAR-10.49.3.p70-26609.P64_B1/wlan_src/wlan/wlan_linux.h
--- a/SD_WLAN/SD-WLAN-BT-8688-LINUX2625-SAAR-10.49.3.p70-26609.P64_B1/wlan_src/wlan/wlan_linux.h 2010-07-13 22:08:32.000000000 +0200
+++ b/SD_WLAN/SD-WLAN-BT-8688-LINUX2625-SAAR-10.49.3.p70-26609.P64_B1/wlan_src/wlan/wlan_linux.h 2011-11-10 11:20:28.178434424 +0100
@@ -304,7 +304,11 @@
#define MODULE_PUT module_put(THIS_MODULE)
#endif
-#define OS_INIT_SEMAPHORE(x) init_MUTEX(x)
+#ifndef init_MUTEX
+#define OS_INIT_SEMAPHORE(x) sema_init(x, 1)
+#else
+#define OS_INIT_SEMAPHORE(x) init_MUTEX(x)
+#endif
#define OS_ACQ_SEMAPHORE_BLOCK(x) down_interruptible(x)
#define OS_ACQ_SEMAPHORE_NOBLOCK(x) down_trylock(x)
#define OS_REL_SEMAPHORE(x) up(x)
diff -Naur a/SD_WLAN/SD-WLAN-BT-8688-LINUX2625-SAAR-10.49.3.p70-26609.P64_B1/wlan_src/wlan/wlan_main.c b/SD_WLAN/SD-WLAN-BT-8688-LINUX2625-SAAR-10.49.3.p70-26609.P64_B1/wlan_src/wlan/wlan_main.c
--- a/SD_WLAN/SD-WLAN-BT-8688-LINUX2625-SAAR-10.49.3.p70-26609.P64_B1/wlan_src/wlan/wlan_main.c 2010-07-13 22:08:32.000000000 +0200
+++ b/SD_WLAN/SD-WLAN-BT-8688-LINUX2625-SAAR-10.49.3.p70-26609.P64_B1/wlan_src/wlan/wlan_main.c 2011-11-10 11:11:37.288408994 +0100
@@ -663,7 +663,7 @@
/* Multicast */
Adapter->CurrentPacketFilter &= ~HostCmd_ACT_MAC_PROMISCUOUS_ENABLE;
- if (dev->flags & IFF_ALLMULTI || dev->mc_count >
+ if (dev->flags & IFF_ALLMULTI || netdev_mc_count(dev) >
MRVDRV_MAX_MULTICAST_LIST_SIZE) {
PRINTM(INFO, "Enabling All Multicast!\n");
Adapter->CurrentPacketFilter |=
@@ -672,7 +672,7 @@
Adapter->CurrentPacketFilter &=
~HostCmd_ACT_MAC_ALL_MULTICAST_ENABLE;
- if (!dev->mc_count) {
+ if (!netdev_mc_count(dev)) {
PRINTM(INFO, "No multicast addresses - "
"disabling multicast!\n");
@@ -684,7 +684,7 @@
PRINTM(INFO, "Multicast addresses: %d\n", dev->mc_count);
- for (i = 0; i < dev->mc_count; i++) {
+ for (i = 0; i < netdev_mc_count(dev); i++) {
PRINTM(INFO, "Multicast address %d:"
"%x %x %x %x %x %x\n", i,
Adapter->MulticastList[i][0],
diff -Naur a/SD_WLAN/SD-WLAN-BT-8688-LINUX2625-SAAR-10.49.3.p70-26609.P64_B1/wlan_src/wlan/wlan_proc.c b/SD_WLAN/SD-WLAN-BT-8688-LINUX2625-SAAR-10.49.3.p70-26609.P64_B1/wlan_src/wlan/wlan_proc.c
--- a/SD_WLAN/SD-WLAN-BT-8688-LINUX2625-SAAR-10.49.3.p70-26609.P64_B1/wlan_src/wlan/wlan_proc.c 2010-07-13 22:08:32.000000000 +0200
+++ b/SD_WLAN/SD-WLAN-BT-8688-LINUX2625-SAAR-10.49.3.p70-26609.P64_B1/wlan_src/wlan/wlan_proc.c 2011-11-10 11:11:37.288408994 +0100
@@ -72,7 +72,7 @@
int i;
char *p = page;
struct net_device *netdev = data;
- struct dev_mc_list *mcptr = netdev->mc_list;
+ struct netdev_hw_addr *ha;
char fmt[64];
wlan_private *priv = (wlan_private *) netdev_priv(netdev);
wlan_adapter *Adapter = priv->adapter;
@@ -97,7 +97,7 @@
netdev->dev_addr[2], netdev->dev_addr[3],
netdev->dev_addr[4], netdev->dev_addr[5]);
- p += sprintf(p, "MCCount=\"%d\"\n", netdev->mc_count);
+ p += sprintf(p, "MCCount=\"%d\"\n", netdev_mc_count(netdev));
p += sprintf(p, "ESSID=\"%s\"\n",
(u8 *) Adapter->CurBssParams.BSSDescriptor.Ssid.Ssid);
p += sprintf(p, "Channel=\"%d\"\n",
@@ -107,15 +107,16 @@
/*
* Put out the multicast list
*/
- for (i = 0; i < netdev->mc_count; i++) {
+ i = 0;
+ netdev_for_each_mc_addr(ha, netdev) {
p += sprintf(p,
"MCAddr[%d]=\"%02x:%02x:%02x:%02x:%02x:%02x\"\n",
i,
- mcptr->dmi_addr[0], mcptr->dmi_addr[1],
- mcptr->dmi_addr[2], mcptr->dmi_addr[3],
- mcptr->dmi_addr[4], mcptr->dmi_addr[5]);
+ ha->addr[0], ha->addr[1],
+ ha->addr[2], ha->addr[3],
+ ha->addr[4], ha->addr[5]);
- mcptr = mcptr->next;
+ i++;
}
p += sprintf(p, "num_tx_bytes = %lu\n", priv->stats.tx_bytes);
p += sprintf(p, "num_rx_bytes = %lu\n", priv->stats.rx_bytes);
@fleger
Owner

Compiles fine against a 2.6.38 kernel on i686 and arm targets

@voltagex

Hey Fleger, I get the following problem

voltagex@osiris:~/src$ patch -p1 < sd_wlan_2.6.35.diff
patching file SD_WLAN/SD-WLAN-BT-8688-LINUX2625-SAAR-10.49.3.p70-26609.P64_B1/wlan_src/Makefile
patching file SD_WLAN/SD-WLAN-BT-8688-LINUX2625-SAAR-10.49.3.p70-26609.P64_B1/wlan_src/wlan/wlan_drv.h
patching file SD_WLAN/SD-WLAN-BT-8688-LINUX2625-SAAR-10.49.3.p70-26609.P64_B1/wlan_src/wlan/wlan_linux.h
Hunk #1 FAILED at 304.
1 out of 1 hunk FAILED -- saving rejects to file SD_WLAN/SD-WLAN-BT-8688-LINUX2625-SAAR-10.49.3.p70-26609.P64_B1/wlan_src/wlan/wlan_linux.h.rej
patching file SD_WLAN/SD-WLAN-BT-8688-LINUX2625-SAAR-10.49.3.p70-26609.P64_B1/wlan_src/wlan/wlan_main.c
patching file SD_WLAN/SD-WLAN-BT-8688-LINUX2625-SAAR-10.49.3.p70-26609.P64_B1/wlan_src/wlan/wlan_proc.c

@fleger
Owner

I uploaded a new version of the patch. Could you try again?

@voltagex

Looks good!

voltagex@osiris:~/src$ patch -p1 < sd_wlan_2.6.35.diff
patching file SD_WLAN/SD-WLAN-BT-8688-LINUX2625-SAAR-10.49.3.p70-26609.P64_B1/wlan_src/Makefile
patching file SD_WLAN/SD-WLAN-BT-8688-LINUX2625-SAAR-10.49.3.p70-26609.P64_B1/wlan_src/wlan/wlan_drv.h
patching file SD_WLAN/SD-WLAN-BT-8688-LINUX2625-SAAR-10.49.3.p70-26609.P64_B1/wlan_src/wlan/wlan_linux.h
patching file SD_WLAN/SD-WLAN-BT-8688-LINUX2625-SAAR-10.49.3.p70-26609.P64_B1/wlan_src/wlan/wlan_main.c
patching file SD_WLAN/SD-WLAN-BT-8688-LINUX2625-SAAR-10.49.3.p70-26609.P64_B1/wlan_src/wlan/wlan_proc.c

voltagex@osiris:~/src/SD_WLAN/SD-WLAN-BT-8688-LINUX2625-SAAR-10.49.3.p70-26609.P64_B1/wlan_src$ /sbin/modinfo sd8xxx.ko && /sbin/modinfo mcypt.ko
filename: sd8xxx.ko
license: GPL
version: 26609.p64
author: Marvell International Ltd.
description: M-WLAN Driver
srcversion: D79BE81C86CCA1E11D463BA
depends: mcypt
vermagic: 2.6.39.3 preempt mod_unload ARMv5
parm: helper_name:Helper name (charp)
parm: fw_name:Firmware name (charp)
parm: mfgmode:0: Download normal firmware; 1: Download MFG firmware (int)
filename: mcypt.ko
license: Marvell Proprietary
version: mcrypt_v001
srcversion: E394968F45642D312B87BF6
depends:

vermagic: 2.6.39.3 preempt mod_unload ARMv5

@voltagex

Looks like my firmware is incorrect now, thanks anyway >.<

@fleger
Owner

You can get the right firmware from:
http://farcaster.zapto.org/alarm/dreamplug/arm/sd8688-firmware-20110710-1-any.pkg.tar.xz
The relevant files are lib/firmware/mrvl/sd8688.bin and lib/firmware/mrvl/helper_sd.bin.
Good luck.

@voltagex
@fleger
Owner

Curious. It works fine here (MD5: 261f11b45e7a9395104bde26ef28fb0b).
Maybe a buggy version of xz?
Alternatively, you can get the firmware from the Debian or Ubuntu image here:
http://code.google.com/p/dreamplug/downloads/list

@voltagex
@fleger
Owner

Patch updated to work against linux 3.1. Note that it breaks compatibility with pre 2.6.35 kernels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.