aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm63xx/patches-4.1/525-board_96348w3.patch
blob: 1089eeda6dd68684794b3c6faf4584e7b7d59520 (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
--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
@@ -815,6 +815,25 @@ static struct board_info __initdata boar
 	.has_ohci0 = 1,
 };
 
+/* NetGear DG834G v4 */
+static struct board_info __initdata board_96348W3 = {
+ 	.name	 			= "96348W3",
+	.expected_cpu_id		= 0x6348,
+
+	.has_uart0	 		= 1,
+	.has_enet1			= 1,
+	.has_pci			= 1,
+
+	.enet1 = {
+		.has_phy		= 1,
+		.phy_id			= 0,
+		.force_speed_100	= 1,
+		.force_duplex_full	= 1,
+	},
+
+	.has_ohci0	 		= 1,
+};
+
 static struct board_info __initdata board_96348_D4PW = {
 	.name				= "D-4P-W",
 	.expected_cpu_id		= 0x6348,
@@ -1351,6 +1370,7 @@ static const struct board_info __initcon
 	&board_ct536_ct5621,
 	&board_96348A_122,
 	&board_CPVA502plus,
+	&board_96348W3,
 #endif
 
 #ifdef CONFIG_BCM63XX_CPU_6358
@@ -1406,6 +1426,7 @@ static struct of_device_id const bcm963x
 	{ .compatible = "davolink,dv-201amr", .data = &board_DV201AMR, },
 	{ .compatible = "dynalink,rta1025w", .data = &board_rta1025w_16, },
 	{ .compatible = "netgear,dg834gtpn", .data = &board_96348gw_10, },
+ 	{ .compatible = "netgear,dg834g-v4", .data = &board_96348W3, },
 	{ .compatible = "sagem,f@st2404", .data = &board_FAST2404, },
 	{ .compatible = "t-com,spw500v", .data = &board_spw500v, },
 	{ .compatible = "tecom,gw6000", .data = &board_gw6000, },
#0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
diff -urN sangam_atm-D7.03.01.00.orig/tn7dsl.c sangam_atm-D7.03.01.00/tn7dsl.c
--- sangam_atm-D7.03.01.00.orig/tn7dsl.c	2008-01-05 03:11:03.000000000 +0100
+++ sangam_atm-D7.03.01.00/tn7dsl.c	2008-01-06 18:13:24.000000000 +0000
@@ -109,6 +109,11 @@
 #include <linux/vmalloc.h>
 #include <linux/file.h>
 #include <linux/firmware.h>
+#include <linux/skbuff.h>
+#include <linux/netlink.h>
+#include <net/sock.h>
+#include <linux/kobject.h>
+#include <asm/uaccess.h>
 
 #include <asm/io.h>
 #include <asm/ar7/ar7.h>
@@ -296,6 +301,8 @@
 /* externs */
 extern struct atm_dev *mydev;
 extern unsigned int oamFarLBCount[4];
+extern struct sock *uevent_sock;
+extern u64 uevent_next_seqnum(void);
 
 /* module wide declars */
 static PITIDSLHW_T    pIhw;
@@ -333,6 +340,75 @@
 	return 0;
 }
 
+static inline void add_msg(struct sk_buff *skb, char *msg) 
+{ 
+	char *scratch; 
+	scratch = skb_put(skb, strlen(msg) + 1); 
+	sprintf(scratch, msg); 
+} 
+
+static void hotplug_dsl_status(void)
+{
+	struct sk_buff *skb;
+	size_t len;
+	char *scratch, *dsl_status;
+	char buf[128];
+	u64 seq;
+	
+	if (!uevent_sock) {
+        	printk("avsar: unable to create netlink socket!\n");
+        	return;
+	}    
+
+	switch (pIhw->AppData.bState)
+	{
+	case RSTATE_TEST:
+                dsl_status="TEST";
+		break;
+	case RSTATE_IDLE:
+		dsl_status="IDLE";
+                break;
+	case RSTATE_INIT:
+		dsl_status="INIT";
+                break;
+	case RSTATE_HS:
+		dsl_status="HANDSHAKE";
+                break;
+	case RSTATE_RTDL:
+		dsl_status="RETRAIN";
+                break;
+	case RSTATE_SHOWTIME:
+		dsl_status="SHOWTIME";
+                break;
+	default:
+		dsl_status="UNKNOWN";
+	}
+
+	/* allocate message with the maximum possible size */
+	len = strlen(dsl_status) +2;
+	skb = alloc_skb(len + 2048, GFP_KERNEL);
+	if (!skb)
+		return;
+	
+	/* add header */
+	scratch = skb_put(skb, len);
+	sprintf(scratch, "%s@",dsl_status);
+
+	/* copy keys to our continuous event payload buffer */
+	add_msg(skb, "HOME=/");
+	add_msg(skb, "PATH=/sbin:/bin:/usr/sbin:/usr/bin");
+	add_msg(skb, "SUBSYSTEM=atm");
+	add_msg(skb, "DEVICENAME=avsar0");
+	snprintf(buf, 128, "ACTION=%s", dsl_status); 
+	add_msg(skb, buf);
+	seq = uevent_next_seqnum();
+	snprintf(buf, 128, "SEQNUM=%llu", (unsigned long long)seq);
+	add_msg(skb, buf);
+	
+	NETLINK_CB(skb).dst_group = 1;
+	netlink_broadcast(uevent_sock, skb, 0, 1, GFP_KERNEL);
+}
+
 
 int os_atoi(const char *pStr)
 {
@@ -2558,7 +2634,7 @@
 
 inline int tn7dsl_handle_interrupt(void)
 {
-  int intsrc;
+  int intsrc,curState;
   unsigned char cMsgRa[6];
   short margin;
   extern unsigned int def_sar_inter_pace;   //Sorry
@@ -2573,7 +2649,7 @@
 
     if (nohost_flag) return 0;
 
-
+    curState=pIhw->AppData.bState;
     dslhal_api_handleTrainingInterrupt(pIhw, intsrc);
 
     if(pIhw->lConnected == TC_SYNC)
@@ -2704,8 +2780,8 @@
       }
 
 #endif
-
     }
+    if(pIhw->AppData.bState != curState) hotplug_dsl_status();
 
     //UR8_MERGE_START CQ10442 Manjula K
     if (pIhw->AppData.SRA)