TianoCore EDK2 master
Loading...
Searching...
No Matches
Snp.c File Reference
#include "Snp.h"

Go to the source code of this file.

Functions

VOID EFIAPI SnpNotifyExitBootServices (EFI_EVENT Event, VOID *Context)
 
EFI_STATUS EFIAPI IssueHwUndiCommand (UINT64 Cdb)
 
UINT8 Calc8BitCksum (VOID *Buffer, UINTN Length)
 
EFI_STATUS EFIAPI SimpleNetworkDriverSupported (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
 
EFI_STATUS EFIAPI SimpleNetworkDriverStart (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
 
EFI_STATUS EFIAPI SimpleNetworkDriverStop (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer)
 
EFI_STATUS EFIAPI InitializeSnpNiiDriver (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

EFI_DRIVER_BINDING_PROTOCOL gSimpleNetworkDriverBinding
 

Detailed Description

Implementation of driver entry point and driver binding protocol.

Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.
Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file Snp.c.

Function Documentation

◆ Calc8BitCksum()

UINT8 Calc8BitCksum ( VOID *  Buffer,
UINTN  Length 
)

Compute 8-bit checksum of a buffer.

Parameters
BufferPointer to buffer.
LengthLength of buffer in bytes.
Returns
8-bit checksum of all bytes in buffer, or zero if ptr is NULL or len is zero.

Definition at line 76 of file Snp.c.

◆ InitializeSnpNiiDriver()

EFI_STATUS EFIAPI InitializeSnpNiiDriver ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

The SNP driver entry point.

Parameters
ImageHandleThe driver image handle.
SystemTableThe system table.
Return values
EFI_SUCCESSInitialization routine has found UNDI hardware, loaded it's ROM, and installed a notify event for the Network Identifier Interface Protocol successfully.
OtherReturn value from HandleProtocol for DeviceIoProtocol or LoadedImageProtocol

Definition at line 852 of file Snp.c.

◆ IssueHwUndiCommand()

EFI_STATUS EFIAPI IssueHwUndiCommand ( UINT64  Cdb)

Send command to UNDI. It does nothing currently.

Parameters
Cdbcommand to be sent to UNDI.
Return values
EFI_INVALID_PARAMETERThe command is 0.
EFI_UNSUPPORTEDDefault return status because it's not supported currently.

Definition at line 49 of file Snp.c.

◆ SimpleNetworkDriverStart()

EFI_STATUS EFIAPI SimpleNetworkDriverStart ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  Controller,
IN EFI_DEVICE_PATH_PROTOCOL RemainingDevicePath 
)

Start this driver on ControllerHandle. This service is called by the EFI boot service ConnectController(). In order to make drivers as small as possible, there are a few calling restrictions for this service. ConnectController() must follow these calling restrictions. If any other agent wishes to call Start() it must also follow these calling restrictions.

Parameters
ThisProtocol instance pointer.
ControllerHandleHandle of device to bind driver to.
RemainingDevicePathOptional parameter use to pick a specific child device to start.
Return values
EFI_SUCCESSThis driver is added to ControllerHandle
EFI_DEVICE_ERRORThis driver could not be started due to a device error
otherThis driver does not support this device

Definition at line 254 of file Snp.c.

◆ SimpleNetworkDriverStop()

EFI_STATUS EFIAPI SimpleNetworkDriverStop ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  Controller,
IN UINTN  NumberOfChildren,
IN EFI_HANDLE ChildHandleBuffer 
)

Stop this driver on ControllerHandle. This service is called by the EFI boot service DisconnectController(). In order to make drivers as small as possible, there are a few calling restrictions for this service. DisconnectController() must follow these calling restrictions. If any other agent wishes to call Stop() it must also follow these calling restrictions.

Parameters
ThisProtocol instance pointer.
ControllerHandleHandle of device to stop driver on
NumberOfChildrenNumber of Handles in ChildHandleBuffer. If number of children is zero stop the entire bus driver.
ChildHandleBufferList of Child Handles to Stop.
Return values
EFI_SUCCESSThis driver is removed ControllerHandle
otherThis driver was not removed from this device

Definition at line 742 of file Snp.c.

◆ SimpleNetworkDriverSupported()

EFI_STATUS EFIAPI SimpleNetworkDriverSupported ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  Controller,
IN EFI_DEVICE_PATH_PROTOCOL RemainingDevicePath 
)

Test to see if this driver supports ControllerHandle. This service is called by the EFI boot service ConnectController(). In order to make drivers as small as possible, there are a few calling restrictions for this service. ConnectController() must follow these calling restrictions. If any other agent wishes to call Supported() it must also follow these calling restrictions.

Parameters
ThisProtocol instance pointer.
ControllerHandleHandle of device to test.
RemainingDevicePathOptional parameter use to pick a specific child device to start.
Return values
EFI_SUCCESSThis driver supports this device.
EFI_ALREADY_STARTEDThis driver is already running on this device.
otherThis driver does not support this device.

Definition at line 118 of file Snp.c.

◆ SnpNotifyExitBootServices()

VOID EFIAPI SnpNotifyExitBootServices ( EFI_EVENT  Event,
VOID *  Context 
)

One notified function to stop UNDI device when gBS->ExitBootServices() called.

Parameters
EventPointer to this event
ContextEvent handler private data

Definition at line 21 of file Snp.c.

Variable Documentation

◆ gSimpleNetworkDriverBinding

EFI_DRIVER_BINDING_PROTOCOL gSimpleNetworkDriverBinding
Initial value:
= {
0xa,
}
#define NULL
Definition: Base.h:319
EFI_STATUS EFIAPI SimpleNetworkDriverSupported(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
Definition: Snp.c:118
EFI_STATUS EFIAPI SimpleNetworkDriverStop(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer)
Definition: Snp.c:742
EFI_STATUS EFIAPI SimpleNetworkDriverStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
Definition: Snp.c:254

Definition at line 827 of file Snp.c.