diff options
author | Guenter Roeck <linux@roeck-us.net> | 2014-10-29 13:45:01 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-10-30 14:54:11 -0400 |
commit | 6793abb4e8491b1d673ccfd09e1a73d1ff8b9386 (patch) | |
tree | c6a2a1c1a626016fe80f212969cf6f62063c346d /include/net/dsa.h | |
parent | 87e5f66b3723b2d912b565bf7100e5121f302cbf (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.h | 10 |
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 { | |||
38 | struct device *host_dev; | 38 | struct device *host_dev; |
39 | int sw_addr; | 39 | int sw_addr; |
40 | 40 | ||
41 | /* set to size of eeprom if supported by the switch */ | ||
42 | int eeprom_len; | ||
43 | |||
41 | /* Device tree node pointer for this specific switch chip | 44 | /* Device tree node pointer for this specific switch chip |
42 | * used during switch setup in case additional properties | 45 | * used during switch setup in case additional properties |
43 | * and resources needs to be used | 46 | * and resources needs to be used |
@@ -258,6 +261,13 @@ struct dsa_switch_driver { | |||
258 | int (*set_temp_limit)(struct dsa_switch *ds, int temp); | 261 | int (*set_temp_limit)(struct dsa_switch *ds, int temp); |
259 | int (*get_temp_alarm)(struct dsa_switch *ds, bool *alarm); | 262 | int (*get_temp_alarm)(struct dsa_switch *ds, bool *alarm); |
260 | #endif | 263 | #endif |
264 | |||
265 | /* EEPROM access */ | ||
266 | int (*get_eeprom_len)(struct dsa_switch *ds); | ||
267 | int (*get_eeprom)(struct dsa_switch *ds, | ||
268 | struct ethtool_eeprom *eeprom, u8 *data); | ||
269 | int (*set_eeprom)(struct dsa_switch *ds, | ||
270 | struct ethtool_eeprom *eeprom, u8 *data); | ||
261 | }; | 271 | }; |
262 | 272 | ||
263 | void register_switch_driver(struct dsa_switch_driver *type); | 273 | void register_switch_driver(struct dsa_switch_driver *type); |