summaryrefslogtreecommitdiff
path: root/target/linux/brcm-2.4/patches/010-bcm47xx-cam_absent.patch
blob: 5023e181c4a5832a22b8a97145b8960420816eb4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
Index: linux-2.4.35.4/drivers/net/b44.h
===================================================================
--- linux-2.4.35.4.orig/drivers/net/b44.h	2007-12-15 05:20:16.028753670 +0100
+++ linux-2.4.35.4/drivers/net/b44.h	2007-12-15 05:20:16.480779429 +0100
@@ -122,6 +122,7 @@
 #define  RXCONFIG_FLOW		0x00000020 /* Flow Control Enable */
 #define  RXCONFIG_FLOW_ACCEPT	0x00000040 /* Accept Unicast Flow Control Frame */
 #define  RXCONFIG_RFILT		0x00000080 /* Reject Filter */
+#define  RXCONFIG_CAM_ABSENT	0x00000100 /* CAM Absent */
 #define B44_RXMAXLEN	0x0404UL /* EMAC RX Max Packet Length */
 #define B44_TXMAXLEN	0x0408UL /* EMAC TX Max Packet Length */
 #define B44_MDIO_CTRL	0x0410UL /* EMAC MDIO Control */
Index: linux-2.4.35.4/drivers/net/b44.c
===================================================================
--- linux-2.4.35.4.orig/drivers/net/b44.c	2007-12-15 05:20:16.020753214 +0100
+++ linux-2.4.35.4/drivers/net/b44.c	2007-12-15 05:20:16.480779429 +0100
@@ -1301,6 +1301,7 @@
 {
 	struct b44 *bp = dev->priv;
 	struct sockaddr *addr = p;
+ 	u32 val;
 
 	if (netif_running(dev))
 		return -EBUSY;
@@ -1308,7 +1309,11 @@
 	memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
 
 	spin_lock_irq(&bp->lock);
-	__b44_set_mac_addr(bp);
+   
+   	val = br32(B44_RXCONFIG);
+   	if (!(val & RXCONFIG_CAM_ABSENT))
+		__b44_set_mac_addr(bp);
+   
 	spin_unlock_irq(&bp->lock);
 
 	return 0;
@@ -1495,7 +1500,7 @@
 
 	val = br32(B44_RXCONFIG);
 	val &= ~(RXCONFIG_PROMISC | RXCONFIG_ALLMULTI);
-	if (dev->flags & IFF_PROMISC) {
+	if ((dev->flags & IFF_PROMISC) || (val & RXCONFIG_CAM_ABSENT)) {
 		val |= RXCONFIG_PROMISC;
 		bw32(B44_RXCONFIG, val);
 	} else {