CHCICmdQController Class Reference

class CHCICmdQController : public CBase

Inherits from

Public Member Functions
~CHCICmdQController ()
void CompletionTimeoutFired ( TUint )
IMPORT_C void DoSend ()
IMPORT_C void Initialise ()
TUint MhcqAddCommandL ( CHCICommandQItem *)
TUint MhcqAddCommandL ( CHCICommandBase *, MHCICommandQueueClient &)
TUint MhcqAddInitCommandL ( CHCICommandQItem *)
TUint MhcqAddInitCommandL ( CHCICommandBase *, MHCICommandQueueClient &)
TUint MhcqAddPriorityCommandL ( CHCICommandQItem *)
TUint MhcqAddPriorityCommandL ( CHCICommandBase *, MHCICommandQueueClient &)
TUint MhcqMaxHciCommandTimeout ()
TAny * MhcqQdpPluginInterface ( TUid )
void MhcqRemoveAllCommands (const MHCICommandQueueClient &)
TInt MhcqRemoveCommand ( TUint , const MHCICommandQueueClient &)
IMPORT_C CHCICmdQController * NewL ()
IMPORT_C void Reset ()
IMPORT_C void SetHCICommandAllocator ( MHCICommandAllocator &)
IMPORT_C void SetHCIUnmatchedEventObserver ( MHCICommandQueueClient &)
IMPORT_C void SetHCTLInterface ( MHCTLInterface &)
IMPORT_C void SetHardResetInitiator ( MHardResetInitiator &)
IMPORT_C void SetLinkMuxNotifier ( MLinkMuxNotifier &)
IMPORT_C void SetPhysicalLinksState (const MPhysicalLinksState &)
IMPORT_C void Start ()
void StarvationTimeoutFired ( TUint )
Private Member Functions
CHCICmdQController ()
TDblQue < CHCICommandQItem > * ActiveRegularQueue ()
TBool AnyCmdsToSend ()
TInt AsyncCallBackForReset ( TAny *)
TInt AsyncCallBackForSend ( TAny *)
TBool Blocked ( TUint , TUint )
TBool Blocked ( TUint , TUint , TUint )
TBool CanAddCommands ()
void CleanUpQueue ( TDblQueIter < CHCICommandQItem >)
void ClearBlock ( TUint )
TUint CmdBypassBlocks (const CHCICommandQItem &)
TBool CmdsQueued ( TDblQue < CHCICommandQItem > *)
void ConstructL ()
void DeleteCommand ( CHCICommandQItem *&)
TUint DoAddCommandL ( CHCICommandQItem &, TDblQue < CHCICommandQItem > &, TCmdQControllerStates )
void DoReset ()
CHCICommandQItem * FirstQueueItem ( TDblQue < CHCICommandQItem > &)
void HandleCommandRemoval ( CHCICommandQItem &, TBool )
void HandleCommandRemoval ( CHCICommandQItem *&, TBool )
TUint InvalidBlocks ( TUint )
CHCICommandQItem * LastQueueItem ( TDblQue < CHCICommandQItem > &)
void MhceoEventNotification (const THCIEventBase &)
CHCICommandQItem * MhcquiFindOutstandingCommand ( THCIOpcode )
void MhcquiInjectEvent (const THCIEventBase &)
TBool NextCommandChanged (const TDblQue < CHCICommandQItem > &)
TUint NextCommandQueueItemId ()
TBool OkToSendCommand ( CHCICommandQItem *&, TUint )
void ProcessCommandCompletionTimeout ( CHCICommandQItem *)
void ProcessEvent (const THCIEventBase &, TBool )
void ProcessMatchedErrorEvent (const THCIEventBase &, CHCICommandQItem *, TBool , TBool )
void ProcessMatchedEvent (const THCIEventBase &, CHCICommandQItem *, TBool )
TBool ProcessPriorityQueue ()
void ProcessRegularQueue ( TDblQue < CHCICommandQItem > &)
TBool ProcessResendQueue ()
void ProcessUnmatchedEvent (const THCIEventBase &, TBool )
TBool ProcessWorkaroundQueue ()
void PurgeAllQueues ()
void PurgeQueue ( TDblQue < CHCICommandQItem > &, CHCICommandQItem *)
TDblQue < CHCICommandQItem > * QueueSendingNext ()
void RemoveAllCommands ( TDblQueIter < CHCICommandQItem >, const MHCICommandQueueClient &, TBool )
CHCICommandQItem * ScanQueueByOpcode ( TDblQue < CHCICommandQItem > &, THCIOpcode )
CHCICommandQItem * ScanQueueByQId ( TDblQue < CHCICommandQItem > &, TUint )
void SendCommand ( CHCICommandQItem &)
void SetBlock ( TUint )
void SetUpNextWorkaroundCmd ( CHCICommandQItem *, const THCIEventBase *)
void StorePurgeMarks ()
void TryToSend ()
void UpdateCommandCredits ( TUint8 )
void UpdateStarvationTimer ()
TUint ValidBlocks ( TUint )
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Private Member Enumerations
enum anonymous {
ENoBlocks  = 0x00000000, EWorkaroundBlock  = 0x00000001, ECanSendBlock  = 0x00000002, EDuplicatedOpcodeBlock  = 0x00000004, EInsufficientCreditBlock  = 0x00000008, EResendBlock  = 0x00000010, ETryToSendBlock  = 0x00000020, EAllBlocks  = EWorkaroundBlock | ECanSendBlock | EDuplicatedOpcodeBlock | EInsufficientCreditBlock | EResendBlock | ETryToSendBlock, ECachingCommandBlocks  = ECanSendBlock | EDuplicatedOpcodeBlock | EInsufficientCreditBlock, ESendQueueBlocks  = EAllBlocks & ~EResendBlock, EResendQueueBlocks  = EAllBlocks & ~EWorkaroundBlock
}
enum TCmdQControllerStates { EUninitialised  = 0, EResetting  = 1, EResetInit  = 2, EInitialising  = 3, EStarted  = 4 }
Private Attributes
const TUint KDefaultMaxHciCommandTimeout
CAsyncCallBack * iAsyncCallBackForReset
CAsyncCallBack * iAsyncCallBackForSend
TCmdQControllerStates iCmdQControllerState
MHCICommandAllocator * iCommandAllocator
TUint8 iCommandCredits
TUint iCommandQState
MHardResetInitiator * iHardResetInitiator
CHciUtil * iHciUtil
MHCTLInterface * iHctl
TDblQue < CHCICommandQItem > iInitCommandQ
CHCICommandQItem * iInitQPurgeMark
MLinkMuxNotifier * iLinkMuxer
TUint iMaxHciCommandTimeout
TUint iNextCommandQItemId
TDblQue < CHCICommandQItem > iNormalCommandQ
CHCICommandQItem * iNormalQPurgeMark
CHCICommandQItem * iParentCommand
TDblQue < CHCICommandQItem > iPriorityCommandQ
CHCICommandQItem * iPriorityQPurgeMark
CHCICmdQStarvationTimer * iQStarvationTimer
MHCICmdQueueDecisionInterface * iQdp
MHCICmdQueueEventModifierInterface * iQdpEventModifier
CHCICmdQueueDecisionPlugin * iQdpPlugin
TUint iQueueStarvationTimeout
TDblQue < CHCICommandQItem > iResendCommandQ
CHCICommandQItem * iSendingCommand
TDblQue < CHCICommandQItem > iSentCommandQ
MHCICommandQueueClient * iUnmatchedEventObserver
TDblQue < CHCICommandQItem > iWorkaroundCommandQ
CHCICommandQItem * iWorkaroundQPurgeMark

