summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/include/nfc_target.h161
-rw-r--r--src/nfa/dm/nfa_dm_api.cc6
-rwxr-xr-xsrc/nfa/include/nfa_api.h96
-rwxr-xr-xsrc/nfa/include/nfa_dm_int.h6
-rw-r--r--src/nfa/include/nfa_dta_int.h35
-rw-r--r--src/nfa/include/nfa_snep_api.h174
-rw-r--r--src/nfa/include/nfa_snep_int.h228
-rw-r--r--src/nfa/include/nfa_sys.h2
-rw-r--r--src/nfc/include/nfc_int.h17
-rw-r--r--src/nfc/nfc/nfc_ncif.cc5
-rw-r--r--tools/casimir/src/controller.rs4
11 files changed, 6 insertions, 728 deletions
diff --git a/src/include/nfc_target.h b/src/include/nfc_target.h
index 86ba6bf7..5eb59c96 100644
--- a/src/include/nfc_target.h
+++ b/src/include/nfc_target.h
@@ -346,171 +346,10 @@
/******************************************************************************
**
-** LLCP
-**
-******************************************************************************/
-
-#ifndef LLCP_TEST_INCLUDED
-#define LLCP_TEST_INCLUDED FALSE
-#endif
-
-#ifndef LLCP_POOL_ID
-#define LLCP_POOL_ID GKI_POOL_ID_3
-#endif
-
-#ifndef LLCP_POOL_BUF_SIZE
-#define LLCP_POOL_BUF_SIZE GKI_BUF3_SIZE
-#endif
-
-/* LLCP Maximum Information Unit (between LLCP_DEFAULT_MIU(128) and LLCP_MAX_MIU
- * (2175)*/
-#ifndef LLCP_MIU
-#define LLCP_MIU \
- (LLCP_POOL_BUF_SIZE - NFC_HDR_SIZE - NCI_MSG_OFFSET_SIZE - \
- NCI_DATA_HDR_SIZE - LLCP_PDU_HEADER_SIZE)
-#endif
-
-/* Link Timeout, LTO */
-#ifndef LLCP_LTO_VALUE
-/* Default is 100ms. It should be sufficiently larger than RWT */
-#define LLCP_LTO_VALUE 1000
-#endif
-
-/*
-** LTO is max time interval between the last bit received and the first bit sent
-** over the air. Link timeout must be delayed as much as time between the packet
-** sent from LLCP and the last bit transmitted at NFCC.
-** - 200ms, max OTA transmitting time between the first bit and the last bit at
-** NFCC. Largest MIU(2175bytes) of LLCP must be fragmented and sent on
-** NFC-DEP over the air. 8 * (DEP_REQ/RES+ACK) + DEP_REQ/RES for 2175 MIU at
-** 106kbps bit rate.
-** - 10ms, processing time
-*/
-#ifndef LLCP_INTERNAL_TX_DELAY
-#define LLCP_INTERNAL_TX_DELAY 210
-#endif
-
-/*
-** LTO is max time interval between the last bit received and the first bit sent
-** over the air. Link timeout must be delayed as much as time between the first
-** bit received at NFCC and the packet received at LLCP.
-** - 200ms, max OTA transmitting time between the first bit and the last bit at
-** NFCC. LLCP cannot receive data packet until all bit are received and
-** reassembled in NCI. 8 * (DEP_REQ/RES+ACK) + DEP_REQ/RES for 2175 MIU at
-** 106kbps bit rate.
-** - 10ms, processing time
-*/
-#ifndef LLCP_INTERNAL_RX_DELAY
-#define LLCP_INTERNAL_RX_DELAY 210
-#endif
-
-/* Wait for application layer sending data before sending SYMM */
-#ifndef LLCP_DELAY_RESP_TIME
-#define LLCP_DELAY_RESP_TIME 20 /* in ms */
-#endif
-
-/* LLCP inactivity timeout for initiator */
-#ifndef LLCP_INIT_INACTIVITY_TIMEOUT
-#define LLCP_INIT_INACTIVITY_TIMEOUT 0 /* in ms */
-#endif
-
-/* LLCP inactivity timeout for target */
-#ifndef LLCP_TARGET_INACTIVITY_TIMEOUT
-#define LLCP_TARGET_INACTIVITY_TIMEOUT 0 /* in ms */
-#endif
-
-/* LLCP delay timeout to send the first PDU as initiator */
-#ifndef LLCP_DELAY_TIME_TO_SEND_FIRST_PDU
-#define LLCP_DELAY_TIME_TO_SEND_FIRST_PDU 50 /* in ms */
-#endif
-
-/* Response Waiting Time */
-#ifndef LLCP_WAITING_TIME
-/* its scaled value should be less than LTO */
-#define LLCP_WAITING_TIME 8
-#endif
-
-/* Options Parameters */
-#ifndef LLCP_OPT_VALUE
-#define LLCP_OPT_VALUE LLCP_LSC_3 /* Link Service Class 3 */
-#endif
-
-/* Data link connection timeout */
-#ifndef LLCP_DATA_LINK_CONNECTION_TOUT
-#define LLCP_DATA_LINK_CONNECTION_TOUT 1000
-#endif
-
-/* Max length of service name */
-#ifndef LLCP_MAX_SN_LEN
-#define LLCP_MAX_SN_LEN 255 /* max length of service name */
-#endif
-
-/* Max number of well-known services, at least 2 for LM and SDP and up to 16 */
-#ifndef LLCP_MAX_WKS
-#define LLCP_MAX_WKS 5
-#endif
-
-/* Max number of services advertised by local SDP, up to 16 */
-#ifndef LLCP_MAX_SERVER
-#define LLCP_MAX_SERVER 10
-#endif
-
-/* Max number of services not advertised by local SDP, up to 32 */
-#ifndef LLCP_MAX_CLIENT
-#define LLCP_MAX_CLIENT 20
-#endif
-
-/* Max number of data link connections */
-#ifndef LLCP_MAX_DATA_LINK
-#define LLCP_MAX_DATA_LINK 16
-#endif
-
-/* Max number of outstanding service discovery requests */
-#ifndef LLCP_MAX_SDP_TRANSAC
-#define LLCP_MAX_SDP_TRANSAC 16
-#endif
-
-/* Percentage of LLCP buffer pool for receiving data */
-#ifndef LLCP_RX_BUFF_RATIO
-#define LLCP_RX_BUFF_RATIO 30
-#endif
-
-/* Rx congestion end threshold as percentage of receiving buffers */
-#ifndef LLCP_RX_CONGEST_END
-#define LLCP_RX_CONGEST_END 50
-#endif
-
-/* Rx congestion start threshold as percentage of receiving buffers */
-#ifndef LLCP_RX_CONGEST_START
-#define LLCP_RX_CONGEST_START 70
-#endif
-
-/* limitation of rx UI PDU as percentage of receiving buffers */
-#ifndef LLCP_LL_RX_BUFF_LIMIT
-#define LLCP_LL_RX_BUFF_LIMIT 30
-#endif
-
-/* minimum rx congestion threshold (number of rx I PDU in queue) for data link
- * connection */
-#ifndef LLCP_DL_MIN_RX_CONGEST
-#define LLCP_DL_MIN_RX_CONGEST 4
-#endif
-
-/* limitation of tx UI PDU as percentage of transmitting buffers */
-#ifndef LLCP_LL_TX_BUFF_LIMIT
-#define LLCP_LL_TX_BUFF_LIMIT 30
-#endif
-
-/******************************************************************************
-**
** NFA
**
******************************************************************************/
-#ifndef NFA_P2P_INCLUDED
-#define NFA_P2P_INCLUDED TRUE
-#endif
-
/* Maximum Idle time (no hcp) to wait for EE DISC REQ Ntf(s) */
#ifndef NFA_HCI_NETWK_INIT_IDLE_TIMEOUT
#define NFA_HCI_NETWK_INIT_IDLE_TIMEOUT 1000
diff --git a/src/nfa/dm/nfa_dm_api.cc b/src/nfa/dm/nfa_dm_api.cc
index 67c6b361..2b970d66 100644
--- a/src/nfa/dm/nfa_dm_api.cc
+++ b/src/nfa/dm/nfa_dm_api.cc
@@ -317,10 +317,6 @@ tNFA_STATUS NFA_GetConfig(uint8_t num_ids, tNFA_PMID* p_param_ids) {
** send commands to the tag. Incoming NDEF messages are sent to
** the NDEF callback.
**
-** Once exclusive RF control has started, NFA will not activate
-** LLCP internally. The application has exclusive control of
-** the link.
-**
** Note: If RF discovery is started,
** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should
** happen before calling this function
@@ -418,8 +414,6 @@ tNFA_STATUS NFA_ReleaseExclusiveRfControl(void) {
** - NFA_ACTIVATED_EVT is generated when an NFC link is
** activated.
** - NFA_NDEF_DETECT_EVT is generated if tag is activated
-** - NFA_LLCP_ACTIVATED_EVT/NFA_LLCP_DEACTIVATED_EVT is
-** generated if NFC-DEP is activated
** - NFA_DEACTIVATED_EVT will be returned after deactivating
** NFC link.
**
diff --git a/src/nfa/include/nfa_api.h b/src/nfa/include/nfa_api.h
index 8d14660d..508da8ea 100755
--- a/src/nfa/include/nfa_api.h
+++ b/src/nfa/include/nfa_api.h
@@ -95,8 +95,6 @@ typedef uint16_t tNFA_HANDLE;
#define NFA_HANDLE_GROUP_CE 0x0300
/* Handles to identify NFCEE */
#define NFA_HANDLE_GROUP_EE 0x0400
-/* P2P handles */
-#define NFA_HANDLE_GROUP_P2P 0x0500
/* HCI handles */
#define NFA_HANDLE_GROUP_HCI 0x0800
/* Local NDEF message handle */
@@ -286,9 +284,6 @@ typedef enum {
#define NFA_SELECT_CPLT_EVT 10 /* Select completed */
#define NFA_READ_CPLT_EVT 11 /* Read completed */
#define NFA_WRITE_CPLT_EVT 12 /* Write completed */
-#define NFA_LLCP_ACTIVATED_EVT 13 /* LLCP link is activated */
-/* LLCP link is deactivated */
-#define NFA_LLCP_DEACTIVATED_EVT 14
/* Response to NFA_RwPresenceCheck */
#define NFA_PRESENCE_CHECK_EVT 15
/* Tag Formating completed */
@@ -325,18 +320,10 @@ typedef enum {
#define NFA_UPDATE_RF_PARAM_RESULT_EVT 32
/* RF Interface error event */
#define NFA_RW_INTF_ERROR_EVT 34
-/* status of setting P2P listen technologies */
-#define NFA_SET_P2P_LISTEN_TECH_EVT 33
-/* First packet received over LLCP link */
-#define NFA_LLCP_FIRST_PACKET_RECEIVED_EVT 35
/* Listening enabled event */
#define NFA_LISTEN_ENABLED_EVT 36
/* Listening disabled event */
#define NFA_LISTEN_DISABLED_EVT 37
-/* P2P services paused event */
-#define NFA_P2P_PAUSED_EVT 38
-/* P2P services resumed event */
-#define NFA_P2P_RESUMED_EVT 39
/* T2T command completed */
#define NFA_T2T_CMD_CPLT_EVT 40
@@ -429,21 +416,6 @@ typedef struct {
uint8_t* p_data; /* data buffer */
} tNFA_CE_NDEF_WRITE_CPLT;
-/* Data for NFA_LLCP_ACTIVATED_EVT */
-typedef struct {
- bool is_initiator; /* TRUE if initiator */
- uint16_t remote_wks; /* Well-Known service mask of peer */
- uint8_t remote_lsc; /* Link Service Class of peer */
- uint16_t remote_link_miu; /* Link MIU of peer */
- uint16_t local_link_miu; /* Link MIU of local */
- uint8_t remote_version; /* LLCP version of remote */
-} tNFA_LLCP_ACTIVATED;
-
-/* Data for NFA_LLCP_DEACTIVATED_EVT */
-typedef struct {
- uint8_t reason; /* reason of deactivation */
-} tNFA_LLCP_DEACTIVATED;
-
/* Data for NFA_I93_CMD_CPLT_EVT */
typedef struct {
uint8_t dsfid; /* DSFID */
@@ -515,8 +487,6 @@ typedef union {
tNFA_TLV_DETECT tlv_detect; /* NFA_TLV_DETECT_EVT */
tNFA_RX_DATA data; /* NFA_DATA_EVT */
tNFA_CE_NDEF_WRITE_CPLT ndef_write_cplt; /* NFA_CE_NDEF_WRITE_CPLT_EVT */
- tNFA_LLCP_ACTIVATED llcp_activated; /* NFA_LLCP_ACTIVATED_EVT */
- tNFA_LLCP_DEACTIVATED llcp_deactivated; /* NFA_LLCP_DEACTIVATED_EVT */
tNFA_I93_CMD_CPLT i93_cmd_cplt; /* NFA_I93_CMD_CPLT_EVT */
tNFA_CE_REGISTERED ce_registered; /* NFA_CE_REGISTERED_EVT */
tNFA_CE_DEREGISTERED ce_deregistered; /* NFA_CE_DEREGISTERED_EVT */
@@ -766,7 +736,7 @@ extern void NFA_Init(tHAL_NFC_ENTRY* p_hal_entry_tbl);
** the application using the tNFA_DM_CBACK.
**
** The tNFA_CONN_CBACK parameter is used to register a callback
-** for polling, p2p and card emulation events.
+** for polling and card emulation events.
**
**
** Returns NFA_STATUS_OK if successfully initiated
@@ -909,8 +879,6 @@ extern tNFA_STATUS NFA_ReleaseExclusiveRfControl(void);
** - NFA_ACTIVATED_EVT is generated when an NFC link is
** activated.
** - NFA_NDEF_DETECT_EVT is generated if tag is activated
-** - NFA_LLCP_ACTIVATED_EVT/NFA_LLCP_DEACTIVATED_EVT is
-** generated if NFC-DEP is activated
** - NFA_DEACTIVATED_EVT will be returned after deactivating
** NFC link.
**
@@ -988,68 +956,6 @@ extern tNFA_STATUS NFA_DisableListening(void);
/*******************************************************************************
**
-** Function NFA_PauseP2p
-**
-** Description Pause P2P services.
-** NFA_P2P_PAUSED_EVT will be returned after P2P services are
-** disabled.
-**
-** The P2P services enabled by NFA_P2p* API functions are not
-** available. NFA_ResumeP2p() is called to resume the P2P
-** services.
-**
-** Note: If RF discovery is started,
-** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should
-** happen before calling this function
-**
-** Returns NFA_STATUS_OK if successfully initiated
-** NFA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-extern tNFA_STATUS NFA_PauseP2p(void);
-
-/*******************************************************************************
-**
-** Function NFA_ResumeP2p
-**
-** Description Resume P2P services.
-** NFA_P2P_RESUMED_EVT will be returned after P2P services are.
-** enables again.
-**
-** Note: If RF discovery is started,
-** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should
-** happen before calling this function
-**
-** Returns NFA_STATUS_OK if successfully initiated
-** NFA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-extern tNFA_STATUS NFA_ResumeP2p(void);
-
-/*******************************************************************************
-**
-** Function NFA_SetP2pListenTech
-**
-** Description This function is called to set listen technology for
-** NFC-DEP. This funtion may be called before or after starting
-** any server on NFA P2P/CHO/SNEP.
-** If there is no technology for NFC-DEP, P2P listening will be
-** stopped.
-**
-** NFA_SET_P2P_LISTEN_TECH_EVT without data will be returned.
-**
-** Note: If RF discovery is started,
-** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should
-** happen before calling this function
-**
-** Returns NFA_STATUS_OK if successfully initiated
-** NFA_STATUS_FAILED otherwise
-**
-*******************************************************************************/
-extern tNFA_STATUS NFA_SetP2pListenTech(tNFA_TECHNOLOGY_MASK tech_mask);
-
-/*******************************************************************************
-**
** Function NFA_StartRfDiscovery
**
** Description Start RF discovery
diff --git a/src/nfa/include/nfa_dm_int.h b/src/nfa/include/nfa_dm_int.h
index b918d6c8..167b56b9 100755
--- a/src/nfa/include/nfa_dm_int.h
+++ b/src/nfa/include/nfa_dm_int.h
@@ -108,12 +108,6 @@ typedef struct {
tNFA_TECHNOLOGY_MASK poll_mask;
} tNFA_DM_API_ENABLE_POLL;
-/* data type for NFA_DM_API_SET_P2P_LISTEN_TECH_EVT */
-typedef struct {
- NFC_HDR hdr;
- tNFA_TECHNOLOGY_MASK tech_mask;
-} tNFA_DM_API_SET_P2P_LISTEN_TECH;
-
/* data type for NFA_DM_API_CHANGE_DISCOVERY_TECH_EVT*/
typedef struct {
NFC_HDR hdr;
diff --git a/src/nfa/include/nfa_dta_int.h b/src/nfa/include/nfa_dta_int.h
index c844c071..df1910ef 100644
--- a/src/nfa/include/nfa_dta_int.h
+++ b/src/nfa/include/nfa_dta_int.h
@@ -198,41 +198,6 @@ typedef struct {
t4t_prop_aid_hdl; /* T4T registration handle for proprietary aid */
uint8_t nfc_dep_wt;
- bool llcp_cl_more_to_read; /* TRUE if there is more to read in llcp cl link*/
- bool llcp_co_more_to_read; /* TRUE if there is more to read in llcp recieve
- window*/
- bool llcp_is_initiator; /* TURE if IUT is LLCP initiator */
- uint16_t llcp_local_link_miu; /* link MIU of IUT */
- uint16_t llcp_remote_link_miu; /* link MIU of LT */
-
- uint8_t llcp_pattern_num_sap; /* SAP of pattern number exchange */
-
- uint8_t llcp_cl_in_local_sap; /* SAP of IUT-CL-IN-DEST */
- uint8_t llcp_cl_out_local_sap; /* SAP of IUT-CL-OUT-SRC */
- uint8_t llcp_cl_out_remote_sap; /* SAP of LT-CL-OUT-DEST */
-
- uint8_t llcp_co_in_local_sap; /* SAP of IUT-CO-IN-DEST */
- uint8_t llcp_co_in_remote_sap; /* SAP of LT-CO-IN-SRC */
- uint8_t llcp_co_out_local_sap; /* SAP of IUT-CO-OUT-SRC */
- uint8_t llcp_co_out_remote_sap; /* SAP of LT-CO-OUT-DEST */
-
- uint16_t llcp_co_out_remote_miu; /* MIU of LT-CO-OUT-DEST */
- uint8_t llcp_co_out_remote_rw; /* RW of LT-CO-OUT-DEST */
-
- uint8_t llcp_flags; /* internal flags for LLCP echo test */
- uint8_t llcp_sdp_tid_cl; /* SDP transaction ID for outbound connectionless */
- uint8_t
- llcp_sdp_tid_co; /* SDP transaction ID for outbound connection-oriented */
-
- TIMER_LIST_ENT llcp_cl_echo_timer; /* timer for the connectionless echo test
- application */
- TIMER_LIST_ENT llcp_co_echo_timer; /* timer for the connection-oriented echo
- test application */
- BUFFER_Q
- llcp_cl_buffer; /* buffer for the connectionless echo test application */
- BUFFER_Q llcp_co_buffer; /* buffer for the connection-oriented echo test
- application*/
-
tNFA_HANDLE snep_server_handle;
tNFA_HANDLE snep_server_conn_handle;
tNFA_HANDLE snep_client_handle;
diff --git a/src/nfa/include/nfa_snep_api.h b/src/nfa/include/nfa_snep_api.h
deleted file mode 100644
index c7238245..00000000
--- a/src/nfa/include/nfa_snep_api.h
+++ /dev/null
@@ -1,174 +0,0 @@
-/******************************************************************************
- *
- * Copyright (C) 2010-2014 Broadcom Corporation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at:
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- ******************************************************************************/
-
-/******************************************************************************
- *
- * This is the public interface file for NFA SNEP, Broadcom's NFC
- * application layer for mobile phones.
- *
- ******************************************************************************/
-#ifndef NFA_SNEP_API_H
-#define NFA_SNEP_API_H
-
-#include "nfa_api.h"
-
-/*****************************************************************************
-** Constants and data types
-*****************************************************************************/
-
-/* return an NDEF message */
-#define NFA_SNEP_REQ_CODE_GET 0x01
-/* accept an NDEF message */
-#define NFA_SNEP_REQ_CODE_PUT 0x02
-/* do not send remaining fragments */
-
-#define tNFA_SNEP_REQ_CODE uint8_t
-
-#define tNFA_SNEP_RESP_CODE uint8_t
-
-/* NFA SNEP callback events */
-/* Server/client Registeration Status */
-#define NFA_SNEP_REG_EVT 0x00
-/* LLCP link has been activated, client only */
-#define NFA_SNEP_ACTIVATED_EVT 0x01
-/* LLCP link has been deactivated, client only */
-#define NFA_SNEP_DEACTIVATED_EVT 0x02
-/* Data link has been created */
-#define NFA_SNEP_CONNECTED_EVT 0x03
-/* GET request from client */
-#define NFA_SNEP_GET_REQ_EVT 0x04
-/* PUT request from client */
-#define NFA_SNEP_PUT_REQ_EVT 0x05
-/* GET response from server */
-#define NFA_SNEP_GET_RESP_EVT 0x06
-/* PUT response from server */
-#define NFA_SNEP_PUT_RESP_EVT 0x07
-/* Failed to connect or disconnected */
-#define NFA_SNEP_DISC_EVT 0x08
-
-#define NFA_SNEP_ALLOC_BUFF_EVT \
- 0x09 /* Request to allocate a buffer for \
- NDEF*/
-#define NFA_SNEP_FREE_BUFF_EVT 0x0A /* Request to deallocate buffer for NDEF*/
-/* GET response sent to client */
-#define NFA_SNEP_GET_RESP_CMPL_EVT 0x0B
-
-typedef uint8_t tNFA_SNEP_EVT;
-
-/* Data for NFA_SNEP_REG_EVT */
-typedef struct {
- tNFA_STATUS status;
- tNFA_HANDLE reg_handle; /* handle for registered server/client */
- char service_name[LLCP_MAX_SN_LEN + 1]; /* only for server */
-} tNFA_SNEP_REG;
-
-/* Data for NFA_SNEP_ACTIVATED_EVT */
-typedef struct {
- tNFA_HANDLE client_handle; /* handle for registered client */
-} tNFA_SNEP_ACTIVATED;
-
-/* Data for NFA_SNEP_DEACTIVATED_EVT */
-typedef tNFA_SNEP_ACTIVATED tNFA_SNEP_DEACTIVATED;
-
-/* Data for NFA_SNEP_CONNECTED_EVT */
-/*
-** for server, new handle will be assigned for conn_handle
-** for client, handle used in NFA_SnepConnect () is returned in conn_handle
-*/
-typedef struct {
- tNFA_HANDLE reg_handle; /* server/client handle */
- tNFA_HANDLE conn_handle; /* handle for data link connection */
-} tNFA_SNEP_CONNECT;
-
-/* Data for NFA_SNEP_GET_REQ_EVT */
-typedef struct {
- tNFA_HANDLE conn_handle; /* handle for data link connection */
- uint32_t acceptable_length; /* acceptable length from client */
- uint32_t ndef_length; /* NDEF message length */
- uint8_t* p_ndef; /* NDEF message */
-} tNFA_SNEP_GET_REQ;
-
-/* Data for NFA_SNEP_PUT_REQ_EVT */
-typedef struct {
- tNFA_HANDLE conn_handle; /* handle for data link connection */
- uint32_t ndef_length; /* NDEF message length */
- uint8_t* p_ndef; /* NDEF message */
-} tNFA_SNEP_PUT_REQ;
-
-/* Data for NFA_SNEP_GET_RESP_EVT */
-typedef struct {
- tNFA_HANDLE conn_handle; /* handle for data link connection */
- tNFA_SNEP_RESP_CODE resp_code; /* response code from server */
- uint32_t ndef_length; /* NDEF message length */
- uint8_t* p_ndef; /* NDEF message */
-} tNFA_SNEP_GET_RESP;
-
-/* Data for NFA_SNEP_PUT_RESP_EVT */
-typedef struct {
- tNFA_HANDLE conn_handle; /* handle for data link connection */
- tNFA_SNEP_RESP_CODE resp_code; /* response code from server */
-} tNFA_SNEP_PUT_RESP;
-
-/* Data for NFA_SNEP_DISC_EVT */
-typedef struct {
- tNFA_HANDLE conn_handle; /* handle for data link connection */
- /* client_handle if connection failed */
-} tNFA_SNEP_DISC;
-
-/* Data for NFA_SNEP_ALLOC_BUFF_EVT */
-typedef struct {
- tNFA_HANDLE conn_handle; /* handle for data link connection */
- tNFA_SNEP_REQ_CODE
- req_code; /* NFA_SNEP_REQ_CODE_GET or NFA_SNEP_REQ_CODE_PUT */
- tNFA_SNEP_RESP_CODE resp_code; /* Response code if cannot allocate buffer */
- uint32_t ndef_length; /* NDEF message length */
- uint8_t* p_buff; /* buffer for NDEF message */
-} tNFA_SNEP_ALLOC;
-
-/* Data for NFA_SNEP_FREE_BUFF_EVT */
-typedef struct {
- tNFA_HANDLE conn_handle; /* handle for data link connection */
- uint8_t* p_buff; /* buffer to free */
-} tNFA_SNEP_FREE;
-
-/* Data for NFA_SNEP_GET_RESP_CMPL_EVT */
-typedef struct {
- tNFA_HANDLE conn_handle; /* handle for data link connection */
- uint8_t* p_buff; /* buffer for NDEF message */
-} tNFA_SNEP_GET_RESP_CMPL;
-
-/* Union of all SNEP callback structures */
-typedef union {
- tNFA_SNEP_REG reg; /* NFA_SNEP_REG_EVT */
- tNFA_SNEP_ACTIVATED activated; /* NFA_SNEP_ACTIVATED_EVT */
- tNFA_SNEP_DEACTIVATED deactivated; /* NFA_SNEP_DEACTIVATED_EVT */
- tNFA_SNEP_CONNECT connect; /* NFA_SNEP_CONNECTED_EVT */
- tNFA_SNEP_GET_REQ get_req; /* NFA_SNEP_GET_REQ_EVT */
- tNFA_SNEP_PUT_REQ put_req; /* NFA_SNEP_PUT_REQ_EVT */
- tNFA_SNEP_GET_RESP get_resp; /* NFA_SNEP_GET_RESP_EVT */
- tNFA_SNEP_PUT_RESP put_resp; /* NFA_SNEP_PUT_RESP_EVT */
- tNFA_SNEP_DISC disc; /* NFA_SNEP_DISC_EVT */
- tNFA_SNEP_ALLOC alloc; /* NFA_SNEP_ALLOC_BUFF_EVT */
- tNFA_SNEP_FREE free; /* NFA_SNEP_FREE_BUFF_EVT */
- tNFA_SNEP_GET_RESP_CMPL get_resp_cmpl; /* NFA_SNEP_GET_RESP_CMPL_EVT */
-} tNFA_SNEP_EVT_DATA;
-
-/* NFA SNEP callback */
-typedef void(tNFA_SNEP_CBACK)(tNFA_SNEP_EVT event, tNFA_SNEP_EVT_DATA* p_data);
-
-#endif /* NFA_P2P_API_H */
diff --git a/src/nfa/include/nfa_snep_int.h b/src/nfa/include/nfa_snep_int.h
deleted file mode 100644
index 83f6cb5b..00000000
--- a/src/nfa/include/nfa_snep_int.h
+++ /dev/null
@@ -1,228 +0,0 @@
-/******************************************************************************
- *
- * Copyright (C) 2010-2014 Broadcom Corporation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at:
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- ******************************************************************************/
-
-/******************************************************************************
- *
- * This is the private interface file for the NFA SNEP.
- *
- ******************************************************************************/
-#ifndef NFA_SNEP_INT_H
-#define NFA_SNEP_INT_H
-
-#if (NFA_SNEP_INCLUDED == TRUE)
-#include "llcp_api.h"
-#include "nfa_snep_api.h"
-
-/*****************************************************************************
-** Constants and data types
-*****************************************************************************/
-/* SNEP Acceptable Length size */
-
-/* NFA SNEP events */
-enum {
- NFA_SNEP_API_START_DEFAULT_SERVER_EVT = NFA_SYS_EVT_START(NFA_ID_SNEP),
- NFA_SNEP_API_STOP_DEFAULT_SERVER_EVT,
- NFA_SNEP_API_REG_SERVER_EVT,
- NFA_SNEP_API_REG_CLIENT_EVT,
- NFA_SNEP_API_DEREG_EVT,
- NFA_SNEP_API_CONNECT_EVT,
- NFA_SNEP_API_GET_REQ_EVT,
- NFA_SNEP_API_PUT_REQ_EVT,
- NFA_SNEP_API_GET_RESP_EVT,
- NFA_SNEP_API_PUT_RESP_EVT,
- NFA_SNEP_API_DISCONNECT_EVT
-
-};
-
-/* data type for NFA_SNEP_API_START_DEFAULT_SERVER_EVT */
-typedef struct {
- NFC_HDR hdr;
- tNFA_SNEP_CBACK* p_cback;
-} tNFA_SNEP_API_START_DEFAULT_SERVER;
-
-/* data type for NFA_SNEP_API_STOP_DEFAULT_SERVER_EVT */
-typedef struct {
- NFC_HDR hdr;
- tNFA_SNEP_CBACK* p_cback;
-} tNFA_SNEP_API_STOP_DEFAULT_SERVER;
-
-/* data type for NFA_SNEP_API_REG_SERVER_EVT */
-typedef struct {
- NFC_HDR hdr;
- uint8_t server_sap;
- char service_name[LLCP_MAX_SN_LEN + 1];
- tNFA_SNEP_CBACK* p_cback;
-} tNFA_SNEP_API_REG_SERVER;
-
-/* data type for NFA_SNEP_API_REG_CLIENT_EVT */
-typedef struct {
- NFC_HDR hdr;
- tNFA_SNEP_CBACK* p_cback;
-} tNFA_SNEP_API_REG_CLIENT;
-
-/* data type for NFA_SNEP_API_DEREG_EVT */
-typedef struct {
- NFC_HDR hdr;
- tNFA_HANDLE reg_handle; /* handle for registered server/client */
-} tNFA_SNEP_API_DEREG;
-
-/* data type for NFA_SNEP_API_CONNECT_EVT */
-typedef struct {
- NFC_HDR hdr;
- tNFA_HANDLE client_handle; /* handle for client */
- char service_name[LLCP_MAX_SN_LEN + 1];
-} tNFA_SNEP_API_CONNECT;
-
-/* data type for NFA_SNEP_API_GET_REQ_EVT */
-typedef struct {
- NFC_HDR hdr;
- tNFA_HANDLE conn_handle; /* handle for data link connection */
- uint32_t buff_length; /* length of buffer; acceptable length */
- uint32_t ndef_length; /* length of current NDEF message */
- uint8_t* p_ndef_buff; /* buffer for NDEF message */
-} tNFA_SNEP_API_GET_REQ;
-
-/* data type for NFA_SNEP_API_PUT_REQ_EVT */
-typedef struct {
- NFC_HDR hdr;
- tNFA_HANDLE conn_handle; /* handle for data link connection */
- uint32_t ndef_length; /* length of NDEF message */
- uint8_t* p_ndef_buff; /* buffer for NDEF message */
-} tNFA_SNEP_API_PUT_REQ;
-
-/* data type for NFA_SNEP_API_GET_RESP_EVT */
-typedef struct {
- NFC_HDR hdr;
- tNFA_HANDLE conn_handle; /* handle for data link connection */
- tNFA_SNEP_RESP_CODE resp_code; /* response code */
- uint32_t ndef_length; /* length of NDEF message */
- uint8_t* p_ndef_buff; /* buffer for NDEF message */
-} tNFA_SNEP_API_GET_RESP;
-
-/* data type for NFA_SNEP_API_PUT_RESP_EVT */
-typedef struct {
- NFC_HDR hdr;
- tNFA_HANDLE conn_handle; /* handle for data link connection */
- tNFA_SNEP_RESP_CODE resp_code; /* response code */
-} tNFA_SNEP_API_PUT_RESP;
-
-/* data type for NFA_SNEP_API_DISCONNECT_EVT */
-typedef struct {
- NFC_HDR hdr;
- tNFA_HANDLE conn_handle; /* response code */
- bool flush; /* TRUE if discard pending data */
-} tNFA_SNEP_API_DISCONNECT;
-
-/* union of all event data types */
-typedef union {
- NFC_HDR hdr;
- tNFA_SNEP_API_START_DEFAULT_SERVER
- api_start_default_server; /* NFA_SNEP_API_START_DEFAULT_SERVER_EVT */
- tNFA_SNEP_API_STOP_DEFAULT_SERVER
- api_stop_default_server; /* NFA_SNEP_API_STOP_DEFAULT_SERVER_EVT */
- tNFA_SNEP_API_REG_SERVER api_reg_server; /* NFA_SNEP_API_REG_SERVER_EVT */
- tNFA_SNEP_API_REG_CLIENT api_reg_client; /* NFA_SNEP_API_REG_CLIENT_EVT */
- tNFA_SNEP_API_DEREG api_dereg; /* NFA_SNEP_API_DEREG_EVT */
- tNFA_SNEP_API_CONNECT api_connect; /* NFA_SNEP_API_CONNECT_EVT */
- tNFA_SNEP_API_GET_REQ api_get_req; /* NFA_SNEP_API_GET_REQ_EVT */
- tNFA_SNEP_API_PUT_REQ api_put_req; /* NFA_SNEP_API_PUT_REQ_EVT */
- tNFA_SNEP_API_GET_RESP api_get_resp; /* NFA_SNEP_API_GET_RESP_EVT */
- tNFA_SNEP_API_PUT_RESP api_put_resp; /* NFA_SNEP_API_PUT_RESP_EVT */
- tNFA_SNEP_API_DISCONNECT api_disc; /* NFA_SNEP_API_DISCONNECT_EVT */
-} tNFA_SNEP_MSG;
-
-/*****************************************************************************
-** control block
-*****************************************************************************/
-
-/* NFA SNEP service control block */
-/* ignore flags while searching */
-/* waiting for connection confirm */
-/* data link connected */
-/* Waiting for continue response */
-/* Waiting for continue request */
-
-typedef struct {
- uint8_t local_sap; /* local SAP of service */
- uint8_t remote_sap; /* local SAP of service */
- uint8_t flags; /* internal flags */
- tNFA_SNEP_CBACK* p_cback; /* callback for event */
- TIMER_LIST_ENT timer; /* timer for client */
-
- uint16_t tx_miu; /* adjusted MIU for throughput */
- bool congest; /* TRUE if data link connection is congested */
- bool rx_fragments; /* TRUE if waiting more fragments */
-
- uint8_t tx_code; /* transmitted code in request/response */
- uint8_t rx_code; /* received code in request/response */
-
- uint32_t acceptable_length;
- uint32_t buff_length; /* size of buffer for NDEF message */
- uint32_t ndef_length; /* length of NDEF message */
- uint32_t cur_length; /* currently sent or received length */
- uint8_t* p_ndef_buff; /* NDEF message buffer */
-} tNFA_SNEP_CONN;
-
-/*
-** NFA SNEP control block
-*/
-typedef struct {
- tNFA_SNEP_CONN conn[NFA_SNEP_MAX_CONN];
- bool listen_enabled;
- bool is_dta_mode;
-} tNFA_SNEP_CB;
-
-/*
-** NFA SNEP default server control block
-*/
-
-/* multiple data link connections for default server */
-typedef struct {
- tNFA_HANDLE conn_handle; /* connection handle for default server */
- uint8_t* p_rx_ndef; /* buffer to receive NDEF */
-} tNFA_SNEP_DEFAULT_CONN;
-
-#define NFA_SNEP_DEFAULT_MAX_CONN 3
-
-typedef struct {
- tNFA_HANDLE server_handle; /* registered handle for default server */
- tNFA_SNEP_DEFAULT_CONN
- conn[NFA_SNEP_DEFAULT_MAX_CONN]; /* connections for default server */
-
-} tNFA_SNEP_DEFAULT_CB;
-
-/*****************************************************************************
-** External variables
-*****************************************************************************/
-
-/* NFA SNEP control block */
-extern tNFA_SNEP_CB nfa_snep_cb;
-
-/* NFA SNEP default server control block */
-extern tNFA_SNEP_DEFAULT_CB nfa_snep_default_cb;
-
-/*****************************************************************************
-** External functions
-*****************************************************************************/
-/*
-** nfa_snep_main.c
-*/
-void nfa_snep_init(bool is_dta_mode);
-
-#endif /* (NFA_SNEP_INCLUDED == TRUE) */
-#endif /* NFA_SNEP_INT_H */
diff --git a/src/nfa/include/nfa_sys.h b/src/nfa/include/nfa_sys.h
index a05b7325..86b428dc 100644
--- a/src/nfa/include/nfa_sys.h
+++ b/src/nfa/include/nfa_sys.h
@@ -37,8 +37,6 @@ enum {
NFA_ID_SYS, /* system manager */
NFA_ID_DM, /* device manager */
NFA_ID_EE, /* NFCEE sub-system */
- NFA_ID_P2P, /* Peer-to-Peer sub-system */
- NFA_ID_SNEP, /* SNEP sub-system */
NFA_ID_RW, /* Reader/writer sub-system */
NFA_ID_CE, /* Card-emulation sub-system */
NFA_ID_HCI, /* Host controller interface sub-system*/
diff --git a/src/nfc/include/nfc_int.h b/src/nfc/include/nfc_int.h
index c9606777..8140ffb6 100644
--- a/src/nfc/include/nfc_int.h
+++ b/src/nfc/include/nfc_int.h
@@ -48,20 +48,12 @@
#define NFC_WAIT_RSP_RAW_VS 0x02
#define NFC_TTYPE_WAIT_MODE_SET_NTF 2
-#define NFC_TTYPE_LLCP_LINK_MANAGER 100
-#define NFC_TTYPE_LLCP_LINK_INACT 101
-#define NFC_TTYPE_LLCP_DATA_LINK 102
-#define NFC_TTYPE_LLCP_DELAY_FIRST_PDU 103
#define NFC_TTYPE_RW_T1T_RESPONSE 104
#define NFC_TTYPE_RW_T2T_RESPONSE 105
#define NFC_TTYPE_RW_T3T_RESPONSE 106
#define NFC_TTYPE_RW_T4T_RESPONSE 107
#define NFC_TTYPE_RW_I93_RESPONSE 108
#define NFC_TTYPE_CE_T4T_UPDATE 109
-/* added for p2p prio logic timer */
-#define NFC_TTYPE_P2P_PRIO_RESPONSE 110
-/* added for p2p prio logic clenaup */
-#define NFC_TTYPE_P2P_PRIO_LOGIC_CLEANUP 111
#define NFC_TTYPE_RW_MFC_RESPONSE 112
/* time out for mode set notification */
#define NFC_MODE_SET_NTF_TIMEOUT 2
@@ -80,12 +72,6 @@ enum {
};
typedef uint8_t tNFC_STATE;
-/* DM P2P Priority event type */
-enum {
- NFA_DM_P2P_PRIO_RSP = 0x01, /* P2P priority event from RSP */
- NFA_DM_P2P_PRIO_NTF /* P2P priority event from NTF */
-};
-
/* NFC control block flags */
/* NFC_Deactivate () is called and the NCI cmd is not sent */
#define NFC_FL_DEACTIVATING 0x0001
@@ -288,10 +274,7 @@ extern void nfc_ncif_proc_reset_rsp(uint8_t* p, bool is_ntf);
extern void nfc_ncif_proc_init_rsp(NFC_HDR* p_msg);
extern void nfc_ncif_proc_get_config_rsp(NFC_HDR* p_msg);
extern void nfc_ncif_proc_data(NFC_HDR* p_msg);
-extern bool nfa_dm_p2p_prio_logic(uint8_t event, uint8_t* p, uint8_t ntf_rsp);
-extern void nfa_dm_p2p_timer_event();
extern bool nfc_ncif_proc_proprietary_rsp(uint8_t mt, uint8_t gid, uint8_t oid);
-extern void nfa_dm_p2p_prio_logic_cleanup();
extern void nfc_ncif_proc_isodep_nak_presence_check_status(uint8_t status,
bool is_ntf);
extern void nfc_ncif_proc_charging_status(uint8_t* p, uint8_t len);
diff --git a/src/nfc/nfc/nfc_ncif.cc b/src/nfc/nfc/nfc_ncif.cc
index fb991ddc..499ebc2a 100644
--- a/src/nfc/nfc/nfc_ncif.cc
+++ b/src/nfc/nfc/nfc_ncif.cc
@@ -299,6 +299,7 @@ void nfc_ncif_check_cmd_queue(NFC_HDR* p_buf) {
nfc_cb.nci_cmd_window--;
/* send to HAL */
+ nfcsnoop_capture(p_buf, false);
HAL_WRITE(p_buf);
/* start NFC command-timeout timer */
nfc_start_timer(&nfc_cb.nci_wait_rsp_timer,
@@ -363,7 +364,6 @@ void nfc_ncif_send_cmd(NFC_HDR* p_buf) {
/* post the p_buf to NCIT task */
p_buf->event = BT_EVT_TO_NFC_NCI;
p_buf->layer_specific = 0;
- nfcsnoop_capture(p_buf, false);
nfc_ncif_check_cmd_queue(p_buf);
}
@@ -404,6 +404,8 @@ bool nfc_ncif_process_event(NFC_HDR* p_msg) {
return free;
}
+ nfcsnoop_capture(p_msg, true);
+
NCI_MSG_PRS_HDR0(p, mt, pbf, gid);
oid = ((*p) & NCI_OID_MASK);
if (nfc_cb.rawVsCbflag == true &&
@@ -413,7 +415,6 @@ bool nfc_ncif_process_event(NFC_HDR* p_msg) {
return free;
}
- nfcsnoop_capture(p_msg, true);
switch (mt) {
case NCI_MT_DATA:
LOG(DEBUG) << StringPrintf("NFC received data");
diff --git a/tools/casimir/src/controller.rs b/tools/casimir/src/controller.rs
index 5c5c5da1..5ad19c6c 100644
--- a/tools/casimir/src/controller.rs
+++ b/tools/casimir/src/controller.rs
@@ -1041,7 +1041,7 @@ impl Controller {
info!("[{}] RF_DISCOVER_MAP_CMD", self.id);
let mut state = self.state.lock().await;
- state.discover_map = cmd.get_mapping_configurations().clone();
+ state.discover_map.clone_from(cmd.get_mapping_configurations());
self.send_control(nci::RfDiscoverMapResponseBuilder { status: nci::Status::Ok }).await?;
Ok(())
@@ -1091,7 +1091,7 @@ impl Controller {
return Ok(());
}
- state.discover_configuration = cmd.get_configurations().clone();
+ state.discover_configuration.clone_from(cmd.get_configurations());
state.rf_state = RfState::Discovery;
self.send_control(nci::RfDiscoverResponseBuilder { status: nci::Status::Ok }).await?;