diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2013-02-14 12:36:52 +0000 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2013-02-14 12:36:52 +0000 |
commit | 243c5822134e452084069b0afc68c4ac78bfd795 (patch) | |
tree | f5674acf467a05f929dd2dcb4d6355feb7f9a60f /package/switch/src/switch-core.c | |
parent | 60913bbac6756bf45b0a22ba575c8b68a8e432d4 (diff) | |
download | mtk-20170518-243c5822134e452084069b0afc68c4ac78bfd795.zip mtk-20170518-243c5822134e452084069b0afc68c4ac78bfd795.tar.gz mtk-20170518-243c5822134e452084069b0afc68c4ac78bfd795.tar.bz2 |
switch: export name of device found via /proc
SVN-Revision: 35596
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 ab0754c..fc8a6bf 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} }; |