Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
lede-mikrotik
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Johannes Rudolph
lede-mikrotik
Commits
aef879ea
Commit
aef879ea
authored
15 years ago
by
Florian Fainelli
Browse files
Options
Downloads
Patches
Plain Diff
remove the ar7-atm hotplug for the moment since it makes the driver oops
SVN-Revision: 16125
parent
4d9d62ea
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
package/ar7-atm/patches/170-add-hotplug-status.patch
+0
-128
0 additions, 128 deletions
package/ar7-atm/patches/170-add-hotplug-status.patch
with
0 additions
and
128 deletions
package/ar7-atm/patches/170-add-hotplug-status.patch
deleted
100644 → 0
+
0
−
128
View file @
4d9d62ea
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)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment