diff options
author | ywu21 <ywu21@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-12-12 07:03:44 +0000 |
---|---|---|
committer | ywu21 <ywu21@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-12-12 07:03:44 +0000 |
commit | 963dbb30018c6420a9b27778e05e5eed74b23173 (patch) | |
tree | f8fc28301f368c56cac36b8b2d7bd48b53f02bcc /MdeModulePkg/Universal/Network/IScsiDxe/IScsiDhcp.c | |
parent | 96dcf1973f975ece358d8d70523a976ea218a962 (diff) | |
download | edk2-platforms-963dbb30018c6420a9b27778e05e5eed74b23173.tar.xz |
1)update function header coding style issue
change Some unexpected error happened. to Other errors as indicated.
2) delete unused parameter in IScsiConfigFormInit()
3) correct IN OUT mistake in IScsiSessionInit ()
4)roll back one update for Piece of code in IScsiDhcp.c around line 99 on FieldIndex
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7013 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/Network/IScsiDxe/IScsiDhcp.c')
-rw-r--r-- | MdeModulePkg/Universal/Network/IScsiDxe/IScsiDhcp.c | 37 |
1 files changed, 14 insertions, 23 deletions
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDhcp.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDhcp.c index f02423475e..85b5dbf745 100644 --- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDhcp.c +++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDhcp.c @@ -96,24 +96,18 @@ IScsiDhcpExtractRootPath ( goto ON_EXIT;
}
- for (FieldIndex = RP_FIELD_IDX_SERVERNAME; FieldIndex != RP_FIELD_IDX_TARGETNAME; FieldIndex = RP_FIELD_IDX_TARGETNAME) {
- if (Fields[FieldIndex].Str == NULL) {
- Status = EFI_INVALID_PARAMETER;
- goto ON_EXIT;
- }
- }
-
- FieldIndex = RP_FIELD_IDX_PROTOCOL;
- if (Fields[RP_FIELD_IDX_PROTOCOL].Len > 1) {
+ if ((Fields[RP_FIELD_IDX_SERVERNAME].Str == NULL) ||
+ (Fields[RP_FIELD_IDX_TARGETNAME].Str == NULL) ||
+ (Fields[RP_FIELD_IDX_PROTOCOL].Len > 1)
+ ) {
+
Status = EFI_INVALID_PARAMETER;
goto ON_EXIT;
}
-
//
// Get the IP address of the target.
//
- FieldIndex = RP_FIELD_IDX_SERVERNAME;
- Field = &Fields[FieldIndex];
+ Field = &Fields[RP_FIELD_IDX_SERVERNAME];
Status = IScsiAsciiStrToIp (Field->Str, &ConfigNvData->TargetIp);
if (EFI_ERROR (Status)) {
goto ON_EXIT;
@@ -121,8 +115,7 @@ IScsiDhcpExtractRootPath ( //
// Check the protocol type.
//
- FieldIndex = RP_FIELD_IDX_PROTOCOL;
- Field = &Fields[FieldIndex];
+ Field = &Fields[RP_FIELD_IDX_PROTOCOL];
if ((Field->Str != NULL) && ((*(Field->Str) - '0') != EFI_IP_PROTO_TCP)) {
Status = EFI_INVALID_PARAMETER;
goto ON_EXIT;
@@ -130,8 +123,7 @@ IScsiDhcpExtractRootPath ( //
// Get the port of the iSCSI target.
//
- FieldIndex = RP_FIELD_IDX_PORT;
- Field = &Fields[FieldIndex];
+ Field = &Fields[RP_FIELD_IDX_PORT];
if (Field->Str != NULL) {
ConfigNvData->TargetPort = (UINT16) AsciiStrDecimalToUintn (Field->Str);
} else {
@@ -140,8 +132,7 @@ IScsiDhcpExtractRootPath ( //
// Get the LUN.
//
- FieldIndex = RP_FIELD_IDX_LUN;
- Field = &Fields[FieldIndex];
+ Field = &Fields[RP_FIELD_IDX_LUN];
if (Field->Str != NULL) {
Status = IScsiAsciiStrToLun (Field->Str, ConfigNvData->BootLun);
if (EFI_ERROR (Status)) {
@@ -153,8 +144,8 @@ IScsiDhcpExtractRootPath ( //
// Get the target iSCSI Name.
//
- FieldIndex = RP_FIELD_IDX_TARGETNAME;
- Field = &Fields[FieldIndex];
+ Field = &Fields[RP_FIELD_IDX_TARGETNAME];
+
if (AsciiStrLen (Field->Str) > ISCSI_NAME_MAX_SIZE - 1) {
Status = EFI_INVALID_PARAMETER;
goto ON_EXIT;
@@ -190,7 +181,7 @@ ON_EXIT: @retval EFI_SUCCESS Either the DHCP OFFER is qualified or we're not intereseted
in the Dhcp4Event.
@retval EFI_NOT_READY The DHCP OFFER packet doesn't match our requirements.
- @retval Others Some unexpected error happened.
+ @retval Others Other errors as indicated.
**/
EFI_STATUS
IScsiDhcpSelectOffer (
@@ -261,7 +252,7 @@ IScsiDhcpSelectOffer ( @retval EFI_SUCCESS The DNS information is got from the DHCP ACK.
@retval EFI_NO_MAPPING DHCP failed to acquire address and other information.
@retval EFI_INVALID_PARAMETER The DHCP ACK's DNS option is mal-formatted.
- @retval EFI_DEVICE_ERROR Some unexpected error happened.
+ @retval EFI_DEVICE_ERROR Other errors as indicated.
**/
EFI_STATUS
IScsiParseDhcpAck (
@@ -352,7 +343,7 @@ IScsiParseDhcpAck ( @retval EFI_SUCCESS The DNS information is got from the DHCP ACK.
@retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
- @retval Others Some unexpected error happened.
+ @retval Others Other errors as indicated.
**/
EFI_STATUS
IScsiDoDhcp (
|