aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe
diff options
context:
space:
mode:
authorEmil Tantilov <emil.s.tantilov@intel.com>2011-04-01 04:17:19 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2011-04-27 05:10:12 -0400
commit0665b09f81760c38a882bed65d495a4bd31a5767 (patch)
treecdb1d08899811c60725347d6b9d60539d9b686c2 /drivers/net/ixgbe
parent83dfde405322320d538b7087ba741fc9a4780161 (diff)
ixgbe: add support for 64k EEPROM for 82599
82599 supports up to 32k EEPROM addressing via EERD register. If we wish to address larger EEPROM this have to be done via serial interface. This patch adds function ixgbe_read_eeprom_82599 which selects the best method to read the EEPROM. Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com> Tested-by: Evan Swanson <evan.swanson@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ixgbe')
-rw-r--r--drivers/net/ixgbe/ixgbe_82599.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/drivers/net/ixgbe/ixgbe_82599.c b/drivers/net/ixgbe/ixgbe_82599.c
index b341ed8ef84f..d521baf1acd3 100644
--- a/drivers/net/ixgbe/ixgbe_82599.c
+++ b/drivers/net/ixgbe/ixgbe_82599.c
@@ -2064,6 +2064,35 @@ out:
2064 return lesm_enabled; 2064 return lesm_enabled;
2065} 2065}
2066 2066
2067/**
2068 * ixgbe_read_eeprom_82599 - Read EEPROM word using
2069 * fastest available method
2070 *
2071 * @hw: pointer to hardware structure
2072 * @offset: offset of word in the EEPROM to read
2073 * @data: word read from the EEPROM
2074 *
2075 * Reads a 16 bit word from the EEPROM
2076 **/
2077static s32 ixgbe_read_eeprom_82599(struct ixgbe_hw *hw,
2078 u16 offset, u16 *data)
2079{
2080 struct ixgbe_eeprom_info *eeprom = &hw->eeprom;
2081 s32 ret_val = IXGBE_ERR_CONFIG;
2082
2083 /*
2084 * If EEPROM is detected and can be addressed using 14 bits,
2085 * use EERD otherwise use bit bang
2086 */
2087 if ((eeprom->type == ixgbe_eeprom_spi) &&
2088 (offset <= IXGBE_EERD_MAX_ADDR))
2089 ret_val = ixgbe_read_eerd_generic(hw, offset, data);
2090 else
2091 ret_val = ixgbe_read_eeprom_bit_bang_generic(hw, offset, data);
2092
2093 return ret_val;
2094}
2095
2067static struct ixgbe_mac_operations mac_ops_82599 = { 2096static struct ixgbe_mac_operations mac_ops_82599 = {
2068 .init_hw = &ixgbe_init_hw_generic, 2097 .init_hw = &ixgbe_init_hw_generic,
2069 .reset_hw = &ixgbe_reset_hw_82599, 2098 .reset_hw = &ixgbe_reset_hw_82599,
@@ -2110,7 +2139,7 @@ static struct ixgbe_mac_operations mac_ops_82599 = {
2110 2139
2111static struct ixgbe_eeprom_operations eeprom_ops_82599 = { 2140static struct ixgbe_eeprom_operations eeprom_ops_82599 = {
2112 .init_params = &ixgbe_init_eeprom_params_generic, 2141 .init_params = &ixgbe_init_eeprom_params_generic,
2113 .read = &ixgbe_read_eerd_generic, 2142 .read = &ixgbe_read_eeprom_82599,
2114 .write = &ixgbe_write_eeprom_generic, 2143 .write = &ixgbe_write_eeprom_generic,
2115 .calc_checksum = &ixgbe_calc_eeprom_checksum_generic, 2144 .calc_checksum = &ixgbe_calc_eeprom_checksum_generic,
2116 .validate_checksum = &ixgbe_validate_eeprom_checksum_generic, 2145 .validate_checksum = &ixgbe_validate_eeprom_checksum_generic,