2007-07-11 08:46:38 +02:00
|
|
|
/** @file
|
|
|
|
|
2008-07-08 12:26:16 +02:00
|
|
|
This file contains the definination for host controller schedule routines.
|
|
|
|
|
2010-04-24 11:49:11 +02:00
|
|
|
Copyright (c) 2007 - 2009, Intel Corporation. All rights reserved.<BR>
|
|
|
|
This program and the accompanying materials
|
2007-07-11 08:46:38 +02:00
|
|
|
are licensed and made available under the terms and conditions of the BSD License
|
|
|
|
which accompanies this distribution. The full text of the license may be found at
|
|
|
|
http://opensource.org/licenses/bsd-license.php
|
|
|
|
|
|
|
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
|
|
|
2008-07-08 12:26:16 +02:00
|
|
|
**/
|
2007-07-11 08:46:38 +02:00
|
|
|
|
2008-07-08 12:26:16 +02:00
|
|
|
#ifndef _EFI_EHCI_SCHED_H_
|
|
|
|
#define _EFI_EHCI_SCHED_H_
|
2007-07-11 08:46:38 +02:00
|
|
|
|
|
|
|
|
2008-07-08 12:26:16 +02:00
|
|
|
/**
|
|
|
|
Initialize the schedule data structure such as frame list.
|
2007-07-11 08:46:38 +02:00
|
|
|
|
2008-07-08 12:26:16 +02:00
|
|
|
@param Ehc The EHCI device to init schedule data for.
|
2007-07-11 08:46:38 +02:00
|
|
|
|
2008-07-08 12:26:16 +02:00
|
|
|
@retval EFI_OUT_OF_RESOURCES Failed to allocate resource to init schedule data.
|
|
|
|
@retval EFI_SUCCESS The schedule data is initialized.
|
2007-07-11 08:46:38 +02:00
|
|
|
|
2008-07-08 12:26:16 +02:00
|
|
|
**/
|
2007-07-11 08:46:38 +02:00
|
|
|
EFI_STATUS
|
|
|
|
EhcInitSched (
|
|
|
|
IN USB2_HC_DEV *Ehc
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-07-11 08:46:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
Free the schedule data. It may be partially initialized.
|
|
|
|
|
2008-07-08 12:26:16 +02:00
|
|
|
@param Ehc The EHCI device.
|
2007-07-11 08:46:38 +02:00
|
|
|
|
|
|
|
**/
|
|
|
|
VOID
|
|
|
|
EhcFreeSched (
|
|
|
|
IN USB2_HC_DEV *Ehc
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-07-11 08:46:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
Link the queue head to the asynchronous schedule list.
|
|
|
|
UEFI only supports one CTRL/BULK transfer at a time
|
|
|
|
due to its interfaces. This simplifies the AsynList
|
|
|
|
management: A reclamation header is always linked to
|
|
|
|
the AsyncListAddr, the only active QH is appended to it.
|
|
|
|
|
2008-07-08 12:26:16 +02:00
|
|
|
@param Ehc The EHCI device.
|
|
|
|
@param Qh The queue head to link.
|
2007-07-11 08:46:38 +02:00
|
|
|
|
|
|
|
**/
|
|
|
|
VOID
|
|
|
|
EhcLinkQhToAsync (
|
|
|
|
IN USB2_HC_DEV *Ehc,
|
|
|
|
IN EHC_QH *Qh
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-07-11 08:46:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
Unlink a queue head from the asynchronous schedule list.
|
2008-07-08 12:26:16 +02:00
|
|
|
Need to synchronize with hardware.
|
2007-07-11 08:46:38 +02:00
|
|
|
|
2008-07-08 12:26:16 +02:00
|
|
|
@param Ehc The EHCI device.
|
|
|
|
@param Qh The queue head to unlink.
|
2007-07-11 08:46:38 +02:00
|
|
|
|
|
|
|
**/
|
|
|
|
VOID
|
|
|
|
EhcUnlinkQhFromAsync (
|
|
|
|
IN USB2_HC_DEV *Ehc,
|
|
|
|
IN EHC_QH *Qh
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-07-11 08:46:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
Link a queue head for interrupt transfer to the periodic
|
|
|
|
schedule frame list. This code is very much the same as
|
|
|
|
that in UHCI.
|
|
|
|
|
2008-07-08 12:26:16 +02:00
|
|
|
@param Ehc The EHCI device.
|
|
|
|
@param Qh The queue head to link.
|
2007-07-11 08:46:38 +02:00
|
|
|
|
|
|
|
**/
|
|
|
|
VOID
|
|
|
|
EhcLinkQhToPeriod (
|
|
|
|
IN USB2_HC_DEV *Ehc,
|
|
|
|
IN EHC_QH *Qh
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-07-11 08:46:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
Unlink an interrupt queue head from the periodic
|
2008-07-08 12:26:16 +02:00
|
|
|
schedule frame list.
|
2007-07-11 08:46:38 +02:00
|
|
|
|
2008-07-08 12:26:16 +02:00
|
|
|
@param Ehc The EHCI device.
|
|
|
|
@param Qh The queue head to unlink.
|
2007-07-11 08:46:38 +02:00
|
|
|
|
|
|
|
**/
|
|
|
|
VOID
|
|
|
|
EhcUnlinkQhFromPeriod (
|
|
|
|
IN USB2_HC_DEV *Ehc,
|
|
|
|
IN EHC_QH *Qh
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-07-11 08:46:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
Execute the transfer by polling the URB. This is a synchronous operation.
|
|
|
|
|
2008-07-08 12:26:16 +02:00
|
|
|
@param Ehc The EHCI device.
|
|
|
|
@param Urb The URB to execute.
|
|
|
|
@param TimeOut The time to wait before abort, in millisecond.
|
2007-07-11 08:46:38 +02:00
|
|
|
|
2008-07-08 12:26:16 +02:00
|
|
|
@retval EFI_DEVICE_ERROR The transfer failed due to transfer error.
|
|
|
|
@retval EFI_TIMEOUT The transfer failed due to time out.
|
|
|
|
@retval EFI_SUCCESS The transfer finished OK.
|
2007-07-11 08:46:38 +02:00
|
|
|
|
|
|
|
**/
|
|
|
|
EFI_STATUS
|
|
|
|
EhcExecTransfer (
|
|
|
|
IN USB2_HC_DEV *Ehc,
|
|
|
|
IN URB *Urb,
|
|
|
|
IN UINTN TimeOut
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-07-11 08:46:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
Delete a single asynchronous interrupt transfer for
|
2008-07-08 12:26:16 +02:00
|
|
|
the device and endpoint.
|
2007-07-11 08:46:38 +02:00
|
|
|
|
2008-07-08 12:26:16 +02:00
|
|
|
@param Ehc The EHCI device.
|
|
|
|
@param DevAddr The address of the target device.
|
|
|
|
@param EpNum The endpoint of the target.
|
|
|
|
@param DataToggle Return the next data toggle to use.
|
2007-07-11 08:46:38 +02:00
|
|
|
|
2008-07-08 12:26:16 +02:00
|
|
|
@retval EFI_SUCCESS An asynchronous transfer is removed.
|
|
|
|
@retval EFI_NOT_FOUND No transfer for the device is found.
|
2007-07-11 08:46:38 +02:00
|
|
|
|
|
|
|
**/
|
|
|
|
EFI_STATUS
|
|
|
|
EhciDelAsyncIntTransfer (
|
|
|
|
IN USB2_HC_DEV *Ehc,
|
|
|
|
IN UINT8 DevAddr,
|
|
|
|
IN UINT8 EpNum,
|
|
|
|
OUT UINT8 *DataToggle
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-07-11 08:46:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
2008-07-08 12:26:16 +02:00
|
|
|
Remove all the asynchronous interrutp transfers.
|
2007-07-11 08:46:38 +02:00
|
|
|
|
2008-07-08 12:26:16 +02:00
|
|
|
@param Ehc The EHCI device.
|
2007-07-11 08:46:38 +02:00
|
|
|
|
|
|
|
**/
|
|
|
|
VOID
|
|
|
|
EhciDelAllAsyncIntTransfers (
|
|
|
|
IN USB2_HC_DEV *Ehc
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-07-11 08:46:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
2008-07-08 12:26:16 +02:00
|
|
|
Interrupt transfer periodic check handler.
|
2007-07-11 08:46:38 +02:00
|
|
|
|
2008-07-08 12:26:16 +02:00
|
|
|
@param Event Interrupt event.
|
|
|
|
@param Context Pointer to USB2_HC_DEV.
|
2007-07-11 08:46:38 +02:00
|
|
|
|
|
|
|
**/
|
|
|
|
VOID
|
2009-04-10 22:58:18 +02:00
|
|
|
EFIAPI
|
2009-02-04 07:56:31 +01:00
|
|
|
EhcMonitorAsyncRequests (
|
2007-07-11 08:46:38 +02:00
|
|
|
IN EFI_EVENT Event,
|
|
|
|
IN VOID *Context
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-07-11 08:46:38 +02:00
|
|
|
|
|
|
|
#endif
|