swconfig: add a generic method for setting the port primary vlan id (used for transpa...
[openwrt/svn-archive/archive.git] / target / linux / generic-2.6 / files / include / linux / switch.h
index 9411e84bc2f08b8ec3ddbd9aeef05be76a623e20..75c7dcfa912cc3b52a939cc997cc442adb1d3c29 100644 (file)
@@ -104,7 +104,7 @@ void unregister_switch(struct switch_dev *dev);
 struct switch_attrlist {
        /* filled in by the driver */
        int n_attr;
-       struct switch_attr *attr;
+       const struct switch_attr *attr;
 };
 
 
@@ -129,6 +129,8 @@ struct switch_dev {
 
        int (*get_vlan_ports)(struct switch_dev *dev, struct switch_val *val);
        int (*set_vlan_ports)(struct switch_dev *dev, struct switch_val *val);
+       int (*get_port_pvid)(struct switch_dev *dev, int port, int *val);
+       int (*set_port_pvid)(struct switch_dev *dev, int port, int val);
        int (*apply_config)(struct switch_dev *dev);
 };
 
@@ -138,7 +140,7 @@ struct switch_port {
 };
 
 struct switch_val {
-       struct switch_attr *attr;
+       const struct switch_attr *attr;
        int port_vlan;
        int len;
        union {
@@ -154,8 +156,8 @@ struct switch_attr {
        const char *name;
        const char *description;
 
-       int (*set)(struct switch_dev *dev, struct switch_attr *attr, struct switch_val *val);
-       int (*get)(struct switch_dev *dev, struct switch_attr *attr, struct switch_val *val);
+       int (*set)(struct switch_dev *dev, const struct switch_attr *attr, struct switch_val *val);
+       int (*get)(struct switch_dev *dev, const struct switch_attr *attr, struct switch_val *val);
 
        /* for driver internal use */
        int id;