source:
freewrt/target/linux/generic-2.4/patches/224-atm_hotplug.patch@
a3abab6
| Last change on this file since a3abab6 was 475ad56, checked in by , 20 years ago | |
|---|---|
|
|
| File size: 2.7 KB | |
-
include/linux/atmdev.h
diff -urN linux.old/include/linux/atmdev.h linux.dev/include/linux/atmdev.h
old new 408 408 struct atm_dev *atm_dev_register(const char *type,const struct atmdev_ops *ops, 409 409 int number,atm_dev_flags_t *flags); /* number == -1: pick first available */ 410 410 struct atm_dev *atm_dev_lookup(int number); 411 void atm_dev_set_link_status(struct atm_dev *dev, int status); 411 412 void atm_dev_deregister(struct atm_dev *dev); 412 413 void shutdown_atm_dev(struct atm_dev *dev); 413 414 void vcc_insert_socket(struct sock *sk); -
net/atm/resources.c
diff -urN linux.old/net/atm/resources.c linux.dev/net/atm/resources.c
old new 10 10 #include <linux/sonet.h> 11 11 #include <linux/kernel.h> /* for barrier */ 12 12 #include <linux/module.h> 13 #include <linux/kmod.h> 13 14 #include <linux/bitops.h> 14 15 #include <net/sock.h> /* for struct sock */ 15 16 #include <asm/segment.h> /* for get_fs_long and put_fs_long */ … … 70 71 return dev; 71 72 } 72 73 74 #ifdef CONFIG_HOTPLUG 75 static void atm_run_sbin_hotplug(struct atm_dev *dev, char *action) 76 { 77 char *argv[3], *envp[5], ifname[12 + IFNAMSIZ], atmname[255], action_str[32]; 78 int i; 79 80 sprintf(ifname, "INTERFACE=atm%d", dev->number); 81 sprintf(atmname, "ATMDRIVER=%s", dev->type); 82 sprintf(action_str, "ACTION=%s", action); 83 84 i = 0; 85 argv[i++] = hotplug_path; 86 argv[i++] = "net"; 87 argv[i] = 0; 88 89 i = 0; 90 /* minimal command environment */ 91 envp [i++] = "HOME=/"; 92 envp [i++] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin"; 93 envp [i++] = ifname; 94 envp [i++] = atmname; 95 envp [i++] = action_str; 96 envp [i] = 0; 97 98 return call_usermodehelper(argv [0], argv, envp); 99 } 100 #endif 101 102 void atm_dev_set_link_status(struct atm_dev *dev, int status) 103 { 104 #ifdef CONFIG_HOTPLUG 105 if (status) 106 atm_run_sbin_hotplug(dev, "up"); 107 else 108 atm_run_sbin_hotplug(dev, "down"); 109 #endif 110 } 111 73 112 struct atm_dev *atm_dev_register(const char *type, const struct atmdev_ops *ops, 74 113 int number, atm_dev_flags_t *flags) 75 114 { … … 123 162 } 124 163 } 125 164 #endif 126 165 #ifdef CONFIG_HOTPLUG 166 atm_run_sbin_hotplug(dev, "register"); 167 #endif 168 127 169 return dev; 128 170 } 129 171 … … 131 173 void atm_dev_deregister(struct atm_dev *dev) 132 174 { 133 175 unsigned long warning_time; 176 177 #ifdef CONFIG_HOTPLUG 178 atm_run_sbin_hotplug(dev, "unregister"); 179 #endif 134 180 135 181 #ifdef CONFIG_PROC_FS 136 182 if (dev->ops->proc_read) … … 399 445 } 400 446 401 447 448 EXPORT_SYMBOL(atm_dev_set_link_status); 402 449 EXPORT_SYMBOL(atm_dev_register); 403 450 EXPORT_SYMBOL(atm_dev_deregister); 404 451 EXPORT_SYMBOL(atm_dev_lookup);
Note:
See TracBrowser
for help on using the repository browser.
