generic: ar8216: group MIB counters and use two basic ones only by default
[openwrt/staging/wigyori.git] / target / linux / generic / files / drivers / net / phy / ar8216.h
index 8f77c916c0fbb4dc31f9da926a6ba04496527655..93170d5863c482b00ec3b7291713c4ec2f793f23 100644 (file)
@@ -389,6 +389,12 @@ enum {
        AR8216_PORT_STATE_FORWARD = 4
 };
 
+/* mib counter type */
+enum {
+       AR8XXX_MIB_BASIC = 0,
+       AR8XXX_MIB_EXTENDED = 1
+};
+
 enum {
        AR8XXX_VER_AR8216 = 0x01,
        AR8XXX_VER_AR8236 = 0x03,
@@ -415,6 +421,7 @@ struct ar8xxx_mib_desc {
        unsigned int size;
        unsigned int offset;
        const char *name;
+       u8 type;
 };
 
 struct ar8xxx_chip {
@@ -490,6 +497,7 @@ struct ar8xxx_priv {
        struct delayed_work mib_work;
        u64 *mib_stats;
        u32 mib_poll_interval;
+       u8 mib_type;
 
        struct list_head list;
        unsigned int use_count;
@@ -552,6 +560,14 @@ ar8xxx_sw_get_mib_poll_interval(struct switch_dev *dev,
                               const struct switch_attr *attr,
                               struct switch_val *val);
 int
+ar8xxx_sw_set_mib_type(struct switch_dev *dev,
+                              const struct switch_attr *attr,
+                              struct switch_val *val);
+int
+ar8xxx_sw_get_mib_type(struct switch_dev *dev,
+                              const struct switch_attr *attr,
+                              struct switch_val *val);
+int
 ar8xxx_sw_set_mirror_rx_enable(struct switch_dev *dev,
                               const struct switch_attr *attr,
                               struct switch_val *val);