summaryrefslogtreecommitdiff
path: root/include/net/dsa.h
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2014-10-29 10:45:01 -0700
committerDavid S. Miller <davem@davemloft.net>2014-10-30 14:54:11 -0400
commit6793abb4e8491b1d673ccfd09e1a73d1ff8b9386 (patch)
treec6a2a1c1a626016fe80f212969cf6f62063c346d /include/net/dsa.h
parent87e5f66b3723b2d912b565bf7100e5121f302cbf (diff)
net: dsa: Add support for switch EEPROM access
On some chips it is possible to access the switch eeprom. Add infrastructure support for it. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/dsa.h')
-rw-r--r--include/net/dsa.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/net/dsa.h b/include/net/dsa.h
index 55e75e7e8d41..37856a28c8d3 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -38,6 +38,9 @@ struct dsa_chip_data {
struct device *host_dev;
int sw_addr;
+ /* set to size of eeprom if supported by the switch */
+ int eeprom_len;
+
/* Device tree node pointer for this specific switch chip
* used during switch setup in case additional properties
* and resources needs to be used
@@ -258,6 +261,13 @@ struct dsa_switch_driver {
int (*set_temp_limit)(struct dsa_switch *ds, int temp);
int (*get_temp_alarm)(struct dsa_switch *ds, bool *alarm);
#endif
+
+ /* EEPROM access */
+ int (*get_eeprom_len)(struct dsa_switch *ds);
+ int (*get_eeprom)(struct dsa_switch *ds,
+ struct ethtool_eeprom *eeprom, u8 *data);
+ int (*set_eeprom)(struct dsa_switch *ds,
+ struct ethtool_eeprom *eeprom, u8 *data);
};
void register_switch_driver(struct dsa_switch_driver *type);