Constructor & Destructor Documentation

CHCICmdQController()

CHCICmdQController ( ) [private]

Constructor.

~CHCICmdQController()

IMPORT_C ~CHCICmdQController ( )

Destructor.

Member Functions Documentation

ActiveRegularQueue()

TDblQue < CHCICommandQItem > * ActiveRegularQueue ( ) [private, inline]

Selects the active command queue (iNormalCommandQ or iInitCommandQ) based on current state.

AnyCmdsToSend()

TBool AnyCmdsToSend ( ) [private, inline]

Tests if there are items queued on any of the queues active in current state.

AsyncCallBackForReset(TAny *)

TInt AsyncCallBackForReset ( TAny * aCmdQController ) [private, static]

Parameters

TAny * aCmdQController

AsyncCallBackForSend(TAny *)

TInt AsyncCallBackForSend ( TAny * aCmdQController ) [private, static]

Parameters

TAny * aCmdQController

Blocked(TUint, TUint)

TBool Blocked ( TUint aBlocksToCheck,
TUint aBlocksToBypass
) [private, inline]

Tests for the specified TQueueStateBits block(s) being set.

Parameters

TUint aBlocksToCheck
TUint aBlocksToBypass

Blocked(TUint, TUint, TUint)

TBool Blocked ( TUint aBlockStatus,
TUint aBlocksToCheck,
TUint aBlocksToBypass
) [private, inline]

