28#define INVALID_NIC_INDEX 0xffff
29#define INVALID_VLAN_ID 0xffff
36extern UINT8 VConfigStrings[];
78 Status =
gBS->LocateHandleBuffer (
80 &gEfiVlanConfigProtocolGuid,
85 if (EFI_ERROR (Status)) {
107 if ((
StrnCmp (Name, L
"eth", 3) != 0) || (*Str == 0)) {
108 return INVALID_NIC_INDEX;
112 if ((*Str < L
'0') || (*Str > L
'9')) {
113 return INVALID_NIC_INDEX;
136 UINTN NumberOfHandles;
145 if (NumberOfHandles == 0) {
150 if (Index >= NumberOfHandles) {
154 Handle = HandleBuffer[Index];
179 &gEfiVlanConfigProtocolGuid,
180 (VOID **)&VlanConfig,
183 EFI_OPEN_PROTOCOL_GET_PROTOCOL
202 &gEfiVlanConfigProtocolGuid,
229 if (VlanConfig ==
NULL) {
235 if (EFI_ERROR (Status)) {
242 Status = VlanConfig->Find (VlanConfig,
NULL, &NumberOfVlan, &VlanData);
243 if (EFI_ERROR (Status)) {
244 if (Status == EFI_NOT_FOUND) {
253 for (Index = 0; Index < NumberOfVlan; Index++) {
260 VlanData[Index].VlanId,
261 VlanData[Index].Priority
270 if (MacStr !=
NULL) {
284 IN CHAR16 *Name OPTIONAL
287 UINTN NumberOfHandles;
297 if (NicHandle ==
NULL) {
309 if (NumberOfHandles == 0) {
313 for (Index = 0; Index < NumberOfHandles; Index++) {
335 if (String ==
NULL) {
336 return INVALID_VLAN_ID;
340 while ((*Str >=
'0') && (*Str <=
'9')) {
345 return INVALID_VLAN_ID;
377 if (ParamStr ==
NULL) {
383 if (StrPtr ==
NULL) {
391 while (*StrPtr != 0) {
392 if (*StrPtr == L
' ') {
400 if (VlanIdStr ==
NULL) {
405 }
else if (PriorityStr ==
NULL) {
409 PriorityStr = StrPtr;
425 if (Handle ==
NULL) {
430 if (VlanConfig ==
NULL) {
437 if ((VlanIdStr ==
NULL) || (*VlanIdStr == 0)) {
451 if ((PriorityStr !=
NULL) && (*PriorityStr != 0)) {
462 Status = VlanConfig->Set (VlanConfig, (UINT16)VlanId, (UINT8)Priority);
463 if (EFI_ERROR (Status)) {
472 if (VlanHandle !=
NULL) {
479 if (VlanConfig !=
NULL) {
509 if (ParamStr ==
NULL) {
515 if (StrPtr ==
NULL) {
521 while (*StrPtr != 0) {
522 if (*StrPtr == L
'.') {
524 VlanIdStr = StrPtr + 1;
532 if (Handle ==
NULL) {
537 if (VlanConfig ==
NULL) {
544 if ((VlanIdStr ==
NULL) || (*VlanIdStr == 0)) {
558 Status = VlanConfig->Remove (VlanConfig, (UINT16)VlanId);
559 if (EFI_ERROR (Status)) {
560 if (Status == EFI_NOT_FOUND) {
572 Status = VlanConfig->Find (VlanConfig,
NULL, &NumberOfVlan, &VlanData);
573 if (EFI_ERROR (Status)) {
585 if (VlanConfig !=
NULL) {
614 mImageHandle = ImageHandle;
619 Status =
gBS->OpenProtocol (
621 &gEfiHiiPackageListProtocolGuid,
622 (VOID **)&PackageList,
625 EFI_OPEN_PROTOCOL_GET_PROTOCOL
627 if (EFI_ERROR (Status)) {
640 if (EFI_ERROR (Status)) {
644 if (mHiiHandle ==
NULL) {
UINTN EFIAPI StrSize(IN CONST CHAR16 *String)
UINTN EFIAPI StrDecimalToUintn(IN CONST CHAR16 *String)
INTN EFIAPI StrnCmp(IN CONST CHAR16 *FirstString, IN CONST CHAR16 *SecondString, IN UINTN Length)
VOID EFIAPI FreePool(IN VOID *Buffer)
VOID *EFIAPI AllocateCopyPool(IN UINTN AllocationSize, IN CONST VOID *Buffer)
VOID EFIAPI HiiRemovePackages(IN EFI_HII_HANDLE HiiHandle)
#define GLOBAL_REMOVE_IF_UNREFERENCED
EFI_STATUS EFIAPI NetLibGetMacString(IN EFI_HANDLE ServiceHandle, IN EFI_HANDLE ImageHandle OPTIONAL, OUT CHAR16 **MacString)
EFI_HANDLE EFIAPI NetLibGetVlanHandle(IN EFI_HANDLE ControllerHandle, IN UINT16 VlanId)
CONST CHAR16 *EFIAPI ShellCommandLineGetValue(IN CONST LIST_ENTRY *CheckPackage, IN CHAR16 *KeyString)
EFI_STATUS EFIAPI ShellPrintHiiEx(IN INT32 Col OPTIONAL, IN INT32 Row OPTIONAL, IN CONST CHAR8 *Language OPTIONAL, IN CONST EFI_STRING_ID HiiFormatStringId, IN CONST EFI_HII_HANDLE HiiFormatHandle,...)
BOOLEAN EFIAPI ShellCommandLineGetFlag(IN CONST LIST_ENTRY *CONST CheckPackage, IN CONST CHAR16 *CONST KeyString)
@ TypeValue
A flag that has some data following it with a space (IE "-a 1").
@ TypeMaxValue
A flag followed by all the command line data before the next flag.
EFI_STATUS EFIAPI ShellCommandLineParseEx(IN CONST SHELL_PARAM_ITEM *CheckList, OUT LIST_ENTRY **CheckPackage, OUT CHAR16 **ProblemParam OPTIONAL, IN BOOLEAN AutoPageBreak, IN BOOLEAN AlwaysAllowNumbers)
VOID EFIAPI ShellCommandLineFreeVarList(IN LIST_ENTRY *CheckPackage)
VOID EFIAPI Exit(IN EFI_STATUS Status)
EFI_HII_DATABASE_PROTOCOL * gHiiDatabase
EFI_HANDLE NicNameToHandle(IN CHAR16 *Name)
EFI_VLAN_CONFIG_PROTOCOL * OpenVlanConfigProtocol(IN EFI_HANDLE Handle)
UINTN NicNameToIndex(IN CHAR16 *Name)
UINT16 StrToVlanId(IN CHAR16 *String)
VOID CloseVlanConfigProtocol(IN EFI_HANDLE Handle)
VOID LocateNicHandleBuffer(OUT UINTN *NumberOfHandles, OUT EFI_HANDLE **HandleBuffer)
VOID DisplayVlan(IN CHAR16 *Name OPTIONAL)
VOID AddVlan(IN CHAR16 *ParamStr)
VOID ShowNicVlanInfo(IN EFI_HANDLE Handle, IN UINTN NicIndex)
EFI_STATUS EFIAPI VlanConfigMain(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
VOID DeleteVlan(IN CHAR16 *ParamStr)