1/* 2 * TI_IPC_Api.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/* TI IPC header file*/ 37/**/ 38/* Author : Texas Instruments*/ 39/**/ 40/* Filename: TI_IPC_Api.h*/ 41/**/ 42/* Version :1.0*/ 43/**/ 44/* Last update date : 15/03/2004*/ 45/**/ 46/*---------------------------------------------------------------*/ 47 48#ifndef _TI_IPC_API_H 49#define _TI_IPC_API_H 50 51#include "tidef.h" 52 53 54#define MAX_REGISTERED_MODULES 5 55#define MAX_EVENT_DATA_SIZE 128 56#define MAX_SEND_EVENTS 4 57 58#ifdef __cplusplus 59extern "C" { 60#endif 61 62/*******************Defines*********************/ 63 64/* WARNING! DON'T CHANGE THE ORDER OF EVENTS! */ 65/* OS EVENTS MUST COME FIRST!*/ 66 67enum 68{ 69 IPC_EVENT_ASSOCIATED = 0, 70 IPC_EVENT_DISASSOCIATED, 71 IPC_EVENT_LINK_SPEED, 72 IPC_EVENT_AUTH_SUCC, 73 IPC_EVENT_SCAN_REPORT, 74 IPC_EVENT_SCAN_COMPLETE, 75 IPC_EVENT_SCAN_STOPPED, 76 IPC_EVENT_CCKM_START, 77 IPC_EVENT_MEDIA_SPECIFIC, 78 IPC_EVENT_MAX_OS_EVENT = IPC_EVENT_MEDIA_SPECIFIC, 79 IPC_EVENT_EAPOL, 80 IPC_EVENT_BOUND, 81 IPC_EVENT_UNBOUND, 82 IPC_EVENT_PREAUTH_EAPOL, 83 IPC_EVENT_RESERVED2, 84 IPC_EVENT_LOW_RSSI, 85 IPC_EVENT_TSPEC_STATUS, 86 IPC_EVENT_TSPEC_RATE_STATUS, 87 IPC_EVENT_MEDIUM_TIME_CROSS, 88 IPC_EVENT_ROAMING_COMPLETE, 89 IPC_EVENT_EAP_AUTH_FAILURE, 90 IPC_EVENT_WPA2_PREAUTHENTICATION, 91 IPC_EVENT_TRAFFIC_INTENSITY_THRESHOLD_CROSSED, 92 IPC_EVENT_SCAN_FAILED, 93 IPC_EVENT_WPS_SESSION_OVERLAP, 94 IPC_EVENT_RSSI_SNR_TRIGGER, 95 IPC_EVENT_RSSI_SNR_TRIGGER_0, 96 IPC_EVENT_LOGGER, 97 IPC_EVENT_NOT_ASSOCIATED, 98 IPC_EVENT_BSS_LOSS, 99 IPC_EVENT_REASSOCIATION_RESP, 100 IPC_EVENT_IMMEDIATE_SCAN_REPORT, 101 IPC_EVENT_CONTINUOUS_SCAN_REPORT, 102 IPC_EVENT_RSSI_SNR_TRIGGER_1, 103 IPC_EVENT_AP_DISCONNECT, 104 IPC_EVENT_TX_RETRY_FALIURE, 105 IPC_EVENT_RE_AUTH_STARTED, 106 IPC_EVENT_RE_AUTH_COMPLETED, 107 IPC_EVENT_RE_AUTH_TERMINATED, 108 IPC_EVENT_TIMEOUT, 109 IPC_EVENT_GWSI, 110 IPC_EVENT_MAX 111}; 112 113enum 114{ 115 DELIVERY_PUSH =0, 116 DELIVERY_GET_DATA 117}; 118 119enum 120{ 121 SCAN_STATUS_COMPLETE = 0, 122 SCAN_STATUS_STOPPED = 1, 123 SCAN_STATUS_FAILED = 2 124}; 125 126/************************* IOCTLs Functions *******************************/ 127 128TI_HANDLE IPC_Init(void); 129 130TI_INT32 IPC_DeInit(void); 131 132TI_HANDLE IPC_DeviceOpen(void* AdapterName); /* get hDevice Handle*/ 133 134TI_INT32 IPC_DeviceClose(TI_HANDLE hDevice); 135 136TI_INT32 IPC_DeviceIoControl(TI_HANDLE hDevice, 137 TI_UINT32 IoControlCode, 138 void* pInBuffer, 139 TI_UINT32 InBufferSize, 140 void* pOutBuffer, 141 TI_UINT32 pOutBufferSize, 142 TI_UINT32* pBytesReturned); 143 144/************************* Events Functions *******************************/ 145 146typedef struct _IPC_EV_DATA * PIPC_EV_DATA; 147 148typedef TI_INT32 (*TI_EVENT_CALLBACK) (PIPC_EV_DATA pData); 149 150typedef struct _IPC_EVENT_PARAMS 151{ 152 TI_UINT32 uEventType; 153 TI_HANDLE uEventID; 154 TI_UINT32 uProcessID; 155 TI_UINT32 uDeliveryType; 156 TI_HANDLE hUserParam; /* Handle to back reference*/ 157 TI_EVENT_CALLBACK pfEventCallback; 158}IPC_EVENT_PARAMS; 159 160/* EvParams are assumed to be the first field. Any addtions shoild be made 161 afterwards 162 */ 163typedef struct _IPC_EV_DATA 164{ 165 IPC_EVENT_PARAMS EvParams; 166 TI_UINT32 uBufferSize; 167 TI_UINT8 uBuffer[MAX_EVENT_DATA_SIZE]; 168}IPC_EV_DATA; 169 170 171/*this function will also enable event and pass all the parameters about it*/ 172/* returns unique ID of registered event, to be passed later for unregister*/ 173TI_INT32 IPC_RegisterEvent(TI_HANDLE hDevice, /* Driver Handle*/ 174 IPC_EVENT_PARAMS* pEvParams); /* size of the structure + size of the params*/ 175 176TI_INT32 IPC_UnRegisterEvent(TI_HANDLE hDevice, 177 IPC_EVENT_PARAMS* pEvParams); /* returned by IPC_RegisterEvent*/ 178 179/***************************************************************************/ 180 181#ifdef __cplusplus 182} 183#endif 184 185#endif /*_IPC_UTIL_H*/ 186 187