1 diff -urN sangam_atm-D7.03.01.00.orig/tn7dsl.c sangam_atm-D7.03.01.00/tn7dsl.c
2 --- sangam_atm-D7.03.01.00.orig/tn7dsl.c 2008-01-05 03:11:03.000000000 +0100
3 +++ sangam_atm-D7.03.01.00/tn7dsl.c 2008-01-06 18:13:24.000000000 +0000
5 #include <linux/vmalloc.h>
6 #include <linux/file.h>
7 #include <linux/firmware.h>
8 +#include <linux/skbuff.h>
9 +#include <linux/netlink.h>
10 +#include <net/sock.h>
11 +#include <linux/kobject.h>
12 +#include <asm/uaccess.h>
15 #include <asm/ar7/ar7.h>
18 extern struct atm_dev *mydev;
19 extern unsigned int oamFarLBCount[4];
20 +extern struct sock *uevent_sock;
21 +extern u64 uevent_next_seqnum(void);
23 /* module wide declars */
24 static PITIDSLHW_T pIhw;
29 +static inline void add_msg(struct sk_buff *skb, char *msg)
32 + scratch = skb_put(skb, strlen(msg) + 1);
33 + sprintf(scratch, msg);
36 +static void hotplug_dsl_status(void)
38 + struct sk_buff *skb;
40 + char *scratch, *dsl_status;
45 + printk("avsar: unable to create netlink socket!\n");
49 + switch (pIhw->AppData.bState)
61 + dsl_status="HANDSHAKE";
64 + dsl_status="RETRAIN";
66 + case RSTATE_SHOWTIME:
67 + dsl_status="SHOWTIME";
70 + dsl_status="UNKNOWN";
73 + /* allocate message with the maximum possible size */
74 + len = strlen(dsl_status) +2;
75 + skb = alloc_skb(len + 2048, GFP_KERNEL);
80 + scratch = skb_put(skb, len);
81 + sprintf(scratch, "%s@",dsl_status);
83 + /* copy keys to our continuous event payload buffer */
84 + add_msg(skb, "HOME=/");
85 + add_msg(skb, "PATH=/sbin:/bin:/usr/sbin:/usr/bin");
86 + add_msg(skb, "SUBSYSTEM=atm");
87 + add_msg(skb, "DEVICENAME=avsar0");
88 + snprintf(buf, 128, "ACTION=%s", dsl_status);
90 + seq = uevent_next_seqnum();
91 + snprintf(buf, 128, "SEQNUM=%llu", (unsigned long long)seq);
94 + NETLINK_CB(skb).dst_group = 1;
95 + netlink_broadcast(uevent_sock, skb, 0, 1, GFP_KERNEL);
99 int os_atoi(const char *pStr)
101 @@ -2558,7 +2634,7 @@
103 inline int tn7dsl_handle_interrupt(void)
106 + int intsrc,curState;
107 unsigned char cMsgRa[6];
109 extern unsigned int def_sar_inter_pace; //Sorry
110 @@ -2573,7 +2649,7 @@
112 if (nohost_flag) return 0;
115 + curState=pIhw->AppData.bState;
116 dslhal_api_handleTrainingInterrupt(pIhw, intsrc);
118 if(pIhw->lConnected == TC_SYNC)
119 @@ -2704,8 +2780,8 @@
125 + if(pIhw->AppData.bState != curState) hotplug_dsl_status();
127 //UR8_MERGE_START CQ10442 Manjula K
128 if (pIhw->AppData.SRA)