• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * trafficAdmControl.h
3  *
4  * Copyright(c) 1998 - 2009 Texas Instruments. All rights reserved.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  *  * Redistributions of source code must retain the above copyright
12  *    notice, this list of conditions and the following disclaimer.
13  *  * Redistributions in binary form must reproduce the above copyright
14  *    notice, this list of conditions and the following disclaimer in
15  *    the documentation and/or other materials provided with the
16  *    distribution.
17  *  * Neither the name Texas Instruments nor the names of its
18  *    contributors may be used to endorse or promote products derived
19  *    from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  */
33 
34 
35 /***************************************************************************/
36 /*																		   */
37 /*		MODULE:	admCtrl.c												   */
38 /*    PURPOSE:	WSM/WME admission Control							   */
39 /*																	 	   */
40 /***************************************************************************/
41 
42 #ifndef _ADM_CTRL_SM_H
43 #define _ADM_CTRL_SM_H
44 
45 #include "fsm.h"
46 #include "qosMngr_API.h"
47 #include "mlmeApi.h"
48 
49 #define INITIAL_DIALOG_TOKEN	1
50 
51 /* state machine states */
52 typedef enum
53 {
54 	TRAFFIC_ADM_CTRL_SM_STATE_IDLE			= 0,
55 	TRAFFIC_ADM_CTRL_SM_STATE_WAIT   		= 1
56 } trafficAdmCtrl_smState_t;
57 
58 /* State machine inputs */
59 typedef enum
60 {
61 	TRAFFIC_ADM_CTRL_SM_EVENT_START			= 0,
62 	TRAFFIC_ADM_CTRL_SM_EVENT_STOP			= 1,
63 	TRAFFIC_ADM_CTRL_SM_EVENT_ACCEPT    	= 2,
64     TRAFFIC_ADM_CTRL_SM_EVENT_REJECT		= 3,
65    	TRAFFIC_ADM_CTRL_SM_EVENT_TIMEOUT		= 4
66 } trafficAdmCtrl_smEvents_t;
67 
68 
69 typedef struct
70 {
71 	TI_UINT8					tsInfo[3];
72 	trafficAdmCtrl_smState_t	rafficAdmCtrlSmCurrState;
73 }tidInfo_t;
74 
75 
76 typedef struct
77 {
78 	TI_HANDLE			        hTxMgmtQ;
79 	TI_HANDLE			        hReport;
80 	TI_HANDLE			        hOs;
81 	TI_HANDLE			        hQosMngr;
82 	TI_HANDLE					hCtrlData;
83 	TI_HANDLE					hXCCMgr;
84 	TI_HANDLE					hTimer;
85 	TI_HANDLE					hTWD;
86 	TI_HANDLE					hTxCtrl;
87 
88 	TI_HANDLE			        hAdmCtrlTimer[MAX_NUM_OF_AC];
89 	TI_UINT8				    currentState[MAX_NUM_OF_AC];
90 	TI_UINT8				    dialogToken[MAX_NUM_OF_AC];
91 
92 	TI_UINT8				    dialogTokenCounter;
93 
94 
95 	fsm_stateMachine_t	        *pTrafficAdmCtrlSm;
96 
97 	TI_UINT32				     timeout;
98     TI_BOOL                      useFixedMsduSize;
99 
100 
101 } trafficAdmCtrl_t;
102 
103 
104 
105 
106 TI_HANDLE trafficAdmCtrl_create(TI_HANDLE pOs);
107 
108 TI_STATUS trafficAdmCtrl_unload(TI_HANDLE hTrafficAdmCtrl);
109 
110 TI_STATUS trafficAdmCtrl_config (TI_HANDLE hTrafficAdmCtrl,
111     						     TI_HANDLE hTxMgmtQ,
112     						     TI_HANDLE hReport,
113     						     TI_HANDLE hOs,
114     						     TI_HANDLE hQosMngr,
115     						     TI_HANDLE hCtrlData,
116     						     TI_HANDLE hXCCMgr,
117     						     TI_HANDLE hTimer,
118     						     TI_HANDLE hTWD,
119                                  TI_HANDLE hTxCtrl,
120     						     trafficAdmCtrlInitParams_t	*pTrafficAdmCtrlInitParams);
121 
122 TI_STATUS trafficAdmCtrl_setParam(TI_HANDLE hTrafficAdmCtrl, paramInfo_t	*pParam);
123 
124 TI_STATUS trafficAdmCtrl_getParam(TI_HANDLE hTrafficAdmCtrl, paramInfo_t	*pParam);
125 
126 TI_STATUS trafficAdmCtrl_startAdmRequest(TI_HANDLE	hTrafficAdmCtrl, tspecInfo_t *pTSpecInfo);
127 
128 TI_STATUS trafficAdmCtrl_stopAdmRequest(TI_HANDLE hTrafficAdmCtrl, TI_UINT8 tid);
129 
130 TI_STATUS trafficAdmCtrl_stop(TI_HANDLE hTrafficAdmCtrl);
131 
132 TI_STATUS trafficAdmCtrl_recv(TI_HANDLE hTrafficAdmCtrl, TI_UINT8* pData, TI_UINT8 action);
133 
134 TI_STATUS trafficAdmCtrl_sendDeltsFrame(TI_HANDLE hTrafficAdmCtrl, tspecInfo_t *pTSpecInfo, TI_UINT8 reasonCode);
135 
136 void trafficAdmCtrl_print(trafficAdmCtrl_t *pTrafficAdmCtr);
137 
138 void trafficAdmCtrl_buildTSPec(trafficAdmCtrl_t	*pTrafficAdmCtrl,
139 							   tspecInfo_t		*pTSpecInfo,
140 							   TI_UINT8				*pDataBuff,
141 							   TI_UINT32			*len);
142 void trafficAdmCtrl_parseTspecIE(tspecInfo_t *pTSpecInfo, TI_UINT8 *pData);
143 #endif
144 
145