nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1 | /****************************************************************************** |
| 2 | * |
| 3 | * Copyright (C) 2003-2014 Broadcom Corporation |
| 4 | * |
| 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | * you may not use this file except in compliance with the License. |
| 7 | * You may obtain a copy of the License at: |
| 8 | * |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | * |
| 11 | * Unless required by applicable law or agreed to in writing, software |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | * See the License for the specific language governing permissions and |
| 15 | * limitations under the License. |
| 16 | * |
| 17 | ******************************************************************************/ |
| 18 | |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 19 | /****************************************************************************** |
| 20 | * |
| 21 | * Protocol timer services. |
| 22 | * |
| 23 | ******************************************************************************/ |
| 24 | #ifndef NFA_SYS_PTIM_H |
| 25 | #define NFA_SYS_PTIM_H |
| 26 | |
| 27 | #include "gki.h" |
| 28 | |
| 29 | /***************************************************************************** |
| 30 | ** Constants and data types |
| 31 | *****************************************************************************/ |
| 32 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 33 | typedef struct { |
| 34 | TIMER_LIST_Q timer_queue; /* GKI timer queue */ |
| 35 | int32_t period; /* Timer period in milliseconds */ |
| 36 | uint32_t last_gki_ticks; /* GKI ticks since last time update called */ |
| 37 | uint8_t timer_id; /* GKI timer id */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 38 | } tPTIM_CB; |
| 39 | |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 40 | /***************************************************************************** |
| 41 | ** Function Declarations |
| 42 | *****************************************************************************/ |
| 43 | |
| 44 | /******************************************************************************* |
| 45 | ** |
| 46 | ** Function nfa_sys_ptim_init |
| 47 | ** |
| 48 | ** Description Initialize a protocol timer service control block. |
| 49 | ** |
| 50 | ** Returns void |
| 51 | ** |
| 52 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 53 | extern void nfa_sys_ptim_init(tPTIM_CB* p_cb, uint16_t period, |
| 54 | uint8_t timer_id); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 55 | |
| 56 | /******************************************************************************* |
| 57 | ** |
| 58 | ** Function nfa_sys_ptim_timer_update |
| 59 | ** |
| 60 | ** Description Update the protocol timer list and handle expired timers. |
| 61 | ** |
| 62 | ** Returns void |
| 63 | ** |
| 64 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 65 | extern void nfa_sys_ptim_timer_update(tPTIM_CB* p_cb); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 66 | |
| 67 | /******************************************************************************* |
| 68 | ** |
| 69 | ** Function nfa_sys_ptim_start_timer |
| 70 | ** |
| 71 | ** Description Start a protocol timer for the specified amount |
| 72 | ** of time in milliseconds. |
| 73 | ** |
| 74 | ** Returns void |
| 75 | ** |
| 76 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 77 | extern void nfa_sys_ptim_start_timer(tPTIM_CB* p_cb, TIMER_LIST_ENT* p_tle, |
| 78 | uint16_t type, int32_t timeout); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 79 | |
| 80 | /******************************************************************************* |
| 81 | ** |
| 82 | ** Function nfa_sys_ptim_stop_timer |
| 83 | ** |
| 84 | ** Description Stop a protocol timer. |
| 85 | ** |
| 86 | ** Returns void |
| 87 | ** |
| 88 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 89 | extern void nfa_sys_ptim_stop_timer(tPTIM_CB* p_cb, TIMER_LIST_ENT* p_tle); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 90 | |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 91 | #endif /* NFA_SYS_PTIM_H */ |