diff options
Diffstat (limited to 'drivers/net/e1000')
-rw-r--r-- | drivers/net/e1000/e1000_hw.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c index 9d6edf3e73f9..d04eef53571e 100644 --- a/drivers/net/e1000/e1000_hw.c +++ b/drivers/net/e1000/e1000_hw.c | |||
@@ -144,6 +144,8 @@ static s32 e1000_host_if_read_cookie(struct e1000_hw *hw, u8 *buffer); | |||
144 | static u8 e1000_calculate_mng_checksum(char *buffer, u32 length); | 144 | static u8 e1000_calculate_mng_checksum(char *buffer, u32 length); |
145 | static s32 e1000_configure_kmrn_for_10_100(struct e1000_hw *hw, u16 duplex); | 145 | static s32 e1000_configure_kmrn_for_10_100(struct e1000_hw *hw, u16 duplex); |
146 | static s32 e1000_configure_kmrn_for_1000(struct e1000_hw *hw); | 146 | static s32 e1000_configure_kmrn_for_1000(struct e1000_hw *hw); |
147 | static s32 e1000_do_read_eeprom(struct e1000_hw *hw, u16 offset, u16 words, u16 *data); | ||
148 | static s32 e1000_do_write_eeprom(struct e1000_hw *hw, u16 offset, u16 words, u16 *data); | ||
147 | 149 | ||
148 | /* IGP cable length table */ | 150 | /* IGP cable length table */ |
149 | static const | 151 | static const |
@@ -168,6 +170,8 @@ u16 e1000_igp_2_cable_length_table[IGP02E1000_AGC_LENGTH_TABLE_SIZE] = | |||
168 | 83, 89, 95, 100, 105, 109, 113, 116, 119, 122, 124, | 170 | 83, 89, 95, 100, 105, 109, 113, 116, 119, 122, 124, |
169 | 104, 109, 114, 118, 121, 124}; | 171 | 104, 109, 114, 118, 121, 124}; |
170 | 172 | ||
173 | static DEFINE_SPINLOCK(e1000_eeprom_lock); | ||
174 | |||
171 | /****************************************************************************** | 175 | /****************************************************************************** |
172 | * Set the phy type member in the hw struct. | 176 | * Set the phy type member in the hw struct. |
173 | * | 177 | * |
@@ -4904,6 +4908,15 @@ static s32 e1000_spi_eeprom_ready(struct e1000_hw *hw) | |||
4904 | *****************************************************************************/ | 4908 | *****************************************************************************/ |
4905 | s32 e1000_read_eeprom(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) | 4909 | s32 e1000_read_eeprom(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) |
4906 | { | 4910 | { |
4911 | s32 ret; | ||
4912 | spin_lock(&e1000_eeprom_lock); | ||
4913 | ret = e1000_do_read_eeprom(hw, offset, words, data); | ||
4914 | spin_unlock(&e1000_eeprom_lock); | ||
4915 | return ret; | ||
4916 | } | ||
4917 | |||
4918 | static s32 e1000_do_read_eeprom(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) | ||
4919 | { | ||
4907 | struct e1000_eeprom_info *eeprom = &hw->eeprom; | 4920 | struct e1000_eeprom_info *eeprom = &hw->eeprom; |
4908 | u32 i = 0; | 4921 | u32 i = 0; |
4909 | 4922 | ||
@@ -5236,6 +5249,16 @@ s32 e1000_update_eeprom_checksum(struct e1000_hw *hw) | |||
5236 | *****************************************************************************/ | 5249 | *****************************************************************************/ |
5237 | s32 e1000_write_eeprom(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) | 5250 | s32 e1000_write_eeprom(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) |
5238 | { | 5251 | { |
5252 | s32 ret; | ||
5253 | spin_lock(&e1000_eeprom_lock); | ||
5254 | ret = e1000_do_write_eeprom(hw, offset, words, data); | ||
5255 | spin_unlock(&e1000_eeprom_lock); | ||
5256 | return ret; | ||
5257 | } | ||
5258 | |||
5259 | |||
5260 | static s32 e1000_do_write_eeprom(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) | ||
5261 | { | ||
5239 | struct e1000_eeprom_info *eeprom = &hw->eeprom; | 5262 | struct e1000_eeprom_info *eeprom = &hw->eeprom; |
5240 | s32 status = 0; | 5263 | s32 status = 0; |
5241 | 5264 | ||