Tests for the specified TQueueStateBits block(s) being set.

Parameters

TUint aBlockStatus
TUint aBlocksToCheck
TUint aBlocksToBypass

CanAddCommands()

TBool CanAddCommands ( ) [private, inline]

Returns ETrue if our current state allows commands to be queued.

CleanUpQueue(TDblQueIter< CHCICommandQItem >)

void CleanUpQueue ( TDblQueIter < CHCICommandQItem > aIter ) [private]

ClearBlock(TUint)

void ClearBlock ( TUint aBlocks ) [private, inline]

Clears the specified TQueueStateBits block(s).

Parameters

TUint aBlocks

CmdBypassBlocks(const CHCICommandQItem &)

TUint CmdBypassBlocks ( const CHCICommandQItem & aCmd ) [private, inline]

Check for queue block bypass conditions. Currently the only such condition is to allow a non-credit consuming command (e.g. the Number of Host Complete Packets command) to bypass the insufficient credits block.

Parameters

const CHCICommandQItem & aCmd

CmdsQueued(TDblQue< CHCICommandQItem > *)

TBool CmdsQueued ( TDblQue < CHCICommandQItem > * aQueue ) [private, inline]

Tests if there are items queued on the specified queue.

Parameters

TDblQue < CHCICommandQItem > * aQueue

CompletionTimeoutFired(TUint)

void CompletionTimeoutFired ( TUint aUncompletedCmdId ) [virtual]
This function is called when the timer for aUncompletedCmdId fires.
panic
ETimedOutCommandError if aUncompletedCmdId does not exist on the sent queue.

Parameters

TUint aUncompletedCmdId the ID of the uncompleted command.

ConstructL()

void ConstructL ( ) [private]

DeleteCommand(CHCICommandQItem *&)

void DeleteCommand ( CHCICommandQItem *& aItem ) [private]

Dequeues and deletes aItem from its queue.

Parameters

CHCICommandQItem *& aItem

DoAddCommandL(CHCICommandQItem &, TDblQue< CHCICommandQItem > &, TCmdQControllerStates)

TUint DoAddCommandL ( CHCICommandQItem & aQueItem,
TDblQue < CHCICommandQItem > & aQueue,
TCmdQControllerStates aActiveState
) [private]

The general command addition routine. Adds aQueItem to aQueue and schedules the command processing loop if current state is equal to aActiveState.

DoReset()

void DoReset ( ) [private]

Performs command queue EResetting state processing. EResetting state is reached by a call to CHCICmdQController::Reset() .

DoSend()

IMPORT_C void DoSend ( )

Called by CLinkMuxer only when the command sub-channel is open. This shall be as a result of this class calling MLinkMuxNotifier::TryToSend . Only one send should be sent during this function. If another command is suitable for sending then MLinkMuxNotifier::TryToSend should be called again to get permission to do the sending.

FirstQueueItem(TDblQue< CHCICommandQItem > &)

CHCICommandQItem * FirstQueueItem ( TDblQue < CHCICommandQItem > & aQueue ) [private, inline]

Returns the item at the head of the specified queue, or NULL if the queue is empty.

Parameters

TDblQue < CHCICommandQItem > & aQueue

HandleCommandRemoval(CHCICommandQItem &, TBool)

void HandleCommandRemoval ( CHCICommandQItem & aCmd,
TBool aCanDelete
) [private]

Parameters

CHCICommandQItem & aCmd
TBool aCanDelete

HandleCommandRemoval(CHCICommandQItem *&, TBool)

void HandleCommandRemoval ( CHCICommandQItem *& aCmd,
TBool aCanDelete
) [private]

Parameters

CHCICommandQItem *& aCmd
TBool aCanDelete

Initialise()

IMPORT_C void Initialise ( )

This allows the Command Queue to start accepting commands to be queued. Whilst in the Initialise state only Initialisation commands will be sent but other commands will be added to the Normal and Priority queues so they can be sent when we transition to the Started state. CHCICmdQController::Start

InvalidBlocks(TUint)

TUint InvalidBlocks ( TUint aBlocks ) [private, inline]

Masks out valid TQueueStateBits block bit(s).

Parameters

TUint aBlocks

LastQueueItem(TDblQue< CHCICommandQItem > &)

CHCICommandQItem * LastQueueItem ( TDblQue < CHCICommandQItem > & aQueue ) [private, inline]

Returns the item at the tail of the specified queue, or NULL if the queue is empty.

Parameters

TDblQue < CHCICommandQItem > & aQueue

