1280 } while (count++ < ICH_FLASH_CYCLE_REPEAT_COUNT);
1281
1282 return ret_val;
1283}
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294static s32 e1000_write_nvm_ich8lan(struct e1000_hw *hw, u16 offset, u16 words,
1295 u16 *data)
1296{
1297 struct e1000_nvm_info *nvm = &hw->nvm;
1298 struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan;
1299 s32 ret_val;
1300 u16 i;
1301
1302 if ((offset >= nvm->word_size) || (words > nvm->word_size - offset) ||
1303 (words == 0)) {
1304 hw_dbg(hw, "nvm parameter(s) out of bounds\n");
1305 return -E1000_ERR_NVM;
1306 }
1307
1308 ret_val = e1000_acquire_swflag_ich8lan(hw);
1309 if (ret_val)
1310 return ret_val;
1311
1312 for (i = 0; i < words; i++) {
1313 dev_spec->shadow_ram[offset+i].modified = 1;
1314 dev_spec->shadow_ram[offset+i].value = data[i];
1315 }
1316
1317 e1000_release_swflag_ich8lan(hw);
1318
1319 return 0;
1320}