1 Index: linux-2.4.35.4/include/linux/atmdev.h
2 ===================================================================
3 --- linux-2.4.35.4.orig/include/linux/atmdev.h
4 +++ linux-2.4.35.4/include/linux/atmdev.h
5 @@ -400,6 +400,7 @@ extern rwlock_t vcc_sklist_lock;
6 struct atm_dev *atm_dev_register(const char *type,const struct atmdev_ops *ops,
7 int number,atm_dev_flags_t *flags); /* number == -1: pick first available */
8 struct atm_dev *atm_dev_lookup(int number);
9 +void atm_dev_set_link_status(struct atm_dev *dev, int status);
10 void atm_dev_deregister(struct atm_dev *dev);
11 void shutdown_atm_dev(struct atm_dev *dev);
12 void vcc_insert_socket(struct sock *sk);
13 Index: linux-2.4.35.4/net/atm/resources.c
14 ===================================================================
15 --- linux-2.4.35.4.orig/net/atm/resources.c
16 +++ linux-2.4.35.4/net/atm/resources.c
18 #include <linux/sonet.h>
19 #include <linux/kernel.h> /* for barrier */
20 #include <linux/module.h>
21 +#include <linux/kmod.h>
22 #include <linux/bitops.h>
23 #include <net/sock.h> /* for struct sock */
24 #include <asm/segment.h> /* for get_fs_long and put_fs_long */
25 @@ -70,6 +71,44 @@ struct atm_dev *atm_dev_lookup(int numbe
29 +#ifdef CONFIG_HOTPLUG
30 +static void atm_run_sbin_hotplug(struct atm_dev *dev, char *action)
32 + char *argv[3], *envp[5], ifname[12 + IFNAMSIZ], atmname[255], action_str[32];
35 + sprintf(ifname, "INTERFACE=atm%d", dev->number);
36 + sprintf(atmname, "ATMDRIVER=%s", dev->type);
37 + sprintf(action_str, "ACTION=%s", action);
40 + argv[i++] = hotplug_path;
45 + /* minimal command environment */
46 + envp [i++] = "HOME=/";
47 + envp [i++] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin";
48 + envp [i++] = ifname;
49 + envp [i++] = atmname;
50 + envp [i++] = action_str;
53 + return call_usermodehelper(argv [0], argv, envp);
57 +void atm_dev_set_link_status(struct atm_dev *dev, int status)
59 +#ifdef CONFIG_HOTPLUG
61 + atm_run_sbin_hotplug(dev, "up");
63 + atm_run_sbin_hotplug(dev, "down");
67 struct atm_dev *atm_dev_register(const char *type, const struct atmdev_ops *ops,
68 int number, atm_dev_flags_t *flags)
70 @@ -123,7 +162,10 @@ struct atm_dev *atm_dev_register(const c
75 +#ifdef CONFIG_HOTPLUG
76 + atm_run_sbin_hotplug(dev, "register");
82 @@ -131,6 +173,10 @@ struct atm_dev *atm_dev_register(const c
83 void atm_dev_deregister(struct atm_dev *dev)
85 unsigned long warning_time;
87 +#ifdef CONFIG_HOTPLUG
88 + atm_run_sbin_hotplug(dev, "unregister");
92 if (dev->ops->proc_read)
93 @@ -399,6 +445,7 @@ done:
97 +EXPORT_SYMBOL(atm_dev_set_link_status);
98 EXPORT_SYMBOL(atm_dev_register);
99 EXPORT_SYMBOL(atm_dev_deregister);
100 EXPORT_SYMBOL(atm_dev_lookup);