MhceoEventNotification(const THCIEventBase &)

void MhceoEventNotification ( const THCIEventBase & aEvent ) [private, virtual]

Parameters

const THCIEventBase & aEvent

MhcqAddCommandL(CHCICommandQItem *)

TUint MhcqAddCommandL ( CHCICommandQItem * aQueItem ) [virtual]

Virtuals from MHCICommandQueue

Parameters

CHCICommandQItem * aQueItem

MhcqAddCommandL(CHCICommandBase *, MHCICommandQueueClient &)

TUint MhcqAddCommandL ( CHCICommandBase * aCommandData,
MHCICommandQueueClient & aCmdProgressRecipient
) [virtual]

Parameters

CHCICommandBase * aCommandData
MHCICommandQueueClient & aCmdProgressRecipient

MhcqAddInitCommandL(CHCICommandQItem *)

TUint MhcqAddInitCommandL ( CHCICommandQItem * aQueItem ) [virtual]

Parameters

CHCICommandQItem * aQueItem

MhcqAddInitCommandL(CHCICommandBase *, MHCICommandQueueClient &)

TUint MhcqAddInitCommandL ( CHCICommandBase * aCommandData,
MHCICommandQueueClient & aCmdProgressRecipient
) [virtual]

Parameters

CHCICommandBase * aCommandData
MHCICommandQueueClient & aCmdProgressRecipient

MhcqAddPriorityCommandL(CHCICommandQItem *)

TUint MhcqAddPriorityCommandL ( CHCICommandQItem * aQueItem ) [virtual]

Parameters

CHCICommandQItem * aQueItem

MhcqAddPriorityCommandL(CHCICommandBase *, MHCICommandQueueClient &)

TUint MhcqAddPriorityCommandL ( CHCICommandBase * aCommandData,
MHCICommandQueueClient & aCmdProgressRecipient
) [virtual]

Parameters

CHCICommandBase * aCommandData
MHCICommandQueueClient & aCmdProgressRecipient

MhcqMaxHciCommandTimeout()

TUint MhcqMaxHciCommandTimeout ( ) const [virtual]

MhcqQdpPluginInterface(TUid)

TAny * MhcqQdpPluginInterface ( TUid aUid ) const [virtual]

Parameters

TUid aUid

MhcqRemoveAllCommands(const MHCICommandQueueClient &)

void MhcqRemoveAllCommands ( const MHCICommandQueueClient & aCmdOriginator ) [virtual]

Parameters

const MHCICommandQueueClient & aCmdOriginator

MhcqRemoveCommand(TUint, const MHCICommandQueueClient &)

TInt MhcqRemoveCommand ( TUint aCommandId,
const MHCICommandQueueClient & aCmdOriginator
) [virtual]

Parameters

TUint aCommandId
const MHCICommandQueueClient & aCmdOriginator

MhcquiFindOutstandingCommand(THCIOpcode)

CHCICommandQItem * MhcquiFindOutstandingCommand ( THCIOpcode aOpcode ) [private]

Parameters

THCIOpcode aOpcode

MhcquiInjectEvent(const THCIEventBase &)

void MhcquiInjectEvent ( const THCIEventBase & aEvent ) [private]

Parameters

const THCIEventBase & aEvent

NewL()

IMPORT_C CHCICmdQController * NewL ( ) [static]

NextCommandChanged(const TDblQue< CHCICommandQItem > &)

TBool NextCommandChanged ( const TDblQue < CHCICommandQItem > & aQueue ) [private, inline]

Helper to be called on command addition. Returns ETrue if the command that will be sent next changed after we added a command to aQueue. Ignores the Resend queue.

Parameters

const TDblQue < CHCICommandQItem > & aQueue

NextCommandQueueItemId()

TUint NextCommandQueueItemId ( ) [private, inline]

Returns the next Command Queue Item Id

OkToSendCommand(CHCICommandQItem *&, TUint)

TBool OkToSendCommand ( CHCICommandQItem *& aCmdQItem,
TUint aBypassBlocks
) [private]

Evaluates various blocking conditions to determine if the command can be sent. aCmdQItem is passed by reference to pointer as it can be deleted and NULLified in case of error.

Parameters

CHCICommandQItem *& aCmdQItem
TUint aBypassBlocks

ProcessCommandCompletionTimeout(CHCICommandQItem *)

void ProcessCommandCompletionTimeout ( CHCICommandQItem * aCmd ) [private]

Processes timed out commands.

Parameters

CHCICommandQItem * aCmd

ProcessEvent(const THCIEventBase &, TBool)

