rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | /* Copyright Statement: |
| 2 | * |
| 3 | * This software/firmware and related documentation ("MediaTek Software") are |
| 4 | * protected under relevant copyright laws. The information contained herein is |
| 5 | * confidential and proprietary to MediaTek Inc. and/or its licensors. Without |
| 6 | * the prior written permission of MediaTek inc. and/or its licensors, any |
| 7 | * reproduction, modification, use or disclosure of MediaTek Software, and |
| 8 | * information contained herein, in whole or in part, shall be strictly |
| 9 | * prohibited. |
| 10 | * |
| 11 | * MediaTek Inc. (C) 2016~2017. All rights reserved. |
| 12 | * |
| 13 | * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES |
| 14 | * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") |
| 15 | * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER |
| 16 | * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL |
| 17 | * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED |
| 18 | * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR |
| 19 | * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH |
| 20 | * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, |
| 21 | * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES |
| 22 | * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. |
| 23 | * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO |
| 24 | * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK |
| 25 | * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE |
| 26 | * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR |
| 27 | * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S |
| 28 | * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE |
| 29 | * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE |
| 30 | * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE |
| 31 | * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. |
| 32 | * |
| 33 | * The following software/firmware and/or related documentation ("MediaTek |
| 34 | * Software") have been modified by MediaTek Inc. All revisions are subject to |
| 35 | * any receiver's applicable license agreements with MediaTek Inc. |
| 36 | */ |
| 37 | |
| 38 | #ifndef __BOOTS_MT6XX_H__ |
| 39 | #define __BOOTS_MT6XX_H__ |
| 40 | |
| 41 | #include <stdbool.h> |
| 42 | /** |
| 43 | * Type definition |
| 44 | */ |
| 45 | #ifndef FALSE |
| 46 | #define FALSE 0 |
| 47 | #endif |
| 48 | #ifndef TRUE |
| 49 | #define TRUE 1 |
| 50 | #endif |
| 51 | #ifndef BOOL |
| 52 | #define BOOL bool |
| 53 | #endif |
| 54 | |
| 55 | typedef unsigned char UCHAR; |
| 56 | typedef unsigned char UINT8; |
| 57 | typedef unsigned short UINT16; |
| 58 | typedef unsigned int UINT32; |
| 59 | typedef char INT8; |
| 60 | typedef short INT16; |
| 61 | typedef int INT32; |
| 62 | typedef long long INT64; |
| 63 | typedef void VOID; |
| 64 | typedef unsigned char* PUCHAR; |
| 65 | |
| 66 | |
| 67 | /* |
| 68 | * Structure Definitions |
| 69 | */ |
| 70 | #define HCI_CMD_PARM_LEN 256 |
| 71 | #define MAX_EVENT_SIZE 256 |
| 72 | |
| 73 | typedef struct _HCI_CMD_T { |
| 74 | UINT16 opCode; /* HCI command OpCode */ |
| 75 | UINT8 len; /* Length of the command parameters */ |
| 76 | UINT8 parms[HCI_CMD_PARM_LEN]; |
| 77 | } HCI_CMD_T; |
| 78 | |
| 79 | typedef struct _HCI_EVENT_T { |
| 80 | UINT8 event; /* HCI event type */ |
| 81 | UINT8 len; /* Length of the event parameters */ |
| 82 | UINT8 *parms; /* Event specific parameters */ |
| 83 | } HCI_EVENT_T; |
| 84 | |
| 85 | |
| 86 | typedef enum _ENUM_BT_STATUS_T { |
| 87 | BT_STATUS_SUCCESS = 0, |
| 88 | BT_STATUS_FAILED, |
| 89 | BT_STATUS_PENDING, |
| 90 | BT_STATUS_BUSY, |
| 91 | BT_STATUS_NO_RESOURCES, |
| 92 | BT_STATUS_NOT_FOUND, |
| 93 | BT_STATUS_DEVICE_NOT_FOUND, |
| 94 | BT_STATUS_CONNECTION_FAILED, |
| 95 | BT_STATUS_TIMEOUT, |
| 96 | BT_STATUS_NO_CONNECTION, |
| 97 | BT_STATUS_INVALID_PARM, |
| 98 | BT_STATUS_IN_PROGRESS, |
| 99 | BT_STATUS_RESTRICTED, |
| 100 | BT_STATUS_INVALID_TYPE, |
| 101 | BT_STATUS_HCI_INIT_ERR, |
| 102 | BT_STATUS_NOT_SUPPORTED, |
| 103 | BT_STATUS_IN_USE, |
| 104 | BT_STATUS_SDP_CONT_STATE, |
| 105 | BT_STATUS_CANCELLED, |
| 106 | BT_STATUS_NOSERVICES, |
| 107 | BT_STATUS_SCO_REJECT, |
| 108 | BT_STATUS_CHIP_REASON, |
| 109 | BT_STATUS_BLOCK_LIST, |
| 110 | BT_STATUS_SCATTERNET_REJECT |
| 111 | } ENUM_BT_STATUS_T; |
| 112 | |
| 113 | /* The record structure of bt nvram file */ |
| 114 | typedef struct |
| 115 | { |
| 116 | unsigned char addr[6]; /* BT address */ |
| 117 | unsigned char Voice[2]; /* Voice setting for SCO connection */ |
| 118 | unsigned char Codec[4]; /* PCM codec setting */ |
| 119 | unsigned char Radio[6]; /* RF configuration */ |
| 120 | unsigned char Sleep[7]; /* Sleep mode configuration */ |
| 121 | unsigned char BtFTR[2]; /* Other feature setting */ |
| 122 | unsigned char TxPWOffset[3]; /* TX power channel offset compensation */ |
| 123 | unsigned char CoexAdjust[6]; /* BT/WIFI coexistence performance adjustment */ |
| 124 | unsigned char Radio_ext[2]; /* RF configuration extended parameters */ |
| 125 | unsigned char TxPWOffset_ext[4]; /* Tx power channel offset compensation with new range */ |
| 126 | unsigned char Reserved1[2]; /* Reserved */ |
| 127 | unsigned char Reserved2[4]; /* Reserved */ |
| 128 | unsigned char Reserved3[8]; /* Reserved */ |
| 129 | unsigned char Reserved4[8]; /* Reserved */ |
| 130 | }__attribute__((packed)) ap_nvram_btradio_struct; |
| 131 | |
| 132 | |
| 133 | typedef union { |
| 134 | ap_nvram_btradio_struct fields; |
| 135 | unsigned char raw[sizeof(ap_nvram_btradio_struct)]; |
| 136 | } BT_NVRAM_DATA_T; |
| 137 | |
| 138 | typedef ENUM_BT_STATUS_T (*HCI_CMD_FUNC_T)(VOID); |
| 139 | typedef struct { |
| 140 | HCI_CMD_FUNC_T command_func; |
| 141 | } HCI_SEQ_T; |
| 142 | |
| 143 | typedef struct { |
| 144 | UINT32 chip_id; |
| 145 | BT_NVRAM_DATA_T bt_nvram; |
| 146 | HCI_SEQ_T *cur_script; |
| 147 | } BT_INIT_VAR_T; |
| 148 | |
| 149 | /* |
| 150 | * Function Declaration |
| 151 | */ |
| 152 | #endif // __BOOTS_MT6XX_H__ |