1000 return 0;
1001}
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012static s32 e1000_read_nvm_ich8lan(struct e1000_hw *hw, u16 offset, u16 words,
1013 u16 *data)
1014{
1015 struct e1000_nvm_info *nvm = &hw->nvm;
1016 struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan;
1017 u32 act_offset;
1018 s32 ret_val;
1019 u32 bank = 0;
1020 u16 i, word;
1021
1022 if ((offset >= nvm->word_size) || (words > nvm->word_size - offset) ||
1023 (words == 0)) {
1024 hw_dbg(hw, "nvm parameter(s) out of bounds\n");
1025 return -E1000_ERR_NVM;
1026 }
1027
1028 ret_val = e1000_acquire_swflag_ich8lan(hw);
1029 if (ret_val)
1030 return ret_val;
1031
1032 ret_val = e1000_valid_nvm_bank_detect_ich8lan(hw, &bank);
1033 if (ret_val)
1034 return ret_val;
1035
1036 act_offset = (bank) ? nvm->flash_bank_size : 0;
1037 act_offset += offset;
1038
1039 for (i = 0; i < words; i++) {
1040 if ((dev_spec->shadow_ram) &&