void ProcessEvent ( const THCIEventBase & aEvent,
TBool aSendToQdp
) [private]

Parameters

const THCIEventBase & aEvent
TBool aSendToQdp

ProcessMatchedErrorEvent(const THCIEventBase &, CHCICommandQItem *, TBool, TBool)

void ProcessMatchedErrorEvent ( const THCIEventBase & aEvent,
CHCICommandQItem * aCmd,
TBool aConcludesCmd,
TBool aSendToQdp
) [private]

Process matched error events.

Parameters

const THCIEventBase & aEvent
CHCICommandQItem * aCmd
TBool aConcludesCmd
TBool aSendToQdp

ProcessMatchedEvent(const THCIEventBase &, CHCICommandQItem *, TBool)

void ProcessMatchedEvent ( const THCIEventBase & aEvent,
CHCICommandQItem * aCmd,
TBool aConcludesCmd
) [private]

Process matched non-error events.

Parameters

const THCIEventBase & aEvent
CHCICommandQItem * aCmd
TBool aConcludesCmd

ProcessPriorityQueue()

TBool ProcessPriorityQueue ( ) [private]

Processes the priority queue. Returns ETrue if the scheduling loop shouldn't process lower priority queues (which is when the queue is non-empty) and EFalse if the loop should go on.

ProcessRegularQueue(TDblQue< CHCICommandQItem > &)

void ProcessRegularQueue ( TDblQue < CHCICommandQItem > & aQueue ) [private]

Processes a regular queue - normal or initialization command queue.

Parameters

TDblQue < CHCICommandQItem > & aQueue

ProcessResendQueue()

TBool ProcessResendQueue ( ) [private]

Processes the resend queue. Returns ETrue if the scheduling loop shouldn't process lower priority queues (which is when it schedules a command for resend) and EFalse if the loop should go on.

ProcessUnmatchedEvent(const THCIEventBase &, TBool)

void ProcessUnmatchedEvent ( const THCIEventBase & aEvent,
TBool aSendToQdp
) [private]

Processes unmatched events.

Parameters

const THCIEventBase & aEvent
TBool aSendToQdp

ProcessWorkaroundQueue()

TBool ProcessWorkaroundQueue ( ) [private]

Processes the workaround queue. Returns ETrue if the scheduling loop shouldn't process lower priority queues (which is when the queue is non-empty) and EFalse if the loop should go on.

PurgeAllQueues()

void PurgeAllQueues ( ) [private, inline]

Purge the queues up to previously saved purge marks.

PurgeQueue(TDblQue< CHCICommandQItem > &, CHCICommandQItem *)

void PurgeQueue ( TDblQue < CHCICommandQItem > & aQueue,
CHCICommandQItem * aMark
) [private]

Removes and deletes items from the head of the queue up to and including the marked item.

Parameters

TDblQue < CHCICommandQItem > & aQueue
CHCICommandQItem * aMark

QueueSendingNext()

TDblQue < CHCICommandQItem > * QueueSendingNext ( ) [private, inline]

Returns the pointer to the queue which contains the command that would be scheduled next. Does not take the Resend queue into account.

RemoveAllCommands(TDblQueIter< CHCICommandQItem >, const MHCICommandQueueClient &, TBool)

void RemoveAllCommands ( TDblQueIter < CHCICommandQItem > aIter,
const MHCICommandQueueClient & aCmdOriginator,
TBool aCanDelete
) [private]

Parameters

TDblQueIter < CHCICommandQItem > aIter
const MHCICommandQueueClient & aCmdOriginator
TBool aCanDelete

Reset()

IMPORT_C void Reset ( )

Initiates an asynchronous request for reset processing on the command queue. Asynchronous reset processing is performed by CHCICmdQController::DoReset() , to empty the command queue and perform any other tasks on the Command Queue when the stack requests a sub-system reset. This will put the Command Queue into a state where no commands can be sent until CHCICmdQController::Initialise() is called. CHCICmdQController::Initialise

ScanQueueByOpcode(TDblQue< CHCICommandQItem > &, THCIOpcode)

CHCICommandQItem * ScanQueueByOpcode ( TDblQue < CHCICommandQItem > & aQueue,
THCIOpcode aOpcode
) [private, inline]

Returns the first item with the specified opcode which is closest to the head of the specified queue, or NULL if there is no such opcode on the queue.

Parameters

TDblQue < CHCICommandQItem > & aQueue
THCIOpcode aOpcode

ScanQueueByQId(TDblQue< CHCICommandQItem > &, TUint)

