CHCICmdQController Class Reference

class CHCICmdQController : public CBase

Inherits from

Public Member Functions
~CHCICmdQController()
voidCompletionTimeoutFired(TUint)
IMPORT_C voidDoSend()
IMPORT_C voidInitialise()
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)
voidMhcqRemoveAllCommands(const MHCICommandQueueClient &)
TInt MhcqRemoveCommand(TUint, const MHCICommandQueueClient &)
IMPORT_C CHCICmdQController *NewL()
IMPORT_C voidReset()
IMPORT_C voidSetHCICommandAllocator(MHCICommandAllocator &)
IMPORT_C voidSetHCIUnmatchedEventObserver(MHCICommandQueueClient &)
IMPORT_C voidSetHCTLInterface(MHCTLInterface &)
IMPORT_C voidSetHardResetInitiator(MHardResetInitiator &)
IMPORT_C voidSetLinkMuxNotifier(MLinkMuxNotifier &)
IMPORT_C voidSetPhysicalLinksState(const MPhysicalLinksState &)
IMPORT_C voidStart()
voidStarvationTimeoutFired(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()
voidCleanUpQueue(TDblQueIter< CHCICommandQItem >)
voidClearBlock(TUint)
TUint CmdBypassBlocks(const CHCICommandQItem &)
TBool CmdsQueued(TDblQue< CHCICommandQItem > *)
voidConstructL()
voidDeleteCommand(CHCICommandQItem *&)
TUint DoAddCommandL(CHCICommandQItem &, TDblQue< CHCICommandQItem > &, TCmdQControllerStates)
voidDoReset()
CHCICommandQItem *FirstQueueItem(TDblQue< CHCICommandQItem > &)
voidHandleCommandRemoval(CHCICommandQItem &, TBool)
voidHandleCommandRemoval(CHCICommandQItem *&, TBool)
TUint InvalidBlocks(TUint)
CHCICommandQItem *LastQueueItem(TDblQue< CHCICommandQItem > &)
voidMhceoEventNotification(const THCIEventBase &)
CHCICommandQItem *MhcquiFindOutstandingCommand(THCIOpcode)
voidMhcquiInjectEvent(const THCIEventBase &)
TBool NextCommandChanged(const TDblQue< CHCICommandQItem > &)
TUint NextCommandQueueItemId()
TBool OkToSendCommand(CHCICommandQItem *&, TUint)
voidProcessCommandCompletionTimeout(CHCICommandQItem *)
voidProcessEvent(const THCIEventBase &, TBool)
voidProcessMatchedErrorEvent(const THCIEventBase &, CHCICommandQItem *, TBool, TBool)
voidProcessMatchedEvent(const THCIEventBase &, CHCICommandQItem *, TBool)
TBool ProcessPriorityQueue()
voidProcessRegularQueue(TDblQue< CHCICommandQItem > &)
TBool ProcessResendQueue()
voidProcessUnmatchedEvent(const THCIEventBase &, TBool)
TBool ProcessWorkaroundQueue()
voidPurgeAllQueues()
voidPurgeQueue(TDblQue< CHCICommandQItem > &, CHCICommandQItem *)
TDblQue< CHCICommandQItem > *QueueSendingNext()
voidRemoveAllCommands(TDblQueIter< CHCICommandQItem >, const MHCICommandQueueClient &, TBool)
CHCICommandQItem *ScanQueueByOpcode(TDblQue< CHCICommandQItem > &, THCIOpcode)
CHCICommandQItem *ScanQueueByQId(TDblQue< CHCICommandQItem > &, TUint)
voidSendCommand(CHCICommandQItem &)
voidSetBlock(TUint)
voidSetUpNextWorkaroundCmd(CHCICommandQItem *, const THCIEventBase *)
voidStorePurgeMarks()
voidTryToSend()
voidUpdateCommandCredits(TUint8)
voidUpdateStarvationTimer()
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
enumanonymous {
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
}
enumTCmdQControllerStates { EUninitialised = 0, EResetting = 1, EResetInit = 2, EInitialising = 3, EStarted = 4 }
Private Attributes
const TUintKDefaultMaxHciCommandTimeout
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(TUintaBlocksToCheck,
TUintaBlocksToBypass
)[private, inline]

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

Parameters

TUint aBlocksToCheck
TUint aBlocksToBypass

Blocked(TUint, TUint, TUint)

TBool Blocked(TUintaBlockStatus,
TUintaBlocksToCheck,
TUintaBlocksToBypass
)[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 >)

voidCleanUpQueue(TDblQueIter< CHCICommandQItem >aIter)[private]

Parameters

TDblQueIter< CHCICommandQItem > aIter

ClearBlock(TUint)

voidClearBlock(TUintaBlocks)[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)

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

Parameters

TUint aUncompletedCmdIdthe ID of the uncompleted command.

ConstructL()

voidConstructL()[private]

DeleteCommand(CHCICommandQItem *&)

voidDeleteCommand(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,
TCmdQControllerStatesaActiveState
)[private]

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

Parameters

CHCICommandQItem & aQueItem
TDblQue< CHCICommandQItem > & aQueue
TCmdQControllerStates aActiveState

DoReset()

voidDoReset()[private]

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

DoSend()

IMPORT_C voidDoSend()

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)

voidHandleCommandRemoval(CHCICommandQItem &aCmd,
TBoolaCanDelete
)[private]

Parameters

CHCICommandQItem & aCmd
TBool aCanDelete

HandleCommandRemoval(CHCICommandQItem *&, TBool)

