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
| 210 | |
| 211 | **/ |
| 212 | EFI_STATUS |
| 213 | EFIAPI |
| 214 | VlanCallback ( |
| 215 | IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, |
| 216 | IN EFI_BROWSER_ACTION Action, |
| 217 | IN EFI_QUESTION_ID QuestionId, |
| 218 | IN UINT8 Type, |
| 219 | IN EFI_IFR_TYPE_VALUE *Value, |
| 220 | OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest |
| 221 | ) |
| 222 | { |
| 223 | VLAN_CONFIG_PRIVATE_DATA *PrivateData; |
| 224 | VLAN_CONFIGURATION *Configuration; |
| 225 | EFI_VLAN_CONFIG_PROTOCOL *VlanConfig; |
| 226 | UINTN Index; |
| 227 | EFI_HANDLE VlanHandle; |
| 228 | |
| 229 | PrivateData = VLAN_CONFIG_PRIVATE_DATA_FROM_THIS (This); |
| 230 | |
| 231 | if ((Action == EFI_BROWSER_ACTION_FORM_OPEN) || (Action == EFI_BROWSER_ACTION_FORM_CLOSE)) { |
| 232 | return EFI_SUCCESS; |
| 233 | } |
| 234 | |
| 235 | if ((Action != EFI_BROWSER_ACTION_CHANGED) && (Action != EFI_BROWSER_ACTION_CHANGING)) { |
| 236 | // |
| 237 | // All other action return unsupported. |
| 238 | // |
| 239 | return EFI_UNSUPPORTED; |
| 240 | } |
| 241 | |
| 242 | // |
| 243 | // Get Browser data |
| 244 | // |
| 245 | Configuration = AllocateZeroPool (sizeof (VLAN_CONFIGURATION)); |
| 246 | ASSERT (Configuration != NULL); |
| 247 | HiiGetBrowserData (&gVlanConfigFormSetGuid, mVlanStorageName, sizeof (VLAN_CONFIGURATION), (UINT8 *) Configuration); |
| 248 | |
| 249 | VlanConfig = PrivateData->VlanConfig; |
| 250 | |
| 251 | if (Action == EFI_BROWSER_ACTION_CHANGED) { |
| 252 | switch (QuestionId) { |
| 253 | case VLAN_ADD_QUESTION_ID: |
| 254 | // |
| 255 | // Add a VLAN |
| 256 | // |
| 257 | VlanConfig->Set (VlanConfig, Configuration->VlanId, Configuration->Priority); |
| 258 | VlanUpdateForm (PrivateData); |
| 259 | |
| 260 | // |
| 261 | // Connect the newly created VLAN device |
| 262 | // |
| 263 | VlanHandle = NetLibGetVlanHandle (PrivateData->ControllerHandle, Configuration->VlanId); |
| 264 | if (VlanHandle == NULL) { |
| 265 | // |
| 266 | // There may be no child handle created for VLAN ID 0, connect the parent handle |
| 267 | // |
| 268 | VlanHandle = PrivateData->ControllerHandle; |
| 269 | } |
nothing calls this directly
no test coverage detected