CHCICommandQItem * ScanQueueByQId ( TDblQue < CHCICommandQItem > & aQueue,
TUint aCmdId
) [private, inline]

Returns the item with the specified command queue ID from the specified queue, or NULL if there is no such command on the queue.

Parameters

TDblQue < CHCICommandQItem > & aQueue
TUint aCmdId

SendCommand(CHCICommandQItem &)

void SendCommand ( CHCICommandQItem & aCmdQItem ) [private]

Submits a request to the link muxer for permission to send a command.

Parameters

CHCICommandQItem & aCmdQItem

SetBlock(TUint)

void SetBlock ( TUint aBlocks ) [private, inline]

Sets the specified TQueueStateBits block(s).

Parameters

TUint aBlocks

SetHCICommandAllocator(MHCICommandAllocator &)

IMPORT_C void SetHCICommandAllocator ( MHCICommandAllocator & aCommandAllocator )

Sets the HCI Command Allocator interface instance to be used by the Command Queue Controller to create HCI command frames.

Parameters

MHCICommandAllocator & aCommandAllocator Implementation of command allocator interface.

SetHCIUnmatchedEventObserver(MHCICommandQueueClient &)

IMPORT_C void SetHCIUnmatchedEventObserver ( MHCICommandQueueClient & aUnmatchedEventObserver )

Sets the command queue client that will subsequently receive unmatched events.

Parameters

MHCICommandQueueClient & aUnmatchedEventObserver An instance implementing the command queue client interface.

SetHCTLInterface(MHCTLInterface &)

IMPORT_C void SetHCTLInterface ( MHCTLInterface & aHctlInterface )

Sets the HCTL interface instance to be used by the Command Queue Controller to send command frames over the HCTL.

Parameters

MHCTLInterface & aHctlInterface An instance implementing the interface to the HCTL.

SetHardResetInitiator(MHardResetInitiator &)

IMPORT_C void SetHardResetInitiator ( MHardResetInitiator & aHardResetInitiator )

Sets the Hard Reset Initiator interface instance to be used by the QDP. This will allow the QDP to request a Hard Reset.

Parameters

MHardResetInitiator & aHardResetInitiator An instance implementing the interface to the Hard Reset Initiator.

SetLinkMuxNotifier(MLinkMuxNotifier &)

IMPORT_C void SetLinkMuxNotifier ( MLinkMuxNotifier & aLinkMuxer )

Sets the Link Mux Notifier interface instance to be used by the Command Queue Controller to provide co-ordinated sending to the HCTL.

Parameters

MLinkMuxNotifier & aLinkMuxer An instance implementing the interface to the Link Muxer.

SetPhysicalLinksState(const MPhysicalLinksState &)

IMPORT_C void SetPhysicalLinksState ( const MPhysicalLinksState & aStackInfo )

Sets the physical links state interface instance to be used by the QDP to query the state of physical links in the stack..

Parameters

const MPhysicalLinksState & aStackInfo An instance implementing the interface to the physical links state information.

SetUpNextWorkaroundCmd(CHCICommandQItem *, const THCIEventBase *)

void SetUpNextWorkaroundCmd ( CHCICommandQItem * aPreviousCmd,
const THCIEventBase * aPreviousCmdResult
) [private]

Process workaround related commands, and is invoked every time a workaround completes. As the QDP interface needs to be passed the concluding event of each workaround command, and events are used synchronously and have a limited lifetime, this means workaround handling has to be done at the same time as the event processing.

This processing ensures that the head of the workaround queue contains the next command in the workaround. It also tidies up and deletes commands as necessary. Child commands are deleted once their events have been reported to the QDP. The parent command lives until the end of the workaround.

Parameters

CHCICommandQItem * aPreviousCmd
const THCIEventBase * aPreviousCmdResult

Start()

IMPORT_C void Start ( )
Signals that the Stack has finished intialising the HCI, and that it is safe to send normal (non-initialisation) commands. Trying to add intialisation commands after this call will result in a panic. CHCICmdQController::Reset
panic
EInvalidStateTransition if not in the initialising state.
panic
EStartCalledWhenInitQNotEmpty if the method is called when the initialisation queue is not empty.
panic
EObjectNotInitialised if not all inteface references have been populated.

StarvationTimeoutFired(TUint)

