diff options
author | hauke <hauke@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2013-02-14 12:36:52 +0000 |
---|---|---|
committer | hauke <hauke@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2013-02-14 12:36:52 +0000 |
commit | d8af1489e0e3cbeba49897e8f6dee1572295dd43 (patch) | |
tree | b5a9c9744bf5a5c89a9ed7acf3a208e7aa6eadc7 /package/switch/src/switch-core.c | |
parent | 03eaf681abe52e6ea4bf52670f0a69baceb30245 (diff) |
switch: export name of device found via /proc
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35596 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/switch/src/switch-core.c')
-rw-r--r-- | package/switch/src/switch-core.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/package/switch/src/switch-core.c b/package/switch/src/switch-core.c index ab0754c94a..fc8a6bf2c7 100644 --- a/package/switch/src/switch-core.c +++ b/package/switch/src/switch-core.c @@ -156,6 +156,12 @@ static int handle_driver_vlans(void *driver, char *buf, int nr) return sprintf(buf, "%i\n", vlans); } +static int handle_driver_dev_name(void *driver, char *buf, int nr) +{ + char *dev_name = ((switch_driver *) driver)->dev_name; + return sprintf(buf, "%s\n", dev_name); +} + static void add_handler(switch_driver *driver, const switch_config *handler, struct proc_dir_entry *parent, int nr) { switch_priv *priv = (switch_priv *) driver->data; @@ -242,6 +248,7 @@ switch_config global_driver_handlers[] = { {"cpuport", handle_driver_cpuport, NULL}, {"ports", handle_driver_ports, NULL}, {"vlans", handle_driver_vlans, NULL}, + {"dev_name", handle_driver_dev_name, NULL}, {NULL, NULL, NULL} }; |