Skip to content

NetworkPkg/IScsiDxe: Fix AttemptName cleared on loading defaults#12439

Open
AbuthahirM11 wants to merge 1 commit intotianocore:masterfrom
AbuthahirM11:abu/iscsi-attempt-name-fix
Open

NetworkPkg/IScsiDxe: Fix AttemptName cleared on loading defaults#12439
AbuthahirM11 wants to merge 1 commit intotianocore:masterfrom
AbuthahirM11:abu/iscsi-attempt-name-fix

Conversation

@AbuthahirM11
Copy link
Copy Markdown

The AttemptName field in the iSCSI configuration form gets wiped out
when optimized defaults are loaded (F3), replacing names like
"Attempt 1", "Attempt 2" with blank strings.

Root Cause:
The AttemptName string field in IScsiConfigVfr.vfr had
default = STRING_TOKEN(STR_NULL), which resolves to an empty string.
When optimized defaults are loaded, the form browser resets every
field to its defined default, clearing all attempt names.

Fix:
Add the INTERACTIVE flag to the AttemptName string field in VFR so
the form browser invokes the driver callback when loading defaults.
In IScsiFormCallback, handle EFI_BROWSER_ACTION_DEFAULT_STANDARD for
KEY_ATTEMPT_NAME by reading the stored attempt name from
mCallbackInfo->Current->AttemptName and returning it as the default
value. This ensures loading defaults always restores the correct
attempt name.

Cc: Saloni Kasbekar saloni.kasbekar@intel.com
Cc: Zachary Clark-williams zachary.clark-williams@intel.com
Cc: Michael D Kinney michael.d.kinney@intel.com

Signed-off-by: Abuthahir M abuthahirm@ami.com

Root Cause:
The AttemptName string field in IScsiConfigVfr.vfr had
default = STRING_TOKEN(STR_NULL), which resolves to an empty
string. When optimized defaults are loaded (F3), the form browser
resets every field to its defined default, wiping out the actual
attempt names (e.g. Attempt 1, Attempt 2) and leaving the field
blank.

Fix:
Add the INTERACTIVE flag to the AttemptName string field in VFR.
This tells the form browser to invoke the driver callback when
loading defaults instead of applying the hardcoded empty string.
In IScsiFormCallback, handle EFI_BROWSER_ACTION_DEFAULT_STANDARD
for KEY_ATTEMPT_NAME by reading the actual stored attempt name
from mCallbackInfo->Current->AttemptName and returning it as the
default value. This ensures loading defaults always restores the
correct attempt name for whichever attempt is currently open.

Cc: Saloni Kasbekar <saloni.kasbekar@intel.com>
Cc: Zachary Clark-williams <zachary.clark-williams@intel.com>

Signed-off-by: Abuthahir M <abuthahirm@ami.com>
@AbuthahirM11 AbuthahirM11 force-pushed the abu/iscsi-attempt-name-fix branch from 069e21d to 5a26ce0 Compare April 10, 2026 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant