Beispiel #1
0
/**
  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.

  @param [in] pThis             A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
                                EFI_COMPONENT_NAME_PROTOCOL instance.
  @param [in] ControllerHandle  The handle of a controller that the driver
                                specified by This is managing.  This handle
                                specifies the controller whose name is to be
                                returned.
  @param [in] ChildHandle       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.
  @param [in] pLanguage         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 3066 or ISO 639-2 language code format.
  @param [out] ppControllerName 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.

  @retval 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.
  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
                                EFI_HANDLE.
  @retval EFI_INVALID_PARAMETER Language is NULL.
  @retval EFI_INVALID_PARAMETER ControllerName is NULL.
  @retval EFI_UNSUPPORTED       The driver specified by This is not currently
                                managing the controller specified by
                                ControllerHandle and ChildHandle.
  @retval EFI_UNSUPPORTED       The driver specified by This does not support
                                the language specified by Language.

**/
EFI_STATUS
EFIAPI
GetControllerName (
  IN  EFI_COMPONENT_NAME_PROTOCOL * pThis,
  IN  EFI_HANDLE ControllerHandle,
  IN OPTIONAL EFI_HANDLE ChildHandle,
  IN  CHAR8 * pLanguage,
  OUT CHAR16 ** ppControllerName
  )
{
  EFI_STATUS Status;

  DBG_ENTER ( );

  //
  // Set the controller name
  //
  *ppControllerName = L"Socket Layer";
  Status = EFI_SUCCESS;

  //
  // Return the operation status
  //
  DBG_EXIT_HEX ( Status );
  return Status;
}
Beispiel #2
0
/**
  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.

  @param [in] pThis             A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
                                EFI_COMPONENT_NAME_PROTOCOL instance.
  @param [in] pLanguage         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 3066 or ISO 639-2 language code format.
  @param [out] ppDriverName     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.

  @retval EFI_SUCCESS           The Unicode string for the Driver specified by
                                This and the language specified by Language was
                                returned in DriverName.
  @retval EFI_INVALID_PARAMETER Language is NULL.
  @retval EFI_INVALID_PARAMETER DriverName is NULL.
  @retval EFI_UNSUPPORTED       The driver specified by This does not support
                                the language specified by Language.

**/
EFI_STATUS
EFIAPI
GetDriverName (
  IN  EFI_COMPONENT_NAME_PROTOCOL * pThis,
  IN  CHAR8 * pLanguage,
  OUT CHAR16 ** ppDriverName
  )
{
  EFI_STATUS Status;

  DBG_ENTER ( );
  Status = LookupUnicodeString2 (
             pLanguage,
             pThis->SupportedLanguages,
             mDriverNameTable,
             ppDriverName,
             (BOOLEAN)(pThis == &gComponentName)
             );
  DBG_EXIT_HEX ( Status );
  return Status;
}
Beispiel #3
0
/**
  Receive data from a network connection.

  This routine attempts to return buffered data to the caller.  The
  data is removed from the urgent queue if the message flag MSG_OOB
  is specified, otherwise data is removed from the normal queue.
  See the \ref ReceiveEngine section.

  This routine is called by ::EslSocketReceive to handle the network
  specific receive operation to support SOCK_DGRAM sockets.

  @param [in] pPort           Address of an ::ESL_PORT structure.

  @param [in] pPacket         Address of an ::ESL_PACKET structure.
  
  @param [in] pbConsumePacket Address of a BOOLEAN indicating if the packet is to be consumed
  
  @param [in] BufferLength    Length of the the buffer
  
  @param [in] pBuffer         Address of a buffer to receive the data.
  
  @param [in] pDataLength     Number of received data bytes in the buffer.

  @param [out] pAddress       Network address to receive the remote system address

  @param [out] pSkipBytes     Address to receive the number of bytes skipped

  @return   Returns the address of the next free byte in the buffer.

 **/
UINT8 *
EslUdp6Receive (
  IN ESL_PORT * pPort,
  IN ESL_PACKET * pPacket,
  IN BOOLEAN * pbConsumePacket,
  IN size_t BufferLength,
  IN UINT8 * pBuffer,
  OUT size_t * pDataLength,
  OUT struct sockaddr * pAddress,
  OUT size_t * pSkipBytes
  )
{
  size_t DataBytes;
  struct sockaddr_in6 * pRemoteAddress;
  EFI_UDP6_RECEIVE_DATA * pRxData;

  DBG_ENTER ( );

  pRxData = pPacket->Op.Udp6Rx.pRxData;
  //
  //  Return the remote system address if requested
  //
  if ( NULL != pAddress ) {
    //
    //  Build the remote address
    //
    DEBUG (( DEBUG_RX,
              "Getting packet remote address: [%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x]:%d\r\n",
              pRxData->UdpSession.SourceAddress.Addr[0],
              pRxData->UdpSession.SourceAddress.Addr[1],
              pRxData->UdpSession.SourceAddress.Addr[2],
              pRxData->UdpSession.SourceAddress.Addr[3],
              pRxData->UdpSession.SourceAddress.Addr[4],
              pRxData->UdpSession.SourceAddress.Addr[5],
              pRxData->UdpSession.SourceAddress.Addr[6],
              pRxData->UdpSession.SourceAddress.Addr[7],
              pRxData->UdpSession.SourceAddress.Addr[8],
              pRxData->UdpSession.SourceAddress.Addr[9],
              pRxData->UdpSession.SourceAddress.Addr[10],
              pRxData->UdpSession.SourceAddress.Addr[11],
              pRxData->UdpSession.SourceAddress.Addr[12],
              pRxData->UdpSession.SourceAddress.Addr[13],
              pRxData->UdpSession.SourceAddress.Addr[14],
              pRxData->UdpSession.SourceAddress.Addr[15],
              pRxData->UdpSession.SourcePort ));
    pRemoteAddress = (struct sockaddr_in6 *)pAddress;
    CopyMem ( &pRemoteAddress->sin6_addr,
              &pRxData->UdpSession.SourceAddress.Addr[0],
              sizeof ( pRemoteAddress->sin6_addr ));
    pRemoteAddress->sin6_port = SwapBytes16 ( pRxData->UdpSession.SourcePort );
  }

  //
  //  Copy the received data
  //
  pBuffer = EslSocketCopyFragmentedBuffer ( pRxData->FragmentCount,
                                            (EFI_IP4_FRAGMENT_DATA *)&pRxData->FragmentTable[0],
                                            BufferLength,
                                            pBuffer,
                                            &DataBytes );

  //
  //  Determine if the data is being read
  //
  if ( *pbConsumePacket ) {
    //
    //  Display for the bytes consumed
    //
    DEBUG (( DEBUG_RX,
              "0x%08x: Port account for 0x%08x bytes\r\n",
              pPort,
              DataBytes ));

    //
    //  Account for any discarded data
    //
    *pSkipBytes = pRxData->DataLength - DataBytes;
  }

  //
  //  Return the data length and the buffer address
  //
  *pDataLength = DataBytes;
  DBG_EXIT_HEX ( pBuffer );
  return pBuffer;
}