TianoCore EDK2 master
|
#include <Uefi.h>
#include <Protocol/ComponentName.h>
#include <Protocol/ComponentName2.h>
#include <Protocol/HiiConfigAccess.h>
#include <Protocol/HiiConfigRouting.h>
#include <Protocol/VlanConfig.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiLib.h>
#include <Library/NetLib.h>
#include <Library/HiiLib.h>
#include <Library/DevicePathLib.h>
#include <Library/PrintLib.h>
#include <Guid/MdeModuleHii.h>
#include "VlanConfigNvData.h"
Go to the source code of this file.
Data Structures | |
struct | VLAN_CONFIG_PRIVATE_DATA |
Macros | |
#define | VLAN_LIST_VAR_OFFSET ((UINT16) OFFSET_OF (VLAN_CONFIGURATION, VlanList)) |
#define | VLAN_CONFIG_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('V', 'C', 'P', 'D') |
#define | VLAN_CONFIG_PRIVATE_DATA_FROM_THIS(a) CR (a, VLAN_CONFIG_PRIVATE_DATA, ConfigAccess, VLAN_CONFIG_PRIVATE_DATA_SIGNATURE) |
Variables | |
EFI_COMPONENT_NAME2_PROTOCOL | gVlanConfigComponentName2 |
EFI_COMPONENT_NAME_PROTOCOL | gVlanConfigComponentName |
UINT8 | VlanConfigBin [] |
UINT8 | VlanConfigDxeStrings [] |
VLAN_CONFIG_PRIVATE_DATA | mVlanConfigPrivateDateTemplate |
Header file for driver binding protocol and HII config access protocol.
Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file VlanConfigImpl.h.
#define VLAN_CONFIG_PRIVATE_DATA_FROM_THIS | ( | a | ) | CR (a, VLAN_CONFIG_PRIVATE_DATA, ConfigAccess, VLAN_CONFIG_PRIVATE_DATA_SIGNATURE) |
Definition at line 65 of file VlanConfigImpl.h.
#define VLAN_CONFIG_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('V', 'C', 'P', 'D') |
Definition at line 64 of file VlanConfigImpl.h.
#define VLAN_LIST_VAR_OFFSET ((UINT16) OFFSET_OF (VLAN_CONFIGURATION, VlanList)) |
Definition at line 44 of file VlanConfigImpl.h.
EFI_STATUS InstallVlanConfigForm | ( | IN OUT VLAN_CONFIG_PRIVATE_DATA * | PrivateData | ) |
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 device.
[in,out] | PrivateData | Points to VLAN configuration private data. |
EFI_SUCCESS | HII Form is installed for this network device. |
EFI_OUT_OF_RESOURCES | Not enough resource for HII Form installation. |
Others | Other errors as indicated. |
Definition at line 483 of file VlanConfigImpl.c.
EFI_STATUS UninstallVlanConfigForm | ( | IN OUT VLAN_CONFIG_PRIVATE_DATA * | PrivateData | ) |
This function remove the VLAN configuration Form for a network device. The child handle for HII Config Access protocol will be destroyed.
[in,out] | PrivateData | Points to VLAN configuration private data. |
EFI_SUCCESS | HII Form has been uninstalled successfully. |
Others | Other errors as indicated. |
Definition at line 602 of file VlanConfigImpl.c.
EFI_STATUS EFIAPI VlanCallback | ( | IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL * | This, |
IN EFI_BROWSER_ACTION | Action, | ||
IN EFI_QUESTION_ID | QuestionId, | ||
IN UINT8 | Type, | ||
IN EFI_IFR_TYPE_VALUE * | Value, | ||
OUT EFI_BROWSER_ACTION_REQUEST * | ActionRequest | ||
) |
This function processes the results of changes in configuration.
[in] | This | Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL. |
[in] | Action | Specifies the type of action taken by the browser. |
[in] | QuestionId | A unique value which is sent to the original exporting driver so that it can identify the type of data to expect. |
[in] | Type | The type of value for the question. |
[in] | Value | A pointer to the data being sent to the original exporting driver. |
[out] | ActionRequest | On return, points to the action requested by the callback function. |
EFI_SUCCESS | The callback successfully handled the action. |
EFI_OUT_OF_RESOURCES | Not enough storage is available to hold the variable and its data. |
EFI_DEVICE_ERROR | The variable could not be saved. |
EFI_UNSUPPORTED | The specified Action is not supported by the callback. |
Definition at line 215 of file VlanConfigImpl.c.
EFI_STATUS EFIAPI VlanConfigComponentNameGetControllerName | ( | IN EFI_COMPONENT_NAME_PROTOCOL * | This, |
IN EFI_HANDLE | ControllerHandle, | ||
IN EFI_HANDLE ChildHandle | OPTIONAL, | ||
IN CHAR8 * | Language, | ||
OUT CHAR16 ** | ControllerName | ||
) |
Retrieves a Unicode string that is the user readable name of the controller that is being managed by a driver.
This function retrieves the user readable name of the controller specified by ControllerHandle and ChildHandle in the form of a Unicode string. If the driver specified by This has a user readable name in the language specified by Language, then a pointer to the controller name is returned in ControllerName, and EFI_SUCCESS is returned. If the driver specified by This is not currently managing the controller specified by ControllerHandle and ChildHandle, then EFI_UNSUPPORTED is returned. If the driver specified by This does not support the language specified by Language, then EFI_UNSUPPORTED is returned.
This[in] | A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or EFI_COMPONENT_NAME_PROTOCOL instance. |
ControllerHandle[in] | The handle of a controller that the driver specified by This is managing. This handle specifies the controller whose name is to be returned. |
ChildHandle[in] | The handle of the child controller to retrieve the name of. This is an optional parameter that may be NULL. It will be NULL for device drivers. It will also be NULL for a bus drivers that wish to retrieve the name of the bus controller. It will not be NULL for a bus driver that wishes to retrieve the name of a child controller. |
Language[in] | A pointer to a Null-terminated ASCII string array indicating the language. This is the language of the driver name that the caller is requesting, and it must match one of the languages specified in SupportedLanguages. The number of languages supported by a driver is up to the driver writer. Language is specified in RFC 4646 or ISO 639-2 language code format. |
ControllerName[out] | A pointer to the Unicode string to return. This Unicode string is the name of the controller specified by ControllerHandle and ChildHandle in the language specified by Language from the point of view of the driver specified by This. |
EFI_SUCCESS | The Unicode string for the user readable name in the language specified by Language for the driver specified by This was returned in DriverName. |
EFI_INVALID_PARAMETER | ControllerHandle is NULL. |
EFI_INVALID_PARAMETER | ChildHandle is not NULL and it is not a valid EFI_HANDLE. |
EFI_INVALID_PARAMETER | Language is NULL. |
EFI_INVALID_PARAMETER | ControllerName is NULL. |
EFI_UNSUPPORTED | The driver specified by This is not currently managing the controller specified by ControllerHandle and ChildHandle. |
EFI_UNSUPPORTED | The driver specified by This does not support the language specified by Language. |
Definition at line 155 of file ComponentName.c.
EFI_STATUS EFIAPI VlanConfigComponentNameGetDriverName | ( | IN EFI_COMPONENT_NAME_PROTOCOL * | This, |
IN CHAR8 * | Language, | ||
OUT CHAR16 ** | DriverName | ||
) |
Retrieves a Unicode string that is the user readable name of the driver.
This function retrieves the user readable name of a driver in the form of a Unicode string. If the driver specified by This has a user readable name in the language specified by Language, then a pointer to the driver name is returned in DriverName, and EFI_SUCCESS is returned. If the driver specified by This does not support the language specified by Language, then EFI_UNSUPPORTED is returned.
This[in] | A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or EFI_COMPONENT_NAME_PROTOCOL instance. |
Language[in] | A pointer to a Null-terminated ASCII string array indicating the language. This is the language of the driver name that the caller is requesting, and it must match one of the languages specified in SupportedLanguages. The number of languages supported by a driver is up to the driver writer. Language is specified in RFC 4646 or ISO 639-2 language code format. |
DriverName[out] | A pointer to the Unicode string to return. This Unicode string is the name of the driver specified by This in the language specified by Language. |
EFI_SUCCESS | The Unicode string for the Driver specified by This and the language specified by Language was returned in DriverName. |
EFI_INVALID_PARAMETER | Language is NULL. |
EFI_INVALID_PARAMETER | DriverName is NULL. |
EFI_UNSUPPORTED | The driver specified by This does not support the language specified by Language. |
Definition at line 80 of file ComponentName.c.
EFI_STATUS EFIAPI VlanConfigDriverBindingStart | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | ControllerHandle, | ||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath | OPTIONAL | ||
) |
Start this driver on ControllerHandle.
[in] | This | Protocol instance pointer. |
[in] | ControllerHandle | Handle of device to bind driver to |
[in] | RemainingDevicePath | Optional parameter use to pick a specific child device to start. |
EFI_SUCCESS | This driver is added to ControllerHandle |
EFI_ALREADY_STARTED | This driver is already running on ControllerHandle |
other | This driver does not support this device |
Definition at line 112 of file VlanConfigDriver.c.
EFI_STATUS EFIAPI VlanConfigDriverBindingStop | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | ControllerHandle, | ||
IN UINTN | NumberOfChildren, | ||
IN EFI_HANDLE * | ChildHandleBuffer | ||
) |
Stop this driver on ControllerHandle.
[in] | This | Protocol instance pointer. |
[in] | ControllerHandle | Handle of device to stop driver on |
[in] | NumberOfChildren | Number of Handles in ChildHandleBuffer. If number of children is zero stop the entire bus driver. |
[in] | ChildHandleBuffer | List of Child Handles to Stop. |
EFI_SUCCESS | This driver is removed ControllerHandle |
other | This driver was not removed from this device |
Definition at line 243 of file VlanConfigDriver.c.
EFI_STATUS EFIAPI VlanConfigDriverBindingSupported | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | ControllerHandle, | ||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath | OPTIONAL | ||
) |
Test to see if this driver supports ControllerHandle.
[in] | This | Protocol instance pointer. |
[in] | ControllerHandle | Handle of device to test |
[in] | RemainingDevicePath | Optional parameter use to pick a specific child device to start. |
EFI_SUCCESS | This driver supports this device |
EFI_ALREADY_STARTED | This driver is already running on this device |
other | This driver does not support this device |
Definition at line 63 of file VlanConfigDriver.c.
EFI_STATUS EFIAPI VlanExtractConfig | ( | IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL * | This, |
IN CONST EFI_STRING | Request, | ||
OUT EFI_STRING * | Progress, | ||
OUT EFI_STRING * | Results | ||
) |
This function allows a caller to extract the current configuration for one or more named elements from the target driver.
[in] | This | Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL. |
[in] | Request | A null-terminated Unicode string in <ConfigRequest> format. |
[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 successful. |
[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. |
EFI_SUCCESS | The Results is filled with the requested values. |
EFI_OUT_OF_RESOURCES | Not enough memory to store the results. |
EFI_INVALID_PARAMETER | Request is NULL, illegal syntax, or unknown name. |
EFI_NOT_FOUND | Routing data doesn't match any storage in this driver. |
This function allows a caller to extract the current configuration for one or more named elements from the target driver.
[in] | This | Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL. |
[in] | Request | A null-terminated Unicode string in <ConfigRequest> format. |
[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 successful. |
[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. |
EFI_SUCCESS | The Results is filled with the requested values. |
EFI_OUT_OF_RESOURCES | Not enough memory to store the results. |
EFI_INVALID_PARAMETER | Request is illegal syntax, or unknown name. |
EFI_NOT_FOUND | Routing data doesn't match any storage in this driver. |
Definition at line 63 of file VlanConfigImpl.c.
EFI_STATUS EFIAPI VlanRouteConfig | ( | IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL * | This, |
IN CONST EFI_STRING | Configuration, | ||
OUT EFI_STRING * | Progress | ||
) |
This function processes the results of changes in configuration.
[in] | This | Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL. |
[in] | Configuration | A null-terminated Unicode string in <ConfigResp> format. |
[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. |
EFI_SUCCESS | The Results is processed successfully. |
EFI_INVALID_PARAMETER | Configuration is NULL. |
EFI_NOT_FOUND | Routing data doesn't match any storage in this driver. |
Definition at line 172 of file VlanConfigImpl.c.
VOID VlanUpdateForm | ( | IN OUT VLAN_CONFIG_PRIVATE_DATA * | PrivateData | ) |
This function update VLAN list in the VLAN configuration Form.
[in,out] | PrivateData | Points to VLAN configuration private data. |
Definition at line 338 of file VlanConfigImpl.c.
|
extern |
Definition at line 14 of file ComponentName.c.
|
extern |
Definition at line 23 of file ComponentName.c.
|
extern |
Definition at line 14 of file VlanConfigImpl.c.