Dual Mode Manager Scheduler.
DMM enables devices to run multiple wireless protocol stacks concurrently. The DMMSch is to enable concurrent operation of multiple stacks with minimized conflicts so that it does not cause significant performance degradation. The DMMSch uses Application Level, Stack Level information, and Global Priority Table (GPT) when scheduling a command. Stack Level information (provided by stack) is embedded in each RF command and it includes:
- Start Type, Start Time, AllowDelay, Priority, Activity, etc. Application Level information (provided by User via the Policy Table) includes:
- Application State Name, Weight, AppliedActivity, Pause, etc. Global Priority Table (GPT)
- GPT defines relative priorities of the two stacks The DMMSch uses Start Type, Start Time, and AllowDelay (Stack Level Information) when scheduling a RF command and tries to avoid a conflict by delaying the command if allowed. When a command conflicts with another (during scheduling or execution), The DMMSch selects one command over the other based on the final priority of two commands as below: Final Priority = GPT (Stack level priority) + weight (Application Level)
DMMSch API
To use the DMMSch module to schedule a tacks RF commands, the application calls the following APIs:
- DMMSch_init(): Initialize the DMMSch module/task.
- DMMSch_Params_init(): Initialize a DMMSch_Params structure with default values. Then change the parameters from non-default values as needed.
- DMMSch_open(): Open an instance of the DMMSch module, passing the initialized parameters.
- Stack A application - DMMSch_registerClient: Passes Task_Handle and StackRole so DMMSch can map the Task_Handle to the stack role
- Stack A application - Rf_open -> DMMSch_rfOpen: DMMSch overwrites the RF_Mode and rf patches for multi-mode operation, maps RF Handle to the stack ID, assigns phySwitchingTime for DMM operation. From this point, Task_Handle, StackRole, and Stack ID are all related.
- Stack B application - DMMSch_registerClient: Passes Task_Handle and StackRole so DMMSch can map the Task_Handle to the stack role
- Stack B application - Rf_open -> DMMSch_rfOpen: Rf_open -> DMMSch_rfOpen: DMMSch overwrites the RF_Mode and rf patches for multi-mode operation, maps RF Handle to the stack ID, assigns phySwitchingTime for DMM operation. From this point, Task_Handle, StackRole, and Stack ID are all related.
- Stack A application - RF_scheduleCmd -> DMMSch_rfScheduleCmd: DMMSch adjusted timing based on policy
- Stack B application - RF_scheduleCmd -> DMMSch_rfScheduleCmd: DMMSch adjusted timing based on policy
|
void | DMMSch_Params_init (DMMSch_Params *params) |
| Function to initialize the DMMSch_Params struct to its defaults. More...
|
|
void | DMMSch_init (void) |
| Function that initializes the DMMSch module. More...
|
|
void | DMMSch_registerPreemptionCb (DMMSch_PreemptionCb dmmSchPreemptionCb) |
| allows policy manager to register a callback on command preemption More...
|
|
void | DMMSch_open (DMMSch_Params *params) |
| Function to open the DMMSch module. More...
|
|
void | DMMSch_registerClient (Task_Handle *pTaskHndl, DMMPolicy_StackRole StackRole) |
| Register an DMM Scheduler client. More...
|
|
RF_Handle | DMMSch_rfOpen (RF_Object *pObj, RF_Mode *pRfMode, RF_RadioSetup *pOpSetup, RF_Params *params) |
| Intercepts calls from a stack to RF_postCmd (re-mapped to DMMSch_rfOpen), The DMMSch module uses this to tie. More...
|
|
RF_CmdHandle | DMMSch_rfPostCmd (RF_Handle h, RF_Op *pOp, RF_Priority ePri, RF_Callback pCb, RF_EventMask bmEvent) |
| Handles calls from a stack to RF_postCmd (re-mapped to DMMSch_postCmd), adjusts timing as necessary and schedules then accordingly with RF_scheduleCmd. More...
|
|
RF_CmdHandle | DMMSch_rfScheduleCmd (RF_Handle h, RF_Op *pOp, RF_ScheduleCmdParams *pSchParams, RF_Callback pCb, RF_EventMask bmEvent) |
| Handles calls from a stack to RF_scheduleCmd (re-mapped to DMMSch_scheduleCmd), adjusts timing as necessary and schedules then accordingly with RF_scheduleCmd. More...
|
|
RF_EventMask | DMMSch_rfRunCmd (RF_Handle h, RF_Op *pOp, RF_Priority ePri, RF_Callback pCb, RF_EventMask bmEvent) |
| Handles calls from a stack to RF_runCmd (re-mapped to DMMSch_runCmd), adjusts timing as necessary and schedules then accordingly with RF_scheduleCmd. More...
|
|
RF_EventMask | DMMSch_rfRunScheduleCmd (RF_Handle h, RF_Op *pOp, RF_ScheduleCmdParams *pSchParams, RF_Callback pCb, RF_EventMask bmEvent) |
| Handles calls from a stack to RF_runScheduleCmd (re-mapped to DMMSch_runScheduleCmd), adjusts timing as necessary and schedules then accordingly with RF_scheduleCmd. More...
|
|
RF_Stat | DMMSch_rfCancelCmd (RF_Handle h, RF_CmdHandle ch, uint8_t mode) |
| Abort/stop/cancel single command in command queue. More...
|
|
RF_Stat | DMMSch_rfFlushCmd (RF_Handle h, RF_CmdHandle ch, uint8_t mode) |
| Abort/stop/cancel command and any subsequent commands in command queue. More...
|
|
RF_Stat | DMMSch_rfRunImmediateCmd (RF_Handle h, uint32_t *pCmdStruct) |
| Send any Immediate command.
More...
|
|
RF_Stat | DMMSch_rfRunDirectCmd (RF_Handle h, uint32_t cmd) |
| Send any Direct command.
More...
|
|
bool | DMMSch_setBlockModeOn (DMMPolicy_StackRole stackRole) |
| Turn on Block mode. More...
|
|
bool | DMMSch_setBlockModeOff (DMMPolicy_StackRole stackRole) |
| Turn off Block mode. More...
|
|
bool | DMMSch_getBlockModeStatus (DMMPolicy_StackRole stackRole) |
| Get Block mode status. More...
|
|
RF_Stat | DMMSch_rfRequestAccess (RF_Handle h, RF_AccessParams *pParams) |
| Request access RF API that should not be used in DMM
|
|
RF_Stat DMMSch_rfCancelCmd |
( |
RF_Handle |
h, |
|
|
RF_CmdHandle |
ch, |
|
|
uint8_t |
mode |
|
) |
| |
Abort/stop/cancel single command in command queue.
If command is running, aborts/stops it and posts callback for the aborted/stopped command.
If command has not yet run, cancels it it and posts callback for the cancelled command.
If command has already run or been aborted/stopped/cancelled, has no effect.
If RF_cancelCmd is called from a Swi context with same or higher priority than RF Driver Swi, when the RF core is powered OFF -> the cancel callback will be delayed until the next power-up cycle.
- Note
- Calling context : Task/SWI
- Parameters
-
h | Handle previously returned by RF_open() |
ch | Command handle previously returned by RF_postCmd(). |
mode | 1: Stop gracefully, 0: abort abruptly |
- Returns
- RF_Stat indicates if command was successfully completed
RF_Stat DMMSch_rfFlushCmd |
( |
RF_Handle |
h, |
|
|
RF_CmdHandle |
ch, |
|
|
uint8_t |
mode |
|
) |
| |
Abort/stop/cancel command and any subsequent commands in command queue.
If command is running, aborts/stops it and then cancels all later commands in queue.
If command has not yet run, cancels it and all later commands in queue.
If command has already run or been aborted/stopped/cancelled, has no effect.
The callbacks for all cancelled commands are issued in chronological order.
If RF_flushCmd is called from a Swi context with same or higher priority than RF Driver Swi, when the RF core is powered OFF -> the cancel callback will be delayed until the next power-up cycle.
- Note
- Calling context : Task/SWI
- Parameters
-
h | Handle previously returned by RF_open() |
ch | Command handle previously returned by RF_postCmd(). |
mode | 1: Stop gracefully, 0: abort abruptly |
- Returns
- RF_Stat indicates if command was successfully completed