summaryrefslogtreecommitdiffstats
path: root/src/phHciNfc_NfcIPMgmt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/phHciNfc_NfcIPMgmt.c')
-rw-r--r--src/phHciNfc_NfcIPMgmt.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/phHciNfc_NfcIPMgmt.c b/src/phHciNfc_NfcIPMgmt.c
index 06ef2a8..ed26ba3 100644
--- a/src/phHciNfc_NfcIPMgmt.c
+++ b/src/phHciNfc_NfcIPMgmt.c
@@ -1407,15 +1407,25 @@ phHciNfc_NfcIP_InfoUpdate(
(*reg_value & NFCIP_COMM_FACTOR);
p_nfcipinfo->max_frame_len = NFCIP_DATA_RATE_CALC(*reg_value);
- if (NULL != psHciContext->p_target_info)
+ if (p_nfcipinfo->max_frame_len > NFCIP_MAX_DEP_REQ_HDR_LEN)
{
- phHal_sNfcIPInfo_t *p_remtgt_info = NULL;
- /* This is given to user */
- p_remtgt_info =
- &(psHciContext->p_target_info->RemoteDevInfo.NfcIP_Info);
- p_remtgt_info->MaxFrameLength = p_nfcipinfo->max_frame_len;
- p_remtgt_info->Nfcip_Datarate = (phHalNfc_eDataRate_t)
+ p_nfcipinfo->max_frame_len -= NFCIP_MAX_DEP_REQ_HDR_LEN;
+
+ if (NULL != psHciContext->p_target_info)
+ {
+ phHal_sNfcIPInfo_t *p_remtgt_info = NULL;
+ /* This is given to user */
+ p_remtgt_info =
+ &(psHciContext->p_target_info->RemoteDevInfo.NfcIP_Info);
+ p_remtgt_info->MaxFrameLength = p_nfcipinfo->max_frame_len;
+ p_remtgt_info->Nfcip_Datarate = (phHalNfc_eDataRate_t)
p_nfcipinfo->initiator_speed;
+ }
+ }
+ else
+ {
+ status = PHNFCSTVAL(CID_NFC_HCI,
+ NFCSTATUS_INVALID_HCI_RESPONSE);
}
}
else