class CHCICmdQController : public 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 } |
TDblQue < CHCICommandQItem > * | ActiveRegularQueue | ( | ) | [private, inline] |
Selects the active command queue (iNormalCommandQ or iInitCommandQ) based on current state.
TBool | AnyCmdsToSend | ( | ) | [private, inline] |
Tests if there are items queued on any of the queues active in current state.
TInt | AsyncCallBackForReset | ( | TAny * | aCmdQController | ) | [private, static] |
TAny * aCmdQController |
TInt | AsyncCallBackForSend | ( | TAny * | aCmdQController | ) | [private, static] |
TAny * aCmdQController |
TBool | Blocked | ( | TUint | aBlocksToCheck, |
TUint | aBlocksToBypass | |||
) | [private, inline] |
Tests for the specified TQueueStateBits block(s) being set.
TBool | Blocked | ( | TUint | aBlockStatus, |
TUint | aBlocksToCheck, | |||
TUint | aBlocksToBypass | |||
) | [private, inline] |
Tests for the specified TQueueStateBits block(s) being set.
TBool | CanAddCommands | ( | ) | [private, inline] |
Returns ETrue if our current state allows commands to be queued.
void | CleanUpQueue | ( | TDblQueIter < CHCICommandQItem > | aIter | ) | [private] |
TDblQueIter < CHCICommandQItem > aIter |
void | ClearBlock | ( | TUint | aBlocks | ) | [private, inline] |
Clears the specified TQueueStateBits block(s).
TUint aBlocks |
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.
const CHCICommandQItem & aCmd |
TBool | CmdsQueued | ( | TDblQue < CHCICommandQItem > * | aQueue | ) | [private, inline] |
Tests if there are items queued on the specified queue.
TDblQue < CHCICommandQItem > * aQueue |
void | CompletionTimeoutFired | ( | TUint | aUncompletedCmdId | ) | [virtual] |
TUint aUncompletedCmdId | the ID of the uncompleted command. |
void | DeleteCommand | ( | CHCICommandQItem *& | aItem | ) | [private] |
Dequeues and deletes aItem from its queue.
CHCICommandQItem *& aItem |
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.
CHCICommandQItem & aQueItem | |
TDblQue < CHCICommandQItem > & aQueue | |
TCmdQControllerStates aActiveState |
void | DoReset | ( | ) | [private] |
Performs command queue EResetting state processing. EResetting state is reached by a call to CHCICmdQController::Reset() .
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.
CHCICommandQItem * | FirstQueueItem | ( | TDblQue < CHCICommandQItem > & | aQueue | ) | [private, inline] |
Returns the item at the head of the specified queue, or NULL if the queue is empty.
TDblQue < CHCICommandQItem > & aQueue |
void | HandleCommandRemoval | ( | CHCICommandQItem & | aCmd, |
TBool | aCanDelete | |||
) | [private] |
CHCICommandQItem & aCmd | |
TBool aCanDelete |
void | HandleCommandRemoval | ( | CHCICommandQItem *& | aCmd, |
TBool | aCanDelete | |||
) | [private] |
CHCICommandQItem *& aCmd | |
TBool aCanDelete |
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
TUint | InvalidBlocks | ( | TUint | aBlocks | ) | [private, inline] |
Masks out valid TQueueStateBits block bit(s).
TUint aBlocks |
CHCICommandQItem * | LastQueueItem | ( | TDblQue < CHCICommandQItem > & | aQueue | ) | [private, inline] |
Returns the item at the tail of the specified queue, or NULL if the queue is empty.
TDblQue < CHCICommandQItem > & aQueue |
void | MhceoEventNotification | ( | const THCIEventBase & | aEvent | ) | [private, virtual] |
Virtuals from MHCICommandEventObserver
const THCIEventBase & aEvent |
TUint | MhcqAddCommandL | ( | CHCICommandQItem * | aQueItem | ) | [virtual] |
Virtuals from MHCICommandQueue
CHCICommandQItem * aQueItem |
TUint | MhcqAddCommandL | ( | CHCICommandBase * | aCommandData, |
MHCICommandQueueClient & | aCmdProgressRecipient | |||
) | [virtual] |
CHCICommandBase * aCommandData | |
MHCICommandQueueClient & aCmdProgressRecipient |
TUint | MhcqAddInitCommandL | ( | CHCICommandQItem * | aQueItem | ) | [virtual] |
CHCICommandQItem * aQueItem |
TUint | MhcqAddInitCommandL | ( | CHCICommandBase * | aCommandData, |
MHCICommandQueueClient & | aCmdProgressRecipient | |||
) | [virtual] |
CHCICommandBase * aCommandData | |
MHCICommandQueueClient & aCmdProgressRecipient |
TUint | MhcqAddPriorityCommandL | ( | CHCICommandQItem * | aQueItem | ) | [virtual] |
CHCICommandQItem * aQueItem |
TUint | MhcqAddPriorityCommandL | ( | CHCICommandBase * | aCommandData, |
MHCICommandQueueClient & | aCmdProgressRecipient | |||
) | [virtual] |
CHCICommandBase * aCommandData | |
MHCICommandQueueClient & aCmdProgressRecipient |
TAny * | MhcqQdpPluginInterface | ( | TUid | aUid | ) | const [virtual] |
TUid aUid |
void | MhcqRemoveAllCommands | ( | const MHCICommandQueueClient & | aCmdOriginator | ) | [virtual] |
const MHCICommandQueueClient & aCmdOriginator |
TInt | MhcqRemoveCommand | ( | TUint | aCommandId, |
const MHCICommandQueueClient & | aCmdOriginator | |||
) | [virtual] |
TUint aCommandId | |
const MHCICommandQueueClient & aCmdOriginator |
CHCICommandQItem * | MhcquiFindOutstandingCommand | ( | THCIOpcode | aOpcode | ) | [private] |
THCIOpcode aOpcode |
void | MhcquiInjectEvent | ( | const THCIEventBase & | aEvent | ) | [private] |
const THCIEventBase & aEvent |
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.
const TDblQue < CHCICommandQItem > & aQueue |
TUint | NextCommandQueueItemId | ( | ) | [private, inline] |
Returns the next Command Queue Item Id
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.
CHCICommandQItem *& aCmdQItem | |
TUint aBypassBlocks |
void | ProcessCommandCompletionTimeout | ( | CHCICommandQItem * | aCmd | ) | [private] |
Processes timed out commands.
CHCICommandQItem * aCmd |
void | ProcessEvent | ( | const THCIEventBase & | aEvent, |
TBool | aSendToQdp | |||
) | [private] |
const THCIEventBase & aEvent | |
TBool aSendToQdp |
void | ProcessMatchedErrorEvent | ( | const THCIEventBase & | aEvent, |
CHCICommandQItem * | aCmd, | |||
TBool | aConcludesCmd, | |||
TBool | aSendToQdp | |||
) | [private] |
Process matched error events.
const THCIEventBase & aEvent | |
CHCICommandQItem * aCmd | |
TBool aConcludesCmd | |
TBool aSendToQdp |
void | ProcessMatchedEvent | ( | const THCIEventBase & | aEvent, |
CHCICommandQItem * | aCmd, | |||
TBool | aConcludesCmd | |||
) | [private] |
Process matched non-error events.
const THCIEventBase & aEvent | |
CHCICommandQItem * aCmd | |
TBool aConcludesCmd |
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.
void | ProcessRegularQueue | ( | TDblQue < CHCICommandQItem > & | aQueue | ) | [private] |
Processes a regular queue - normal or initialization command queue.
TDblQue < CHCICommandQItem > & aQueue |
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.
void | ProcessUnmatchedEvent | ( | const THCIEventBase & | aEvent, |
TBool | aSendToQdp | |||
) | [private] |
Processes unmatched events.
const THCIEventBase & aEvent | |
TBool aSendToQdp |
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.
void | PurgeAllQueues | ( | ) | [private, inline] |
Purge the queues up to previously saved purge marks.
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.
TDblQue < CHCICommandQItem > & aQueue | |
CHCICommandQItem * aMark |
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.
void | RemoveAllCommands | ( | TDblQueIter < CHCICommandQItem > | aIter, |
const MHCICommandQueueClient & | aCmdOriginator, | |||
TBool | aCanDelete | |||
) | [private] |
TDblQueIter < CHCICommandQItem > aIter | |
const MHCICommandQueueClient & aCmdOriginator | |
TBool aCanDelete |
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
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.
TDblQue < CHCICommandQItem > & aQueue | |
THCIOpcode aOpcode |
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.
TDblQue < CHCICommandQItem > & aQueue | |
TUint aCmdId |
void | SendCommand | ( | CHCICommandQItem & | aCmdQItem | ) | [private] |
Submits a request to the link muxer for permission to send a command.
CHCICommandQItem & aCmdQItem |
void | SetBlock | ( | TUint | aBlocks | ) | [private, inline] |
Sets the specified TQueueStateBits block(s).
TUint aBlocks |
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.
MHCICommandAllocator & aCommandAllocator | Implementation of command allocator interface. |
IMPORT_C void | SetHCIUnmatchedEventObserver | ( | MHCICommandQueueClient & | aUnmatchedEventObserver | ) |
Sets the command queue client that will subsequently receive unmatched events.
MHCICommandQueueClient & aUnmatchedEventObserver | An instance implementing the command queue client interface. |
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.
MHCTLInterface & aHctlInterface | An instance implementing the interface to the HCTL. |
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.
MHardResetInitiator & aHardResetInitiator | An instance implementing the interface to the Hard Reset Initiator. |
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.
MLinkMuxNotifier & aLinkMuxer | An instance implementing the interface to the Link Muxer. |
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..
const MPhysicalLinksState & aStackInfo | An instance implementing the interface to the physical links state information. |
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.
CHCICommandQItem * aPreviousCmd | |
const THCIEventBase * aPreviousCmdResult |
IMPORT_C void | Start | ( | ) |
void | StarvationTimeoutFired | ( | TUint | aWasNextPendingCmdId | ) | [virtual] |
TUint aWasNextPendingCmdId |
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.
void | TryToSend | ( | ) | [private] |
The main queue processing routine. Schedules the next command and asks HCTL to send.
void | UpdateCommandCredits | ( | TUint8 | aCommandCredits | ) | [private, inline] |
Updates the command credits counter and maintains the EInsufficientCreditBlock
TUint8 aCommandCredits |
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.
TUint | ValidBlocks | ( | TUint | aBlocks | ) | [private, inline] |
Masks out invalid TQueueStateBits block bit(s).
TUint aBlocks |
Command queue block bit flags.
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. |
Command queue controller state
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() . |
CAsyncCallBack * | iAsyncCallBackForReset | [private] |
Async Callbacks
TCmdQControllerStates | iCmdQControllerState | [private] |
The CHCICmdQController state variable
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 | [private] |
This is a bit mask of the possible TQueueStateBits states
TDblQue < CHCICommandQItem > | iInitCommandQ | [private] |
The queue of initialisation commands that have not yet been processed.
CHCICommandQItem * | iInitQPurgeMark | [private] |
Recorded tails of the queues for Reset processing.
TUint | iNextCommandQItemId | [private] |
A counter generating IDs to uniquely identify commands.
TDblQue < CHCICommandQItem > | iNormalCommandQ | [private] |
The queue of normal commands that have not yet been processed.
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 | [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.
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.
MHCICmdQueueEventModifierInterface * | iQdpEventModifier | [private] |
CHCICmdQueueDecisionPlugin * | iQdpPlugin | [private] |
The QDP that the Command Queue will use.
TDblQue < CHCICommandQItem > | iResendCommandQ | [private] |
The queue of commands that are waiting to be re-sent to the controller.
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 | [private] |
The queue of commands that have been sent to the controller but have not yet had a response.
MHCICommandQueueClient * | iUnmatchedEventObserver | [private] |
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.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.