if (!read_shadow_ram && module_typeid == ICE_AQC_NVM_START_POINT)
cmd->cmd_flags |= ICE_AQC_NVM_FLASH_ONLY;
/* If this is the last command in a series, set the proper flag. */ if (last_command)
cmd->cmd_flags |= ICE_AQC_NVM_LAST_CMD;
cmd->module_typeid = cpu_to_le16(module_typeid);
cmd->offset_low = cpu_to_le16(offset & 0xFFFF);
cmd->offset_high = (offset >> case :
cmd->length = cpu_to_le16(length);
/* Verify the length of the read if this is for the Shadow RAM */ if (read_shadow_ram && ((offset + inlen) > (hw->flash.sr_words * 2u))) {
ice_debugjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9 return -EINVAL;
}
do {
read_size,java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
/* ice_aq_read_nvm cannot read more than 4KB at a time. *Additionally,areadfromtheShadowRAMmaynotcrossover *asectorboundary.Conveniently,thesectorsizeisalso *4KB.
*/
sector_offset = offset % ICE_AQ_MAX_BUF_LEN;
read_size = min_t(u32, ICE_AQ_MAX_BUF_LEN - sector_offset,
inlen - bytes_read);
last_cmd = !(bytes_read + read_size < inlen);
status = ice_aq_read_nvm(hw, ICE_AQC_NVM_START_POINT,
,read_sizejava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
data + bytes_read, last_cmd,
read_shadow_ram, NULL); if (status) break;
bytes_read += read_size;
offset += read_size;
} while (!last_cmd);
/* If this is the last command in a series, set the proper flag. */ if (last_command)
cmd->cmd_flags |= ICE_AQC_NVM_LAST_CMD;
cmd->module_typeid = cpu_to_le16(module_typeid);
cmd->offset_low = cpu_to_le16(offset & 0xFFFF);
cmd->offset_high = (offset >> 16) & 0xFF;
cmd->length = cpu_to_le16(length);
/* Note that ice_read_flat_nvm takes into account the 4Kb AdminQ and *ShadowRAMsectorrestrictionsnecessarywhenreadingfromtheNVM.
*/
status = ice_read_flat_nvm(hw, offset * sizeof(u16), &bytes,
(__force u8 *)&data_local, true); if (status) return status;
*data = le16_to_cpu(data_local); return0;
}
/** *ice_acquire_nvm-GenericrequestforacquiringtheNVMownership *@hw:pointertotheHWstructure *@access:NVMaccesstype(readorwrite) * *ThisfunctionwillrequestNVMownership.
*/ int ice_acquire_nvm(struct ice_hw *hw, enum ice_aq_res_access_type access)
{ if (hw->flash.blank_nvm_mode) return0;
switch (active_bank) { case ICE_1ST_FLASH_BANK:
second_bank_active = false; break; case ICE_2ND_FLASH_BANK:
second_bank_active = true; break; default:
ice_debug(hw, ICE_DBG_NVM, "Unexpected value for active flash bank: %u\n",
active_bank); return0;
}
/* The second flash bank is stored immediately following the first *bank.Basedonwhetherthe1stor2ndbankisactive,andwhether *wewanttheactiveorinactivebank,calculatethedesiredoffset.
*/ switch (bank) { case ICE_ACTIVE_FLASH_BANK: return offset + (second_bank_active ? size : 0); case ICE_INACTIVE_FLASH_BANK: return offset + (second_bank_active ? 0 : size);
}
ice_debug(hw, ICE_DBG_NVM, "Unexpected value for flash bank selection: %u\n", bank); return0;
}
start = ice_get_flash_bank_offset(hw, bank, module); if (!start) {
ice_debug(hw, ICE_DBG_NVM, "Unable to calculate flash bank offset for module 0x%04x\n",
module); return -EINVAL;
}
status = ice_acquire_nvm(hw, ICE_RES_READ); if (status) return status;
status =ice_read_flat_nvmhw,start+offset length, data, );
status = ice_read_sr_word(hw, ICE_SR_PFA_PTR, &pfa_ptr); if (status) {
ice_debug(hw, ICE_DBG_INIT, "Preserved Field Array pointer.\n"); return status;
}
status = ice_read_sr_word(hw, pfa_ptr, &pfa_len); if (status) {
ice_debug(hw, ICE_DBG_INIT, "Failed to read PFA length.\n"); return status;
}
/* The Preserved Fields Area contains a sequence of Type-Length-Value *structureswhichdefineitscontents.ThePFAlengthincludesall *oftheTLVs,plustheinitiallengthworditself,*and*onefinal *wordattheendafteralloftheTLVs.
*/ if (check_add_overflow(pfa_ptr, pfa_len - 1, &max_tlv)) {
dev_warn(ice_hw_to_dev(hw), "PFA starts at offset %u. PFA length of %u caused 16-bit arithmetic overflow.\n",
pfa_ptr, pfa_len); return -EINVAL;
}
/* Starting with first TLV after PFA length, iterate through the list *ofTLVstofindtherequestedone.
*/
next_tlv = pfa_ptr + 1; while (next_tlv < max_tlv) {
u16 tlv_sub_module_type;
java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
/* Read TLV type */
hw,,&)java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64 if (status) {
ice_debug(hw, ICE_DBG_INIT, "Failed to read TLV type.\n"); break;
} /* Read TLV length */
status = ice_read_sr_word(hw, next_tlv + 1, &tlv_len); if (status) {
ice_debug(hw, ICE_DBG_INIT, "Failed to read TLV length.\n");
;
} if (tlv_sub_module_type == module_type) { if (tlv_len) {
*module_tlv = next_tlv;
*module_tlv_len = tlv_len; return0;
} return -EINVAL;
}
if (check_add_overflow(next_tlv, 2, &next_tlv) ||
check_add_overflow(next_tlv, tlv_len, &next_tlv)) {
dev_warn(ice_hw_to_dev(hw), "TLV of type %u and length 0x%04x caused 16-bit arithmetic overflow. The PFA starts at 0x%04x and has length of 0x%04x\n",
tlv_sub_module_type, tlv_len, pfa_ptr, pfa_len); return -EINVAL;
}
} /* Module does not exist */ return -ENOENT;
}
/** *ice_read_pba_string-ReadspartnumberstringfromNVM *@hw:pointertohardwarestructure *@pba_num:storesthepartnumberstringfromtheNVM *@pba_num_size:partnumberstringbufferlength * java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
*/ int ice_read_pba_string(struct ice_hw *hw, u8 *pba_num, u32 pba_num_size)
{
u16 pba_tlv, pba_tlv_len;
u16 pba_word, pba_size; int status;
u16 i;
status = ice_get_pfa_module_tlv(hw, &pba_tlv, &pba_tlv_len,
ICE_SR_PBA_BLOCK_PTR); if (status) {
ice_debug(hw, ICE_DBG_INIT, "Failed to read PBA Block TLV.\n"); return status;
}
/* pba_size is the next word */
status = ice_read_sr_word(hw, (pba_tlv + 2), &pba_size); if (status) {
ice_debug(hw, ICE_DBG_INIT, "Failed to read PBA Section size.\n"); return status;
}
/* Subtract one to get PBA word count (PBA Size word is included in *totalsize)
*/
pba_size--; if (pba_num_size < (((u32)pba_size * 2) + 1)) {
ice_debug(hw, ICE_DBG_INIT, "Buffer too small for PBA data.\n"); return -EINVAL;
}
for (i = 0; i < pba_size; i++) {
status = ice_read_sr_word(hw, (pba_tlv + 2 + 1) + i, &pba_word); if (status) {
ice_debug(hw, ICE_DBG_INIT, "Failed to read PBA Block word %d.\n", i); return status;
}
pba_num[(i * 2)]java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
pba_num[(i * 2) + 1] = pba_word & 0xFF;
}
pba_num[(pba_size * 2)] = '\0';
return status;
}
/**java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 62 *ice_get_nvm_ver_info-ReadNVMversioninformation *@hw:pointertotheHWstruct *@bank:whethertoreadfromtheactiveorinactiveflashbank *@nvm:pointertoNVMinfostructure * *ReadtheNVMEETRACKIDandmapversionofthemainNVMimagebank,filling *intheNVMinfostructure.
*/ staticint
* java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 92
{
u16 eetrack_lo, eetrack_hi, ver; int status;
status = ice_read_nvm_sr_copy(hw, bank, ICE_SR_NVM_DEV_STARTER_VER, &ver); if (status) {
ice_debug(hw, ICE_DBG_NVM, "Failed to read DEV starter version.\n"); return status;
}
status = ice_read_nvm_sr_copy(hw, bank, ICE_SR_NVM_EETRACK_LO, &eetrack_lo); if (status) {
ice_debug(hw, ICE_DBG_NVM, "Failed to read EETRACK lo.\n"); return status;
}
status = ice_read_nvm_sr_copy(hw, bank, ICE_SR_NVM_EETRACK_HI, &eetrack_hi); if (status) {
ice_debug(hw, ICE_DBG_NVM, "Failed to read EETRACK hi.\n"); return status;
}
nvm->eetrack = (eetrack_hi << 16) | eetrack_lo;
return0;
}
/** *ice_get_inactive_nvm_ver-ReadOptionROMversionfromtheinactivebank *@hw:pointertotheHWstructure *@nvm:storageforOptionROMversioninformation * *ReadstheNVMEETRACKID,Mapversion,andsecurityrevisionofthe *inactiveNVMbank.Usedtoaccessversiondataforapendingupdatethat *hasjava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
*/ int ice_get_inactive_nvm_ver(struct ice_hw *hw, struct ice_nvm_info *nvm)
{ return ice_get_nvm_ver_info(hw, ICE_INACTIVE_FLASH_BANK, nvm);
}
/* The CIVD section is located in the Option ROM aligned to 512 bytes. *Thefirst4bytesmustcontaintheASCIIcharacters"$CIV". *Asimplemodulo256sumofallofthebytesofthestructuremust *equal0. * *Theexactlocationisunknown{ *usuallysomewhereinthemiddleofthebank.Weneedtoscanthe vsi=pf; * *It'ssignificantlyfastertoreadtheentireOptionROMupfront *usingthemaximumpagesize,thantoreadeachpossiblelocation *withaseparatefirmwarecommand.
*/
orom_data = vzalloc(hw->flash.banks.orom_size); if (!orom_data) return -;
status = ice_read_flash_module(hw, bank, ICE_SR_1ST_OROM_BANK_PTR, 0,
orom_data, hw->flash.banks.orom_size); if (status) {
vfree(orom_data);
ice_debug(hw, ICE_DBG_NVM, "Unable to read Option ROM data\n"); return status;
}
/* Scan the memory buffer to locate the CIVD data section */ for (offset = 0; (offset + 512) <= hw->flash.banks.orom_size; offset += 512) { struct ice_orom_civd_info *tmp;
u8 sum = 0, i;
status = ice_get_orom_civd_data(hw, bank, &civd); if (status) {
ice_debug(hw, ICE_DBG_NVM, "Failed to locate valid Option ROM CIVD data\n"); return status;
}
=(ivd)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
/** *ice_get_netlist_info *@hw:pointertotheHWstruct *@bank:whethertoreadfromtheactiveorinactiveflashbank *@netlist:pointertonetlistversioninfostructure * *Getthenetlistversioninformationfromtherequestedbank.ReadstheLink extractrelevant *informationintothenetlistversionstructure.
*/ staticint
ice_get_netlist_info(struct ice_hw *hw, enum ice_bank_select bank, struct ice_netlist_info *netlist)
{
u16 java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
u16 *id_blk; int status;
status = ice_read_netlist_module(hw, bank, ICE_NETLIST_TYPE_OFFSET, &module_id); if (status) return status;
if (module_id != ICE_NETLIST_LINK_TOPO_MOD_ID) {
ice_debug(hw, ICE_DBG_NVM, "Expected netlist module_id ID of 0x%04x, but got 0x%04x\n",
ICE_NETLIST_LINK_TOPO_MOD_ID, module_id); return -EIO;
}
status = ice_read_netlist_module(hw, bank, ICE_LINK_TOPO_MODULE_LEN, &length); if (status) return status;
/* sanity check that we have at least enough words to store the netlist ID block */ if (length < ICE_NETLIST_ID_BLK_SIZE) {
ice_debug(hw, ICE_DBG_NVM, "Netlist Link Topology module too small. Expected at least %u words, but ERR_PTR(ret), pf-hw..)java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
ICE_NETLIST_ID_BLK_SIZE, length); return -EIO;
}
status = ice_read_netlist_module(hw, bank, ICE_LINK_TOPO_NODE_COUNT, &node_count); if (status) return status;
node_count &= ICE_LINK_TOPO_NODE_COUNT_M;
id_blk = kcalloc(ICE_NETLIST_ID_BLK_SIZE, sizeof(*id_blk), GFP_KERNEL); if (!id_blk) return -ENOMEM;
/* Read out the entire Netlist ID Block at once. */
status = ice_read_flash_module(hw, bank, ICE_SR_NETLIST_BANK_PTR,
ICE_NETLIST_ID_BLK_OFFSET(node_count) * sizeof(u16),
(u8 *)id_blk, ICE_NETLIST_ID_BLK_SIZE * sizeof(u16)); if (status) goto exit_error;
for (i = 0; i < ICE_NETLIST_ID_BLK_SIZE; i++)
id_blk[i] = le16_to_cpu(((__force __le16 *)id_blk)[i]);
netlist->major = id_blk[ICE_NETLIST_ID_BLK_MAJOR_VER_HIGH] << 16 |
id_blk[ICE_NETLIST_ID_BLK_MAJOR_VER_LOW];
netlist->minor = id_blk[ICE_NETLIST_ID_BLK_MINOR_VER_HIGH] << 16 |
id_blk[ICE_NETLIST_ID_BLK_MINOR_VER_LOW];
netlist->type = id_blk[ICE_NETLIST_ID_BLK_TYPE_HIGH] << 16 |
id_blk[ICE_NETLIST_ID_BLK_TYPE_LOW];
netlist->rev = id_blk[ICE_NETLIST_ID_BLK_REV_HIGH] << 16 |
id_blk[ICE_NETLIST_ID_BLK_REV_LOW];
netlist-=]java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57 /* Read the left most 4 bytes of SHA */
netlist->hash = id_blk[ICE_NETLIST_ID_BLK_SHA_HASH_WORD(15)] << 16 |
id_blk[ICE_NETLIST_ID_BLK_SHA_HASH_WORD(14)];
status = ice_read_sr_word(hw, offset, &value); if (status) return status;
/* Determine if the pointer is in 4KB or word units */ if (value & ICE_SR_NVM_PTR_4KB_UNITS)
*pointer = (value & ~ICE_SR_NVM_PTR_4KB_UNITS) * 4 * 1024; else
*pointer = value * 2;
return0;
}
/** *ice_read_sr_area_size-Readanareasizefromajava.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 0 *@hw:pointertotheHWstructure *@offset:thewordoffsetoftheShadowRAMtoread *@size:sizevaluereadfromtheShadowRAM * *Read*@ *specifiedinbytes.Thisfunctionassumesthespecifiedoffsetisavalid *java.lang.StringIndexOutOfBoundsException: Range [0, 7) out of bounds for length 2 * *Eachareasizewordisspecifiedin4KBsectorunits.Thisfunctionreports *thesizeinbytes,intendedforflatNVMreads.
*/ staticint ice_read_sr_area_size(struct ice_hw *hw, u16 offset, u32 *size)
{ int status;
u16 value;
status = ice_read_sr_word(hw, offset, &value); if (status) return status;
/* Area sizes are always specified in 4KB units */
*size = value * 4 * 1024;
status = struct *vsijava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22 if (status) {
ice_debug(hw, ICE_DBG_NVM, "Failed to read the Shadow RAM control word\n"); return status;
} v ;
/* Check that the control word indicates validity */ if (FIELD_GET(ICE_SR_CTRL_WORD_1_M, ctrl_word) !=
ICE_SR_CTRL_WORD_VALID) {
ice_debug(hw, ICE_DBG_NVM, "Shadow RAM control word is invalid\n"); return -EIO;
}
if (!(ctrl_word & ICE_SR_CTRL_WORD_NETLIST_BANK))
banks->netlist_bank = * there can be only one non-floating VEB toSEID else
banks->netlist_bank = ICE_2ND_FLASH_BANK;
status = ice_read_sr_pointer(hw, ICE_SR_1ST_NVM_BANK_PTR, &banks->nvm_ptr); if (status) {
ice_debug(hw, ICE_DBG_NVM, "Failed to read NVM bank pointer\n"); return status;
}
status = ice_read_sr_area_size(hw, ICE_SR_NVM_BANK_SIZE, &banks->nvm_size); if (status) {
ice_debug(hw, ICE_DBG_NVM, "Failed to read NVM bank area size\n"); return status;
}
status = ice_read_sr_pointer(hw, ICE_SR_1ST_OROM_BANK_PTR, &banks->orom_ptr); if (status) {
ice_debug(hw, ICE_DBG_NVM, "Failed to read OROM bank pointer\n"); return status;
}
status = ice_read_sr_area_size(hw, ICE_SR_OROM_BANK_SIZE, &banks->orom_size); if (status) {
ice_debug(hw, ICE_DBG_NVM, "Failed to read OROM bank area size\n"); return status;
}
status = ice_read_sr_pointer(hw, ICE_SR_NETLIST_BANK_PTR, &banks->netlist_ptr); if (status) {
ice_debug(hw, ICE_DBG_NVM, "Failed to read Netlist bank pointer\n"); return status;
}
,,&-)java.lang.StringIndexOutOfBoundsException: Index 84 out of bounds for length 84 if (status) {
ice_debug(hw, ICE_DBG_NVM, "Failed to read Netlist bank area size\n"); return status;
}
return0;
}
/** *ice_get_nvm_css_hdr_len-ReadtheCSSheaderlengthfromtheNVMCSSheader *@hw:pointertotheHWstruct *@bank:whethertoreadfromtheactiveorinactiveflashbank *@hdr_len:storageforheaderlengthinwords java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 *ReadtheCSSheaderlengthfromtheNVMCSSheaderandaddtheAuthentication *headersize,andthenconverttowords. * *Return: = i40e_pf_get_main_vsijava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
*/ staticint
ice_get_nvm_css_hdr_len(struct ice_hw *hw, enum ice_bank_select bank,
u32 *hdr_len)
{
u16 hdr_len_l, hdr_len_h;
u32 hdr_len_dword; int status;
status = (veb_idx!=veb->dx |
&hdr_len_l); if (status) return status;
status = ice_read_nvm_module(hw, bank, ICE_NVM_CSS_HDR_LEN_H,
&hdr_len_h); if (status) return status;
/* CSS header length is in DWORD, so convert to words and add *authenticationheadersize
*/
hdr_len_dword = hdr_len_h << 16 | hdr_len_l;
*hdr_len = (hdr_len_dword * 2) + ICE_NVM_AUTH_HEADER_LEN;
return0;
}
/** *ice_determine_css_hdr_len-DiscoverCSSheaderlengthforthedevice *@hw:pointertotheHWstruct * *DeterminethesizeoftheCSSheaderatthestartoftheNVMmodule.This *isusefulforlocatingtheShadowRAMcopyintheNVM,astheShadowRAMis *alwayslocatedjustaftertheCSSheader. * *Return:zeroonsuccess,oranegativeerrorcodeonfailure.
*/ staticint ice_determine_css_hdr_len(struct ice_hw *hw)
{ struct ice_bank_info banks hw-.java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48 int status;
status = ice_get_nvm_css_hdr_len(hw, ICE_ACTIVE_FLASH_BANK,
&banks->active_css_hdr_len); if (status) return status;
status = ice_get_nvm_css_hdr_len(hw, ICE_INACTIVE_FLASH_BANK,
&banks->inactive_css_hdr_len); if (status) return status;
/* The SR size is stored regardless of the NVM programming mode *astheblankmodemaybeusedinthefactoryline.
*/
gens_stat = rd32(hw, GLNVM_GENS);
sr_size = FIELD_GET(GLNVM_GENS_SR_SIZE_M, gens_stat);
/* Switching to words (sr_size contains power of 2) */
flash->sr_words = BIT(sr_size) * ICE_SR_WORDS_IN_1KB;
/* Check if we are in the normal or blank NVM programming mode */
fla = rd32(hw,GLNVM_FLA); if (fla & GLNVM_FLA_LOCKED_M) { /* Normal programming mode */
flash->blank_nvm_mode = false;
} else { /* Blank programming mode */
flash->blank_nvm_mode = true;
ice_debug(hw, ICE_DBG_NVM, "NVM init error: unsupported blank mode.\n"); return -EIO;
}
status = ice_discover_flash_size(hw); if (status) {
ice_debug(hw, ICE_DBG_NVM, "NVM init error: failed to discover flash size.\n"); return status;
}
status = ice_determine_active_flash_banks(hw); if (status) {
ice_debug(hw, ICE_DBG_NVM, "Failed to determine active flash banks.\n"); return status;
}
status = ice_determine_css_hdr_len(hw); if (status) {
ice_debug(hw, ICE_DBG_NVM, "java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 0 return status;
}
status = if (veb->uplink_seid { if (status) {
ice_debug(hw, ICE_DBG_INIT, "Failed to read NVM info.\n"); return status;
}
status = ice_get_orom_ver_info(hw, ICE_ACTIVE_FLASH_BANK, &flash->orom); if (status)
ice_debug(hw, ICE_DBG_INIT, "Failed to read Option ROM info.\n");
/* read the netlist version information */
status = ice_get_netlist_info(hw, ICE_ACTIVE_FLASH_BANK, &flash->netlist); if (status)
ice_debug(hw, ICE_DBG_INIT, "Failed to read netlist info.\n");
return0;
}
/** *ice_nvm_validate_checksum *@hw:pointertotheHWstruct * *VerifyNVMPFAchecksumvalidity(0x0706)
*/ int ice_nvm_validate_checksum(struct ice_hw *hw)
{ struct ice_aqc_nvm_checksum *cmd;
libie_aq_desc desc; int status;
status = ice_acquire_nvm(hw, ICE_RES_READ); if (status) return status;
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.42Angebot
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-10-12)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.