voidHandleCommandRemoval(CHCICommandQItem *&aCmd,
TBoolaCanDelete
)[private]

Parameters

CHCICommandQItem *& aCmd
TBool aCanDelete

Initialise()

IMPORT_C voidInitialise()

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(TUintaBlocks)[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 &)

voidMhceoEventNotification(const THCIEventBase &aEvent)[private, virtual]

Virtuals from MHCICommandEventObserver

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(TUidaUid)const [virtual]

Parameters

TUid aUid

MhcqRemoveAllCommands(const MHCICommandQueueClient &)

voidMhcqRemoveAllCommands(const MHCICommandQueueClient &aCmdOriginator)[virtual]

Parameters

const MHCICommandQueueClient & aCmdOriginator

MhcqRemoveCommand(TUint, const MHCICommandQueueClient &)

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

Parameters

TUint aCommandId
const MHCICommandQueueClient & aCmdOriginator

MhcquiFindOutstandingCommand(THCIOpcode)

CHCICommandQItem *MhcquiFindOutstandingCommand(THCIOpcodeaOpcode)[private]

Parameters

THCIOpcode aOpcode

MhcquiInjectEvent(const THCIEventBase &)

voidMhcquiInjectEvent(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,
TUintaBypassBlocks
)[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 *)

voidProcessCommandCompletionTimeout(CHCICommandQItem *aCmd)[private]

Processes timed out commands.

Parameters

CHCICommandQItem * aCmd

ProcessEvent(const THCIEventBase &, TBool)

voidProcessEvent(const THCIEventBase &aEvent,
TBoolaSendToQdp
)[private]

Parameters

const THCIEventBase & aEvent
TBool aSendToQdp

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

voidProcessMatchedErrorEvent(const THCIEventBase &aEvent,
CHCICommandQItem *aCmd,
TBoolaConcludesCmd,
TBoolaSendToQdp
)[private]

Process matched error events.

Parameters

const THCIEventBase & aEvent
CHCICommandQItem * aCmd
TBool aConcludesCmd
TBool aSendToQdp

ProcessMatchedEvent(const THCIEventBase &, CHCICommandQItem *, TBool)

voidProcessMatchedEvent(const THCIEventBase &aEvent,
CHCICommandQItem *aCmd,
TBoolaConcludesCmd
)[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 > &)

voidProcessRegularQueue(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)

voidProcessUnmatchedEvent(const THCIEventBase &aEvent,
TBoolaSendToQdp
)[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()

voidPurgeAllQueues()[private, inline]

Purge the queues up to previously saved purge marks.

PurgeQueue(TDblQue< CHCICommandQItem > &, CHCICommandQItem *)

voidPurgeQueue(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)

voidRemoveAllCommands(TDblQueIter< CHCICommandQItem >aIter,
const MHCICommandQueueClient &aCmdOriginator,
TBoolaCanDelete
)[private]

Parameters

TDblQueIter< CHCICommandQItem > aIter
const MHCICommandQueueClient & aCmdOriginator
TBool aCanDelete

Reset()

IMPORT_C voidReset()

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,
THCIOpcodeaOpcode
)[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,
TUintaCmdId
)[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 &)

voidSendCommand(CHCICommandQItem &aCmdQItem)[private]

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

Parameters

CHCICommandQItem & aCmdQItem

SetBlock(TUint)

voidSetBlock(TUintaBlocks)[private, inline]

Sets the specified TQueueStateBits block(s).

Parameters

TUint aBlocks

SetHCICommandAllocator(MHCICommandAllocator &)

IMPORT_C voidSetHCICommandAllocator(MHCICommandAllocator &aCommandAllocator)

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

Parameters

MHCICommandAllocator & aCommandAllocatorImplementation of command allocator interface.

SetHCIUnmatchedEventObserver(MHCICommandQueueClient &)

IMPORT_C voidSetHCIUnmatchedEventObserver(MHCICommandQueueClient &aUnmatchedEventObserver)

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

Parameters

MHCICommandQueueClient & aUnmatchedEventObserverAn instance implementing the command queue client interface.

SetHCTLInterface(MHCTLInterface &)

IMPORT_C voidSetHCTLInterface(MHCTLInterface &aHctlInterface)

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

Parameters

MHCTLInterface & aHctlInterfaceAn instance implementing the interface to the HCTL.

SetHardResetInitiator(MHardResetInitiator &)

IMPORT_C voidSetHardResetInitiator(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 & aHardResetInitiatorAn instance implementing the interface to the Hard Reset Initiator.

SetLinkMuxNotifier(MLinkMuxNotifier &)

IMPORT_C voidSetLinkMuxNotifier(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 & aLinkMuxerAn instance implementing the interface to the Link Muxer.

SetPhysicalLinksState(const MPhysicalLinksState &)

IMPORT_C voidSetPhysicalLinksState(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 & aStackInfoAn instance implementing the interface to the physical links state information.

SetUpNextWorkaroundCmd(CHCICommandQItem *, const THCIEventBase *)

voidSetUpNextWorkaroundCmd(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 voidStart()
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)

voidStarvationTimeoutFired(TUintaWasNextPendingCmdId)[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()

voidStorePurgeMarks()[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()

voidTryToSend()[private]

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

UpdateCommandCredits(TUint8)

voidUpdateCommandCredits(TUint8aCommandCredits)[private, inline]

Updates the command credits counter and maintains the EInsufficientCreditBlock

Parameters

TUint8 aCommandCredits

UpdateStarvationTimer()

voidUpdateStarvationTimer()[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(TUintaBlocks)[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 TUintKDefaultMaxHciCommandTimeout[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]