void StarvationTimeoutFired ( TUint aWasNextPendingCmdId ) [virtual]
panic
ECanSendDeadlock as a guard against a CanSend block deadlock in UDEB builds. In UREL builds, MHardResetInitiator::MhriStartHardReset will be called.
panic
EResendDeadlock as a guard against a Resend block deadlock in UDEB builds. In UREL builds, MHardResetInitiator::MhriStartHardReset will be called.
panic
EUnknownDeadlock as a guard against priority queue deadlock in UDEB builds, i.e. the priority queue hasn't changed at all. In UREL builds, MHardResetInitiator::MhriStartHardReset will be called.

Parameters

TUint aWasNextPendingCmdId

StorePurgeMarks()

void StorePurgeMarks ( ) [private, inline]

Saves the purge marks for the queues that need them. When a reset is performed, the queues will be purged up to those marks.

TryToSend()

void TryToSend ( ) [private]

The main queue processing routine. Schedules the next command and asks HCTL to send.

UpdateCommandCredits(TUint8)

void UpdateCommandCredits ( TUint8 aCommandCredits ) [private, inline]

Updates the command credits counter and maintains the EInsufficientCreditBlock

Parameters

TUint8 aCommandCredits

UpdateStarvationTimer()

void UpdateStarvationTimer ( ) [private]

A helper for restarting the Starvation Timer during command addition/sendout. Determines the next command that will be sent and restarts the timer with the ID of that command. Caveat: this always restarts (or cancels, hence Update rather than just Restart in the name) the timer, so use it only when you know that the command that will be sent next has really changed.

ValidBlocks(TUint)

TUint ValidBlocks ( TUint aBlocks ) [private, inline]

Masks out invalid TQueueStateBits block bit(s).

Parameters

TUint aBlocks

Member Enumerations Documentation

Enum anonymous

Command queue block bit flags.

Enumerators

ENoBlocks = 0x00000000
EWorkaroundBlock = 0x00000001

Indicates that there is a workaround command on the sent queue, so another command cannot be sent

ECanSendBlock = 0x00000002

Indicates the current head of the non-priority queues has been blocked from MHCICmdQueueDecisionInterface::MhcqdiCanSend()

EDuplicatedOpcodeBlock = 0x00000004

Indicates that the current head of the non-priority queues has the same opcode as one on the sent queue.

EInsufficientCreditBlock = 0x00000008

Indicates that the current head of the non-priority queues does not have enough HCI credits.

EResendBlock = 0x00000010

Indicates that there is a resent command on the sent queue, so another command cannot be resent.

ETryToSendBlock = 0x00000020

Indicates that an HCTL send request ( MLinkMuxNotifier::TryToSend ) is in progress, so another command cannot be scheduled until we get a DoSend() callback.

EAllBlocks = EWorkaroundBlock | ECanSendBlock | EDuplicatedOpcodeBlock | EInsufficientCreditBlock | EResendBlock | ETryToSendBlock
ECachingCommandBlocks = ECanSendBlock | EDuplicatedOpcodeBlock | EInsufficientCreditBlock

These three are different from the TryToSend, Resend and Workaround blocks in that they only cache the effect of the last call to OkToSendCommand for the most recently processed non-priority command. This means that when they're all 0, OkToSendCommand needs to be called to re-evaluate corresponding conditions.

ESendQueueBlocks = EAllBlocks & ~EResendBlock

Do not include the Resend block for any of the queues waiting to send a command for the first time. Regardless of whether the Resend block is set we would need a credit to send a command and if we get more than one credit (the first potentially being used by a resent command) then we should use them.

EResendQueueBlocks = EAllBlocks & ~EWorkaroundBlock

For the Resend queue we do not want to include the Workaround block as it maybe a workaround command being resent.

Enum TCmdQControllerStates

Command queue controller state

Enumerators

EUninitialised = 0

Power down state state. In this state no commands will be sent or queued. Any attempt to queue a new command will fail.

Reached on completion of async Reset() if in EResetting state.

EResetting = 1

Asynchronous reset pending state.

Reached by calling Reset() .

EResetInit = 2

Asynchronous reset pending state.

Reached by calling Initialise() while async Reset() outstanding.

EInitialising = 3

Initialisation state. In this state only initilisation commands will be sent, normal and priority commands are held on their queues.

Reached by Initialise() or completion of async Reset() if in EResetInit state.

EStarted = 4

Operational state.

Reached by calling Start() .

Member Data Documentation

const TUint KDefaultMaxHciCommandTimeout

const TUint KDefaultMaxHciCommandTimeout [private, static]

CAsyncCallBack * iAsyncCallBackForReset

CAsyncCallBack * iAsyncCallBackForReset [private]

Async Callbacks

CAsyncCallBack * iAsyncCallBackForSend

CAsyncCallBack * iAsyncCallBackForSend [private]

