swconfig: revert the portmapping patches, they seem to cause a segfault
[openwrt/staging/chunkeey.git] / target / linux / generic / files / include / linux / switch.h
index 42913645629a401724f2cba511b5e31f7185d714..dda4820a7a4bb85896b48162d2993b5b9a254cbb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * switch.h: Switch configuration API
  *
- * Copyright (C) 2008 Felix Fietkau <nbd@openwrt.org>
+ * Copyright (C) 2008 Felix Fietkau <nbd@nbd.name>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -95,8 +95,13 @@ struct switch_dev_ops {
 
        int (*get_port_link)(struct switch_dev *dev, int port,
                             struct switch_port_link *link);
+       int (*set_port_link)(struct switch_dev *dev, int port,
+                            struct switch_port_link *link);
        int (*get_port_stats)(struct switch_dev *dev, int port,
                              struct switch_port_stats *stats);
+
+       int (*phy_read16)(struct switch_dev *dev, int addr, u8 reg, u16 *value);
+       int (*phy_write16)(struct switch_dev *dev, int addr, u8 reg, u16 value);
 };
 
 struct switch_dev {
@@ -122,6 +127,7 @@ struct switch_dev {
        struct mutex sw_mutex;
        struct switch_port *portbuf;
        struct switch_portmap *portmap;
+       struct switch_port_link linkbuf;
 
        char buf[128];
 
@@ -148,6 +154,7 @@ struct switch_val {
                const char *s;
                u32 i;
                struct switch_port *ports;
+               struct switch_port_link *link;
        } value;
 };
 
@@ -166,4 +173,7 @@ struct switch_attr {
        int max;
 };
 
+int switch_generic_set_link(struct switch_dev *dev, int port,
+                           struct switch_port_link *link);
+
 #endif /* _LINUX_SWITCH_H */