選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

VlanConfig.h 5.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. /** @file
  2. EFI VLAN Config protocol is to provide manageability interface for VLAN configuration.
  3. Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
  4. This program and the accompanying materials
  5. are licensed and made available under the terms and conditions of the BSD License
  6. which accompanies this distribution. The full text of the license may be found at
  7. http://opensource.org/licenses/bsd-license.php
  8. THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
  10. @par Revision Reference:
  11. This Protocol is introduced in UEFI Specification 2.2
  12. **/
  13. #ifndef __EFI_VLANCONFIG_PROTOCOL_H__
  14. #define __EFI_VLANCONFIG_PROTOCOL_H__
  15. FILE_LICENCE ( BSD3 );
  16. #define EFI_VLAN_CONFIG_PROTOCOL_GUID \
  17. { \
  18. 0x9e23d768, 0xd2f3, 0x4366, {0x9f, 0xc3, 0x3a, 0x7a, 0xba, 0x86, 0x43, 0x74 } \
  19. }
  20. typedef struct _EFI_VLAN_CONFIG_PROTOCOL EFI_VLAN_CONFIG_PROTOCOL;
  21. ///
  22. /// EFI_VLAN_FIND_DATA
  23. ///
  24. typedef struct {
  25. UINT16 VlanId; ///< Vlan Identifier.
  26. UINT8 Priority; ///< Priority of this VLAN.
  27. } EFI_VLAN_FIND_DATA;
  28. /**
  29. Create a VLAN device or modify the configuration parameter of an
  30. already-configured VLAN.
  31. The Set() function is used to create a new VLAN device or change the VLAN
  32. configuration parameters. If the VlanId hasn't been configured in the
  33. physical Ethernet device, a new VLAN device will be created. If a VLAN with
  34. this VlanId is already configured, then related configuration will be updated
  35. as the input parameters.
  36. If VlanId is zero, the VLAN device will send and receive untagged frames.
  37. Otherwise, the VLAN device will send and receive VLAN-tagged frames containing the VlanId.
  38. If VlanId is out of scope of (0-4094), EFI_INVALID_PARAMETER is returned.
  39. If Priority is out of the scope of (0-7), then EFI_INVALID_PARAMETER is returned.
  40. If there is not enough system memory to perform the registration, then
  41. EFI_OUT_OF_RESOURCES is returned.
  42. @param[in] This Points to the EFI_VLAN_CONFIG_PROTOCOL.
  43. @param[in] VlanId A unique identifier (1-4094) of the VLAN which is being created
  44. or modified, or zero (0).
  45. @param[in] Priority 3 bit priority in VLAN header. Priority 0 is default value. If
  46. VlanId is zero (0), Priority is ignored.
  47. @retval EFI_SUCCESS The VLAN is successfully configured.
  48. @retval EFI_INVALID_PARAMETER One or more of following conditions is TRUE:
  49. - This is NULL.
  50. - VlanId is an invalid VLAN Identifier.
  51. - Priority is invalid.
  52. @retval EFI_OUT_OF_RESOURCES There is not enough system memory to perform the registration.
  53. **/
  54. typedef
  55. EFI_STATUS
  56. (EFIAPI *EFI_VLAN_CONFIG_SET)(
  57. IN EFI_VLAN_CONFIG_PROTOCOL *This,
  58. IN UINT16 VlanId,
  59. IN UINT8 Priority
  60. );
  61. /**
  62. Find configuration information for specified VLAN or all configured VLANs.
  63. The Find() function is used to find the configuration information for matching
  64. VLAN and allocate a buffer into which those entries are copied.
  65. @param[in] This Points to the EFI_VLAN_CONFIG_PROTOCOL.
  66. @param[in] VlanId Pointer to VLAN identifier. Set to NULL to find all
  67. configured VLANs.
  68. @param[out] NumberOfVlan The number of VLANs which is found by the specified criteria.
  69. @param[out] Entries The buffer which receive the VLAN configuration.
  70. @retval EFI_SUCCESS The VLAN is successfully found.
  71. @retval EFI_INVALID_PARAMETER One or more of following conditions is TRUE:
  72. - This is NULL.
  73. - Specified VlanId is invalid.
  74. @retval EFI_NOT_FOUND No matching VLAN is found.
  75. **/
  76. typedef
  77. EFI_STATUS
  78. (EFIAPI *EFI_VLAN_CONFIG_FIND)(
  79. IN EFI_VLAN_CONFIG_PROTOCOL *This,
  80. IN UINT16 *VlanId OPTIONAL,
  81. OUT UINT16 *NumberOfVlan,
  82. OUT EFI_VLAN_FIND_DATA **Entries
  83. );
  84. /**
  85. Remove the configured VLAN device.
  86. The Remove() function is used to remove the specified VLAN device.
  87. If the VlanId is out of the scope of (0-4094), EFI_INVALID_PARAMETER is returned.
  88. If specified VLAN hasn't been previously configured, EFI_NOT_FOUND is returned.
  89. @param[in] This Points to the EFI_VLAN_CONFIG_PROTOCOL.
  90. @param[in] VlanId Identifier (0-4094) of the VLAN to be removed.
  91. @retval EFI_SUCCESS The VLAN is successfully removed.
  92. @retval EFI_INVALID_PARAMETER One or more of following conditions is TRUE:
  93. - This is NULL.
  94. - VlanId is an invalid parameter.
  95. @retval EFI_NOT_FOUND The to-be-removed VLAN does not exist.
  96. **/
  97. typedef
  98. EFI_STATUS
  99. (EFIAPI *EFI_VLAN_CONFIG_REMOVE)(
  100. IN EFI_VLAN_CONFIG_PROTOCOL *This,
  101. IN UINT16 VlanId
  102. );
  103. ///
  104. /// EFI_VLAN_CONFIG_PROTOCOL
  105. /// provide manageability interface for VLAN setting. The intended
  106. /// VLAN tagging implementation is IEEE802.1Q.
  107. ///
  108. struct _EFI_VLAN_CONFIG_PROTOCOL {
  109. EFI_VLAN_CONFIG_SET Set;
  110. EFI_VLAN_CONFIG_FIND Find;
  111. EFI_VLAN_CONFIG_REMOVE Remove;
  112. };
  113. extern EFI_GUID gEfiVlanConfigProtocolGuid;
  114. #endif