TCmdQControllerStates iCmdQControllerState

TCmdQControllerStates iCmdQControllerState [private]

The CHCICmdQController state variable

MHCICommandAllocator * iCommandAllocator

MHCICommandAllocator * iCommandAllocator [private]

TUint8 iCommandCredits

TUint8 iCommandCredits [private]

Number of HCI command packets the queue controller can send to the HCI. This corresponds to the Num_HCI_Command_Packets event parameter. This is decremented whenever a command is sent to the HCTL, and is updated on receipt of Command Status and Command Complete (including NOP) events.

TUint iCommandQState

TUint iCommandQState [private]

This is a bit mask of the possible TQueueStateBits states

MHardResetInitiator * iHardResetInitiator

MHardResetInitiator * iHardResetInitiator [private]

CHciUtil * iHciUtil

CHciUtil * iHciUtil [private]

HCI Utility library

MHCTLInterface * iHctl

MHCTLInterface * iHctl [private]

TDblQue< CHCICommandQItem > iInitCommandQ

TDblQue < CHCICommandQItem > iInitCommandQ [private]

The queue of initialisation commands that have not yet been processed.

CHCICommandQItem * iInitQPurgeMark

CHCICommandQItem * iInitQPurgeMark [private]

Recorded tails of the queues for Reset processing.

MLinkMuxNotifier * iLinkMuxer

MLinkMuxNotifier * iLinkMuxer [private]

TUint iMaxHciCommandTimeout

TUint iMaxHciCommandTimeout [private]

TUint iNextCommandQItemId

TUint iNextCommandQItemId [private]

A counter generating IDs to uniquely identify commands.

TDblQue< CHCICommandQItem > iNormalCommandQ

TDblQue < CHCICommandQItem > iNormalCommandQ [private]

The queue of normal commands that have not yet been processed.

CHCICommandQItem * iNormalQPurgeMark

CHCICommandQItem * iNormalQPurgeMark [private]

CHCICommandQItem * iParentCommand

CHCICommandQItem * iParentCommand [private]

Currently processing parent command. This is maintained to simplify priority command processing while a workaround is in progress, and to ensure that the parent's iQdpData is available to the QDP until the workaround completes.

TDblQue< CHCICommandQItem > iPriorityCommandQ

TDblQue < CHCICommandQItem > iPriorityCommandQ [private]

The queue of priority commands that have not yet been processed. Note: it's not FIFO - the order of execution of commands is determined dynamically.

CHCICommandQItem * iPriorityQPurgeMark

CHCICommandQItem * iPriorityQPurgeMark [private]

CHCICmdQStarvationTimer * iQStarvationTimer

CHCICmdQStarvationTimer * iQStarvationTimer [private]

This timer gets reset every time the next command to send changes. If that command stays the same for too long, we probably have a deadlock of some sorts.

MHCICmdQueueDecisionInterface * iQdp

MHCICmdQueueDecisionInterface * iQdp [private]

MHCICmdQueueEventModifierInterface * iQdpEventModifier

MHCICmdQueueEventModifierInterface * iQdpEventModifier [private]

CHCICmdQueueDecisionPlugin * iQdpPlugin

CHCICmdQueueDecisionPlugin * iQdpPlugin [private]

The QDP that the Command Queue will use.

TUint iQueueStarvationTimeout

TUint iQueueStarvationTimeout [private]

TDblQue< CHCICommandQItem > iResendCommandQ

TDblQue < CHCICommandQItem > iResendCommandQ [private]

The queue of commands that are waiting to be re-sent to the controller.

CHCICommandQItem * iSendingCommand

CHCICommandQItem * iSendingCommand [private]

Currently processing send command. This is maintained to ensure both that the correct command is processed by DoSend, and that there is only ever one outstanding call to MLinkMuxNotifier::TryToSend at any given time

TDblQue< CHCICommandQItem > iSentCommandQ

TDblQue < CHCICommandQItem > iSentCommandQ [private]

The queue of commands that have been sent to the controller but have not yet had a response.

MHCICommandQueueClient * iUnmatchedEventObserver

MHCICommandQueueClient * iUnmatchedEventObserver [private]

TDblQue< CHCICommandQItem > iWorkaroundCommandQ

TDblQue < CHCICommandQItem > iWorkaroundCommandQ [private]

The queue of workarounds for commands on the other queues. A command is moved here when time comes to execute it but QDP deems it to be in need of workaround.

CHCICommandQItem * iWorkaroundQPurgeMark

CHCICommandQItem * iWorkaroundQPurgeMark [private]