1 /****************************************************************************** 2 * 3 * Copyright (C) 1999-2012 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 /****************************************************************************/ 19 /* NFCC global definitions */ 20 /****************************************************************************/ 21 22 #ifndef NFCC_EXT_H 23 #define NFCC_EXT_H 24 25 #include "bt_target.h" 26 #include "nci_cmsgs.h" 27 #include "nci_defs.h" 28 29 extern void nfcc_init (void); 30 extern void * nfcc_find_conn_cb_by_conn_id(UINT8 conn_id); 31 extern void nfcc_proc_nfcee_discover(void); 32 extern void nfcc_proc_nfcee_uicc_vse_test(UINT8 ee_handle, UINT8 mode); 33 extern void lm_process_nfc (BT_HDR *p_msg); 34 35 /* 36 ** Definitions for events sent from NFCC to LMP 37 */ 38 #define NFCC_EVENT_START_DISCOVER 1 /* forward Start Discover cmd to peer NFCC */ 39 #define NFCC_EVENT_DISCOVER_RESP 2 /* A response to a Discover cmd */ 40 #define NFCC_EVENT_DATA 3 /* A response to a Discover cmd */ 41 #define NFCC_EVENT_DISCOVER_SELECT 4 /* forward Start Discover cmd to peer NFCC */ 42 #define NFCC_EVENT_DEACTIVATE 5 /* forward deactivate cmd to peer NFCC */ 43 44 45 #define NFCC_MAX_DISCOVER_PARAMS 7 46 47 /* this does not work if more than 329 */ 48 #define NFCC_MAX_PARAM_TLV_LEN 328 49 50 /* Discovery Type Masks - not in spec; for convenience/based on NCI_DISCOVERY_TYPE* */ 51 #define NCI_DISCOVERY_MASK_POLL_A 0x0001 52 #define NCI_DISCOVERY_MASK_POLL_B 0x0002 53 #define NCI_DISCOVERY_MASK_POLL_F 0x0004 54 #define NCI_DISCOVERY_MASK_LISTEN_A 0x0100 55 #define NCI_DISCOVERY_MASK_LISTEN_B 0x0200 56 #define NCI_DISCOVERY_MASK_LISTEN_F 0x0400 57 #define NCI_DISCOVERY_MASK_MAX 0x070F 58 59 typedef UINT16 tNCI_DISCOVERY_MASK; 60 61 #define NFCC_NUM_NFCEE 3 62 /* 63 ** Define a buffer that is used for data descriptors from HCID to LC 64 */ 65 typedef struct 66 { 67 BT_HDR hdr; /* Standard BT header */ 68 tNCI_DISCOVERY_MASK mask; /* sender is looking for anything in this mask */ 69 UINT8 num_params; 70 tNCI_DISCOVER_PARAMS params[NFCC_MAX_DISCOVER_PARAMS]; 71 UINT8 param_tlv[NFCC_MAX_PARAM_TLV_LEN]; 72 UINT16 param_tlv_len; 73 } tNFCC_START_DISCOVER; 74 75 typedef struct 76 { 77 BT_HDR hdr; /* Standard BT header */ 78 tNCI_DISCOVERY_MASK mask; /* sender is looking for anything in this mask */ 79 UINT8 num_params; 80 tNCI_DISCOVER_PARAMS params[NFCC_MAX_DISCOVER_PARAMS]; 81 UINT8 param_tlv[NFCC_MAX_PARAM_TLV_LEN]; 82 UINT16 param_tlv_len; 83 } tNFCC_DISCOVER_RESP; 84 85 typedef struct 86 { 87 BT_HDR hdr; /* Standard BT header */ 88 UINT8 target_handle; 89 UINT8 protocol; 90 } tNFCC_DISCOVER_SELECT; 91 92 /******************************************************************************** 93 ** 94 ** Structures used for NFCC Simulation to communicate with peer NFCC Simulation 95 */ 96 typedef union 97 { 98 BT_HDR hdr; 99 tNFCC_START_DISCOVER start_discover; 100 tNFCC_DISCOVER_RESP discover_resp; 101 tNFCC_DISCOVER_SELECT discover_select; 102 } tNFCC_TO_PEER; 103 104 105 #endif 106 107