lantiq: Tune the XWAY subtarget cflags
[openwrt/staging/yousong.git] / package / switch / src / switch-core.c
index c77e4bba471e98286d876863e03bbb6181bc632e..fc8a6bf2c76df72863d5c9f3f32f90a495013413 100644 (file)
@@ -138,6 +138,30 @@ static int handle_driver_version(void *driver, char *buf, int nr)
        return sprintf(buf, "%s\n", version);
 }
 
+static int handle_driver_cpuport(void *driver, char *buf, int nr)
+{
+       int cpuport = ((switch_driver *) driver)->cpuport;
+       return sprintf(buf, "%i\n", cpuport);
+}
+
+static int handle_driver_ports(void *driver, char *buf, int nr)
+{
+       int ports = ((switch_driver *) driver)->ports;
+       return sprintf(buf, "%i\n", ports);
+}
+
+static int handle_driver_vlans(void *driver, char *buf, int nr)
+{
+       int vlans = ((switch_driver *) driver)->vlans;
+       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;
@@ -221,6 +245,10 @@ static void do_unregister(switch_driver *driver)
 switch_config global_driver_handlers[] = {
        {"driver", handle_driver_name, NULL},
        {"version", handle_driver_version, NULL},
+       {"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}
 };