VlanConfigImpl.c revision 4fd606d1f5abe38e1f42c38de1d2e895166bd0f4
1216N/A HII Config Access protocol implementation of VLAN configuration module. 1216N/ACopyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR> 1216N/AThis program and the accompanying materials 1216N/Aare licensed and made available under the terms and conditions 1216N/Aof the BSD License which accompanies this distribution. The full 1216N/Atext of the license may be found at<BR> 1216N/ATHE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 1216N/AWITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. This function allows a caller to extract the current configuration for one or more named elements from the target driver. @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL. @param[in] Request A null-terminated Unicode string in @param[out] Progress On return, points to a character in the Request string. Points to the string's null terminator if request was successful. Points to the most recent '&' before the first failing name/value pair (or the beginning of the string if the failure is in the first name/value pair) if the request was not @param[out] Results A null-terminated Unicode string in <ConfigAltResp> format which has all values filled in for the names in the Request string. String to be allocated by the called function. @retval EFI_SUCCESS The Results is filled with the requested values. @retval EFI_OUT_OF_RESOURCES Not enough memory to store the results. @retval EFI_INVALID_PARAMETER Request is illegal syntax, or unknown name. @retval EFI_NOT_FOUND Routing data doesn't match any storage in this // Retrieve the pointer to the UEFI HII Config Routing Protocol // Convert buffer data to <ConfigResp> by helper function BlockToConfig() // Request has no request element, construct full request string. // Allocate and fill a buffer large enough to hold the <ConfigHdr> template // followed by "&OFFSET=0&WIDTH=WWWWWWWWWWWWWWWW" followed by a Null-terminator // Free the allocated config request string. // Set Progress string to the original request string. This function processes the results of changes in configuration. @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL. @param[in] Configuration A null-terminated Unicode string in <ConfigResp> @param[out] Progress A pointer to a string filled in with the offset of the most recent '&' before the first failing name/value pair (or the beginning of the string if the failure is in the first name/value pair) or the terminating NULL if all was successful. @retval EFI_SUCCESS The Results is processed successfully. @retval EFI_INVALID_PARAMETER Configuration is NULL. @retval EFI_NOT_FOUND Routing data doesn't match any storage in this This function processes the results of changes in configuration. @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL. @param[in] Action Specifies the type of action taken by the browser. @param[in] QuestionId A unique value which is sent to the original exporting driver so that it can identify the type @param[in] Type The type of value for the question. @param[in] Value A pointer to the data being sent to the original @param[out] ActionRequest On return, points to the action requested by the @retval EFI_SUCCESS The callback successfully handled the action. @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the @retval EFI_DEVICE_ERROR The variable could not be saved. @retval EFI_UNSUPPORTED The specified Action is not supported by the // All other action return unsupported. // Connect the newly created VLAN device // There may be no child handle created for VLAN ID 0, connect the parent handle // Checkbox is selected, need remove this VLAN // No VLAN device now, connect the physical NIC handle. // Note: PrivateData->NumberOfVlan has been updated by VlanUpdateForm() // Update current VLAN list into Form. This function update VLAN list in the VLAN configuration Form. @param[in, out] PrivateData Points to VLAN configuration private data. // Find current VLAN configuration // Update VLAN configuration in PrivateData // Create Hii Extend Label OpCode as the start opcode // Create Hii Extend Label OpCode as the end opcode // Pad VlanId string up to 4 characters with space // Save VLAN id to private data This function publish the VLAN configuration Form for a network device. The HII Config Access protocol will be installed on a child handle of the network @param[in, out] PrivateData Points to VLAN configuration private data. @retval EFI_SUCCESS HII Form is installed for this network device. @retval EFI_OUT_OF_RESOURCES Not enough resource for HII Form installation. @retval Others Other errors as indicated. // Create child handle and install HII Config Access Protocol // Publish the HII package list // Update formset title help string. // Update form title help string. This function remove the VLAN configuration Form for a network device. The child handle for HII Config Access protocol will be destroyed. @param[in, out] PrivateData Points to VLAN configuration private data. // Uninstall HII package list // Uninstall HII Config Access Protocol