diff options
| author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-22 10:38:37 -0500 |
|---|---|---|
| committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-22 10:38:37 -0500 |
| commit | fcc9d2e5a6c89d22b8b773a64fb4ad21ac318446 (patch) | |
| tree | a57612d1888735a2ec7972891b68c1ac5ec8faea /drivers/net/wireless/bcmdhd/uamp_api.h | |
| parent | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (diff) | |
Diffstat (limited to 'drivers/net/wireless/bcmdhd/uamp_api.h')
| -rw-r--r-- | drivers/net/wireless/bcmdhd/uamp_api.h | 176 |
1 files changed, 176 insertions, 0 deletions
diff --git a/drivers/net/wireless/bcmdhd/uamp_api.h b/drivers/net/wireless/bcmdhd/uamp_api.h new file mode 100644 index 00000000000..c51c68cd0ee --- /dev/null +++ b/drivers/net/wireless/bcmdhd/uamp_api.h | |||
| @@ -0,0 +1,176 @@ | |||
| 1 | /* | ||
| 2 | * Name: uamp_api.h | ||
| 3 | * | ||
| 4 | * Description: Universal AMP API | ||
| 5 | * | ||
| 6 | * Copyright (C) 1999-2011, Broadcom Corporation | ||
| 7 | * | ||
| 8 | * Unless you and Broadcom execute a separate written software license | ||
| 9 | * agreement governing use of this software, this software is licensed to you | ||
| 10 | * under the terms of the GNU General Public License version 2 (the "GPL"), | ||
| 11 | * available at http://www.broadcom.com/licenses/GPLv2.php, with the | ||
| 12 | * following added to such license: | ||
| 13 | * | ||
| 14 | * As a special exception, the copyright holders of this software give you | ||
| 15 | * permission to link this software with independent modules, and to copy and | ||
| 16 | * distribute the resulting executable under terms of your choice, provided that | ||
| 17 | * you also meet, for each linked independent module, the terms and conditions of | ||
| 18 | * the license of that module. An independent module is a module which is not | ||
| 19 | * derived from this software. The special exception does not apply to any | ||
| 20 | * modifications of the software. | ||
| 21 | * | ||
| 22 | * Notwithstanding the above, under no circumstances may you combine this | ||
| 23 | * software in any way with any other Broadcom software provided under a license | ||
| 24 | * other than the GPL, without Broadcom's express prior written consent. | ||
| 25 | * | ||
| 26 | * $Id: uamp_api.h,v 1.2.8.1 2011-02-05 00:16:14 Exp $ | ||
| 27 | * | ||
| 28 | */ | ||
| 29 | #ifndef UAMP_API_H | ||
| 30 | #define UAMP_API_H | ||
| 31 | |||
| 32 | |||
| 33 | #include "typedefs.h" | ||
| 34 | |||
| 35 | |||
| 36 | /***************************************************************************** | ||
| 37 | ** Constant and Type Definitions | ||
| 38 | ****************************************************************************** | ||
| 39 | */ | ||
| 40 | |||
| 41 | #define BT_API | ||
| 42 | |||
| 43 | /* Types. */ | ||
| 44 | typedef bool BOOLEAN; | ||
| 45 | typedef uint8 UINT8; | ||
| 46 | typedef uint16 UINT16; | ||
| 47 | |||
| 48 | |||
| 49 | /* UAMP identifiers */ | ||
| 50 | #define UAMP_ID_1 1 | ||
| 51 | #define UAMP_ID_2 2 | ||
| 52 | typedef UINT8 tUAMP_ID; | ||
| 53 | |||
| 54 | /* UAMP event ids (used by UAMP_CBACK) */ | ||
| 55 | #define UAMP_EVT_RX_READY 0 /* Data from AMP controller is ready to be read */ | ||
| 56 | #define UAMP_EVT_CTLR_REMOVED 1 /* Controller removed */ | ||
| 57 | #define UAMP_EVT_CTLR_READY 2 /* Controller added/ready */ | ||
| 58 | typedef UINT8 tUAMP_EVT; | ||
| 59 | |||
| 60 | |||
| 61 | /* UAMP Channels */ | ||
| 62 | #define UAMP_CH_HCI_CMD 0 /* HCI Command channel */ | ||
| 63 | #define UAMP_CH_HCI_EVT 1 /* HCI Event channel */ | ||
| 64 | #define UAMP_CH_HCI_DATA 2 /* HCI ACL Data channel */ | ||
| 65 | typedef UINT8 tUAMP_CH; | ||
| 66 | |||
| 67 | /* tUAMP_EVT_DATA: union for event-specific data, used by UAMP_CBACK */ | ||
| 68 | typedef union { | ||
| 69 | tUAMP_CH channel; /* UAMP_EVT_RX_READY: channel for which rx occured */ | ||
| 70 | } tUAMP_EVT_DATA; | ||
| 71 | |||
| 72 | |||
| 73 | /***************************************************************************** | ||
| 74 | ** | ||
| 75 | ** Function: UAMP_CBACK | ||
| 76 | ** | ||
| 77 | ** Description: Callback for events. Register callback using UAMP_Init. | ||
| 78 | ** | ||
| 79 | ** Parameters amp_id: AMP device identifier that generated the event | ||
| 80 | ** amp_evt: event id | ||
| 81 | ** p_amp_evt_data: pointer to event-specific data | ||
| 82 | ** | ||
| 83 | ****************************************************************************** | ||
| 84 | */ | ||
| 85 | typedef void (*tUAMP_CBACK)(tUAMP_ID amp_id, tUAMP_EVT amp_evt, tUAMP_EVT_DATA *p_amp_evt_data); | ||
| 86 | |||
| 87 | /***************************************************************************** | ||
| 88 | ** external function declarations | ||
| 89 | ****************************************************************************** | ||
| 90 | */ | ||
| 91 | #ifdef __cplusplus | ||
| 92 | extern "C" | ||
| 93 | { | ||
| 94 | #endif | ||
| 95 | |||
| 96 | /***************************************************************************** | ||
| 97 | ** | ||
| 98 | ** Function: UAMP_Init | ||
| 99 | ** | ||
| 100 | ** Description: Initialize UAMP driver | ||
| 101 | ** | ||
| 102 | ** Parameters p_cback: Callback function for UAMP event notification | ||
| 103 | ** | ||
| 104 | ****************************************************************************** | ||
| 105 | */ | ||
| 106 | BT_API BOOLEAN UAMP_Init(tUAMP_CBACK p_cback); | ||
| 107 | |||
| 108 | |||
| 109 | /***************************************************************************** | ||
| 110 | ** | ||
| 111 | ** Function: UAMP_Open | ||
| 112 | ** | ||
| 113 | ** Description: Open connection to local AMP device. | ||
| 114 | ** | ||
| 115 | ** Parameters app_id: Application specific AMP identifer. This value | ||
| 116 | ** will be included in AMP messages sent to the | ||
| 117 | ** BTU task, to identify source of the message | ||
| 118 | ** | ||
| 119 | ****************************************************************************** | ||
| 120 | */ | ||
| 121 | BT_API BOOLEAN UAMP_Open(tUAMP_ID amp_id); | ||
| 122 | |||
| 123 | /***************************************************************************** | ||
| 124 | ** | ||
| 125 | ** Function: UAMP_Close | ||
| 126 | ** | ||
| 127 | ** Description: Close connection to local AMP device. | ||
| 128 | ** | ||
| 129 | ** Parameters app_id: Application specific AMP identifer. | ||
| 130 | ** | ||
| 131 | ****************************************************************************** | ||
| 132 | */ | ||
| 133 | BT_API void UAMP_Close(tUAMP_ID amp_id); | ||
| 134 | |||
| 135 | |||
| 136 | /***************************************************************************** | ||
| 137 | ** | ||
| 138 | ** Function: UAMP_Write | ||
| 139 | ** | ||
| 140 | ** Description: Send buffer to AMP device. Frees GKI buffer when done. | ||
| 141 | ** | ||
| 142 | ** | ||
| 143 | ** Parameters: app_id: AMP identifer. | ||
| 144 | ** p_buf: pointer to buffer to write | ||
| 145 | ** num_bytes: number of bytes to write | ||
| 146 | ** channel: UAMP_CH_HCI_ACL, or UAMP_CH_HCI_CMD | ||
| 147 | ** | ||
| 148 | ** Returns: number of bytes written | ||
| 149 | ** | ||
| 150 | ****************************************************************************** | ||
| 151 | */ | ||
| 152 | BT_API UINT16 UAMP_Write(tUAMP_ID amp_id, UINT8 *p_buf, UINT16 num_bytes, tUAMP_CH channel); | ||
| 153 | |||
| 154 | /***************************************************************************** | ||
| 155 | ** | ||
| 156 | ** Function: UAMP_Read | ||
| 157 | ** | ||
| 158 | ** Description: Read incoming data from AMP. Call after receiving a | ||
| 159 | ** UAMP_EVT_RX_READY callback event. | ||
| 160 | ** | ||
| 161 | ** Parameters: app_id: AMP identifer. | ||
| 162 | ** p_buf: pointer to buffer for holding incoming AMP data | ||
| 163 | ** buf_size: size of p_buf | ||
| 164 | ** channel: UAMP_CH_HCI_ACL, or UAMP_CH_HCI_EVT | ||
| 165 | ** | ||
| 166 | ** Returns: number of bytes read | ||
| 167 | ** | ||
| 168 | ****************************************************************************** | ||
| 169 | */ | ||
| 170 | BT_API UINT16 UAMP_Read(tUAMP_ID amp_id, UINT8 *p_buf, UINT16 buf_size, tUAMP_CH channel); | ||
| 171 | |||
| 172 | #ifdef __cplusplus | ||
| 173 | } | ||
| 174 | #endif | ||
| 175 | |||
| 176 | #endif /* UAMP_API_H */ | ||
